org.jSyncManager.API.Protocol.Util
Class CMP_CommunicationPrefs
java.lang.Objectorg.jSyncManager.API.Protocol.Util.CMP_CommunicationPrefs
public class CMP_CommunicationPrefs
extends java.lang.Object
This class provides acces to a CMP Communication Preferences block.
CMP Communications Blocks are used by CMP Extended packets.
CMP_CommunicationPrefs()- Create a new instance of the CMP Communication Preferences class.
|
CMP_CommunicationPrefs(byte[] inData)- Construct a new CMP Communication Preferences instance from an array of bytes.
|
CMP_CommunicationPrefs(int maxPktSize, int maxBlkSize, int maxBaudRate, int hardHandAbove, int flgs, int ver)- Create a new instance of the CMP Communication Preferences class using the specified parameters.
|
int | getFlags()- Retrieves the communication flags as reported by this preferences object.
|
int | getHardwareHandshakeAboveSpeed()- Retrieves the speed at which to start using hardware handshaking, as reported by this preferences object.
|
int | getMaximumBaudRate()- Retrieves the maximum bit/baud rate as reported by this preferences object.
|
int | getMaximumDataBlockSize()- Retrieves the maximum data block size as reported by this preferences object.
|
int | getMaximumPacketSize()- Retrieves the maximum packet size as reported by this preferences object.
|
int | getVersion()- Retrieves the CMP version as reported by this preferences object.
|
boolean | hasFlags(int testFlag)- Tests to see if the specified flag(s) are enabled in this argument.
|
byte[] | object2Bytes()- Converts this object to an array of bytes suitable for transmission.
|
String | toString()- Converts this object to a human-readable String.
|
ENABLE_CRC16
public static final int ENABLE_CRC16
A constant flag to denote that the underlying transport should enable CRC-16.
ENABLE_LONG_OFFSETS
public static final int ENABLE_LONG_OFFSETS
A constant flag to denote that the underlying transport should use long offsets.
ENABLE_SHORT_OFFSETS
public static final int ENABLE_SHORT_OFFSETS
A constant flag to denote that the underlying transport should use short offsets.
TRANSPORT_SUPPORTS_CRC16
public static final int TRANSPORT_SUPPORTS_CRC16
A constant flag to denote that the underlying transport supports CRC-16.
TRANSPORT_SUPPORTS_LONG_OFFSETS
public static final int TRANSPORT_SUPPORTS_LONG_OFFSETS
A constant flag to denote that the transport supports long 32-bit data offsets.
TRANSPORT_SUPPORTS_SHORT_OFFSETS
public static final int TRANSPORT_SUPPORTS_SHORT_OFFSETS
A constant flag to denote that the transport supports short 16-bit data offsets.
CMP_CommunicationPrefs
public CMP_CommunicationPrefs()
Create a new instance of the CMP Communication Preferences class.
CMP_CommunicationPrefs
public CMP_CommunicationPrefs(byte[] inData)
Construct a new CMP Communication Preferences instance from an array of bytes.
inData - the data array to be parsed.
CMP_CommunicationPrefs
public CMP_CommunicationPrefs(int maxPktSize,
int maxBlkSize,
int maxBaudRate,
int hardHandAbove,
int flgs,
int ver)Create a new instance of the CMP Communication Preferences class using the specified parameters.
maxPktSize - the maximum packet size.maxBlkSize - the maximum data block size.maxBaudRate - the maximum bit/baud rate for communications.hardHandAbove - the speed at which hardware handshaking should be used.flgs - the associated preferences flags.ver - the version of the CMP implementation.
getFlags
public int getFlags()
Retrieves the communication flags as reported by this preferences object.
- the communication flags as reported by this preferences object.
getHardwareHandshakeAboveSpeed
public int getHardwareHandshakeAboveSpeed()
Retrieves the speed at which to start using hardware handshaking, as reported by this preferences object.
- the speed at which to start using hardware handshaking, as reported by this preferences object.
getMaximumBaudRate
public int getMaximumBaudRate()
Retrieves the maximum bit/baud rate as reported by this preferences object.
- the maximum bit/baud as reported by this preferences object.
getMaximumDataBlockSize
public int getMaximumDataBlockSize()
Retrieves the maximum data block size as reported by this preferences object.
- the maximum data block size as reported by this preferences object.
getMaximumPacketSize
public int getMaximumPacketSize()
Retrieves the maximum packet size as reported by this preferences object.
- the maximum packet size as reported by this preferences object.
getVersion
public int getVersion()
Retrieves the CMP version as reported by this preferences object.
- the CMP version as reported by this preferences object.
hasFlags
public boolean hasFlags(int testFlag)
Tests to see if the specified flag(s) are enabled in this argument.
testFlag - an int containing the bits to test.
- true if all the specified bits are present, false otherwise.
object2Bytes
public byte[] object2Bytes()
Converts this object to an array of bytes suitable for transmission.
- this object to an array of bytes suitable for transmission.
toString
public String toString()
Converts this object to a human-readable String.