Package com.dsi.ant.message.fromant
Class DataMessage
java.lang.Object
com.dsi.ant.message.AntMessage
com.dsi.ant.message.fromant.AntMessageFromAnt
com.dsi.ant.message.fromant.DataMessage
- Direct Known Subclasses:
AcknowledgedDataMessage
,BroadcastDataMessage
,BurstTransferDataMessage
Defines values for reading a
MessageFromAntType.BROADCAST_DATA
,
MessageFromAntType.ACKNOWLEDGED_DATA
, or MessageFromAntType.BURST_TRANSFER_DATA
type message.- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The length in bytes of the standard payload in a broadcast, acknowledged, or burst message.static final int
The message content offset to the first byte of the payload.Fields inherited from class com.dsi.ant.message.fromant.AntMessageFromAnt
mMessageContent
Fields inherited from class com.dsi.ant.message.AntMessage
BITMASK_CHANNEL_NUMBER, FILLER_BYTE, OFFSET_CHANNEL_NUMBER, RAW_OFFSET_MESSAGE_CONTENT_START, RAW_OFFSET_MESSAGE_ID, RAW_OFFSET_MESSAGE_SIZE, SIZE_CHANNEL_NUMBER, SIZE_FILLER_BYTE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the extended data contained in the data message if it has extended data.byte[]
Extracts the data payload of the data message received.protected static byte[]
getStandardPayload
(byte[] messageContent) boolean
Checks if the received data message contains extended data.toString()
Methods inherited from class com.dsi.ant.message.fromant.AntMessageFromAnt
createAntMessage, createAntMessage, createAntMessage, extractCorrectMessageContent, getMessageContent, getMessageId, getMessageType, toStringHeader
Methods inherited from class com.dsi.ant.message.AntMessage
equals, getMessageContentString, getMessageIdString, hashCode, maskChannelNumber
-
Field Details
-
LENGTH_STANDARD_PAYLOAD
public static final int LENGTH_STANDARD_PAYLOADThe length in bytes of the standard payload in a broadcast, acknowledged, or burst message.- Since:
- 4.0
- See Also:
-
OFFSET_PAYLOAD_START
public static final int OFFSET_PAYLOAD_STARTThe message content offset to the first byte of the payload.- Since:
- 4.0
- See Also:
-
-
Constructor Details
-
DataMessage
protected DataMessage(byte[] messageContent)
-
-
Method Details
-
getStandardPayload
protected static byte[] getStandardPayload(byte[] messageContent) -
getPayload
public byte[] getPayload()Extracts the data payload of the data message received.- Returns:
- The data payload.
- Since:
- 4.0
-
hasExtendedData
public boolean hasExtendedData()Checks if the received data message contains extended data.- Returns:
- True, if there is extended data. False, otherwise.
- Since:
- 4.0
-
getExtendedData
Gets the extended data contained in the data message if it has extended data.- Returns:
- The
ExtendedData
. - Since:
- 4.0
-
toString
- Overrides:
toString
in classAntMessageFromAnt
- Since:
- 4.0
-