public class LynxDatagram
extends java.lang.Object
LynxDatagram
represents the quantum of transmission of Lynx data between host
and controller module.Modifier and Type | Field and Description |
---|---|
static int |
cbFrameBytesAndPacketLength
How much are the frame bytes and packet length accounted for in the overall packet length?
|
static byte[] |
frameBytes
Two particular bytes identify the start of a valid Controller Module data packet
|
static java.nio.ByteOrder |
LYNX_ENDIAN
All integral data is exchanged in 'little endian' format, least significant byte first (at
lowest address/offset.
|
Constructor and Description |
---|
LynxDatagram() |
LynxDatagram(LynxMessage command) |
Modifier and Type | Method and Description |
---|---|
static boolean |
beginsWithFraming(byte[] data)
Does the indicated data begin with the framing bytes?
|
static boolean |
beginsWithFraming(java.nio.ByteBuffer buffer) |
byte |
computeChecksum() |
void |
fromByteArray(byte[] byteArray) |
int |
getChecksum() |
int |
getCommandNumber()
Note that we clear the response bit.
|
int |
getDestModuleAddress() |
static int |
getFixedPacketLength() |
int |
getMessageNumber() |
int |
getPacketId() |
int |
getPacketLength() |
byte[] |
getPayloadData() |
TimeWindow |
getPayloadTimeWindow() |
int |
getReferenceNumber() |
int |
getSourceModuleAddress() |
boolean |
isChecksumValid() |
boolean |
isResponse() |
void |
setChecksum(int value) |
void |
setDestModuleAddress(int value) |
void |
setMessageNumber(int value) |
void |
setPacketId(int value) |
void |
setPacketLength(int value) |
void |
setPayloadData(byte[] data) |
void |
setPayloadTimeWindow(TimeWindow payloadTimeWindow) |
void |
setReferenceNumber(int value) |
void |
setSourceModuleAddress(int value) |
byte[] |
toByteArray() |
int |
updatePacketLength() |
public static final java.nio.ByteOrder LYNX_ENDIAN
public static final int cbFrameBytesAndPacketLength
public static final byte[] frameBytes
public LynxDatagram()
public LynxDatagram(LynxMessage command) throws LynxUnsupportedCommandException
LynxUnsupportedCommandException
public static boolean beginsWithFraming(byte[] data)
public static boolean beginsWithFraming(java.nio.ByteBuffer buffer)
public void setPayloadTimeWindow(TimeWindow payloadTimeWindow)
public TimeWindow getPayloadTimeWindow()
public int getPacketLength()
public void setPacketLength(int value)
public static int getFixedPacketLength()
public int updatePacketLength()
public int getDestModuleAddress()
public void setDestModuleAddress(int value)
public int getSourceModuleAddress()
public void setSourceModuleAddress(int value)
public int getMessageNumber()
public void setMessageNumber(int value)
public int getReferenceNumber()
public void setReferenceNumber(int value)
public int getPacketId()
public void setPacketId(int value)
public boolean isResponse()
public int getCommandNumber()
public byte[] getPayloadData()
public void setPayloadData(byte[] data)
public int getChecksum()
public void setChecksum(int value)
public byte computeChecksum()
public boolean isChecksumValid()
public byte[] toByteArray()
public void fromByteArray(byte[] byteArray) throws RobotCoreException
RobotCoreException