Interface SessionLayer

  • All Superinterfaces:
    java.lang.AutoCloseable
    All Known Implementing Classes:
    HdlcLayer, WrapperLayer

    public interface SessionLayer
    extends java.lang.AutoCloseable
    Interface to implement a DLMS SessionLayer.
    See Also:
    HdlcLayer, WrapperLayer
    • Method Detail

      • startListening

        void startListening​(SessionLayerListener eventListener)
                     throws java.io.IOException
        Function to start the connection.
        Parameters:
        eventListener - the listener.
        Throws:
        java.io.IOException - if an error occurs opening the connection to the remote meter.
      • send

        void send​(byte[] tSdu,
                  int off,
                  int len,
                  RawMessageData.RawMessageDataBuilder rawMessageBuilder)
           throws java.io.IOException
        Writes len bytes from the specified byte array starting at offset off to this output stream.
        Parameters:
        tSdu - the data.
        off - the start offset in the data.
        len - the number of bytes to write.
        rawMessageBuilder - the raw byte array message builder for logging purposes.
        Throws:
        java.io.IOException - if an I/O error occurs. In particular, an IOException is thrown if the output stream is closed.
      • close

        void close()
            throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.io.IOException