org.jSyncManager.API.Protocol

Interface CMPDLPTransferInterface

Known Implementing Classes:
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.

Method Summary

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.

Method Details

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.
Returns:
true if this protocol layer is connected, false otherwise.

readPacket

public GenericPacket readPacket()
            throws NotConnectedException
Reads a packet from the underlying communication subsystem.
Returns:
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_PacketTooBigException
Transmits a packet to the underlying communication subsystem.
Parameters:
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.
Parameters:
flag - true if we should use long packet support, false otherwise.