Class HdlcLayer

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

    public class HdlcLayer
    extends java.lang.Object
    implements SessionLayer
    SessionLayer implementing the HDLC protocol IEC 62056-46 for further details.
    • Constructor Detail

    • Method Detail

      • startListening

        public void startListening​(SessionLayerListener listener)
                            throws java.io.IOException
        Description copied from interface: SessionLayer
        Function to start the connection.
        Specified by:
        startListening in interface SessionLayer
        Parameters:
        listener - 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