public final class HDLCProtocol
extends java.lang.Object
| Constructor and Description |
|---|
HDLCProtocol(HDLCParameters hdlcParameters,
java.io.InputStream inStream,
java.io.OutputStream outStream)
Instantiates a new HDLCProtocol
|
| Modifier and Type | Method and Description |
|---|---|
void |
connect()
Connects the HDLC channel to the server.
|
void |
disconnect()
Disconnects the HDLC channel from the server.
|
byte[] |
getPushedAPDU() |
HDLCProtocolState |
getState()
Returns the HDLC state.
|
void |
poll() |
byte[] |
sendReceive(byte[] outData)
Sends bytes to the server and then receives bytes from the server.
|
public HDLCProtocol(HDLCParameters hdlcParameters, java.io.InputStream inStream, java.io.OutputStream outStream)
hdlcParameters - The HDLC parameters to use.inStream - The InputStream to get bytes from the device server.outStream - The OutputStream to send bytes to the device server.
Two mechanisms are used to detect a timeout in receiving bytes from the device server.
public HDLCProtocolState getState()
public void connect()
throws EzHdlcException,
java.io.IOException
EzHdlcException - Thrown for any detected error.java.io.IOExceptionpublic void disconnect()
throws EzHdlcException,
java.io.IOException
EzHdlcException - Thrown for any detected error.java.io.IOExceptionpublic void poll()
throws EzHdlcException,
java.io.IOException
EzHdlcExceptionjava.io.IOExceptionpublic byte[] sendReceive(byte[] outData)
throws EzHdlcException,
java.io.IOException
outData - Byte array to be send to the server.EzHdlcException - the ezhdlc exceptionjava.io.IOExceptionpublic byte[] getPushedAPDU()
throws EzHdlcException,
java.io.IOException
EzHdlcExceptionjava.io.IOException