Class HdlcLayer
- java.lang.Object
-
- org.openmuc.jdlms.sessionlayer.client.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 Summary
Constructors Constructor Description HdlcLayer(HdlcSettings settings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
send(byte[] tSdu, int off, int len, RawMessageData.RawMessageDataBuilder rawMessageDataBuilder)
Writeslen
bytes from the specified byte array starting at offsetoff
to this output stream.void
startListening(SessionLayerListener listener)
Function to start the connection.
-
-
-
Constructor Detail
-
HdlcLayer
public HdlcLayer(HdlcSettings settings)
-
-
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 interfaceSessionLayer
- 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
Writeslen
bytes from the specified byte array starting at offsetoff
to this output stream.- Specified by:
send
in interfaceSessionLayer
- 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 interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceSessionLayer
- Throws:
java.io.IOException
-
-