org.jSyncManager.API.Protocol
Interface CMPDLPTransferInterface
- PADP, USB
public interface CMPDLPTransferInterface
CMP-DLP protocol transfer interface.
This interface needs to be implemented by any protocol that sits underneath the CMP-DLP layer.
void | connect()- Method to be called to initialize the connection.
|
void | disconnect()- Disconnects the connection to the underlying communication subsystem.
|
boolean | isConnected()- Tests the state of the protocol connection.
|
GenericPacket | readPacket()- Reads a packet from the underlying communication subsystem.
|
void | suspendConnection()- Suspends access to the underlying communication subsystem.
|
void | transmitPacket(byte[] data, byte srcSocket, byte destSocket)- Transmits a packet to the underlying communication subsystem.
|
void | useLongPackets(boolean flag)- Sets the use of long packets.
|
connect
public void connect()
Method to be called to initialize the connection.
disconnect
public void disconnect()
Disconnects the connection to the underlying communication subsystem.
isConnected
public boolean isConnected()
Tests the state of the protocol connection.
- true if this protocol layer is connected, false otherwise.
readPacket
public GenericPacket readPacket()
throws NotConnectedExceptionReads a packet from the underlying communication subsystem.
- A GenericPacket object containing the read data.
suspendConnection
public void suspendConnection()
Suspends access to the underlying communication subsystem.
transmitPacket
public void transmitPacket(byte[] data,
byte srcSocket,
byte destSocket)
throws NotConnectedException,
PADP_PacketTooBigExceptionTransmits a packet to the underlying communication subsystem.
data - the data to transmit.srcSocket - the socket that was the source of this data (may be ignored).destSocket - the socket that is the intended destination of this data (may be ignored).
useLongPackets
public void useLongPackets(boolean flag)
Sets the use of long packets.
flag - true if we should use long packet support, false otherwise.