Class WrapperLayer

  • All Implemented Interfaces:
    java.lang.AutoCloseable, SessionLayer

    public class WrapperLayer
    extends java.lang.Object
    implements SessionLayer
    • Constructor Detail

      • WrapperLayer

        public WrapperLayer​(Settings settings,
                            TransportLayer transportLayer)
                     throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • startListening

        public void startListening​(SessionLayerListener eventListener)
                            throws java.io.IOException
        Description copied from interface: SessionLayer
        Function to start the connection.
        Specified by:
        startListening in interface SessionLayer
        Parameters:
        eventListener - the listener.
        Throws:
        java.io.IOException - if an error occurs opening the connection to the remote meter.
      • send

        public void send​(byte[] tSdu,
                         int off,
                         int len,
                         RawMessageData.RawMessageDataBuilder rawMessageDataBuilder)
                  throws java.io.IOException
        Description copied from interface: SessionLayer
        Writes len bytes from the specified byte array starting at offset off to this output stream.
        Specified by:
        send in interface SessionLayer
        Parameters:
        tSdu - the data.
        off - the start offset in the data.
        len - the number of bytes to write.
        rawMessageDataBuilder - 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

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