Package com.dsi.ant.message.fromant
Class BurstTransferDataMessage
java.lang.Object
com.dsi.ant.message.AntMessage
com.dsi.ant.message.fromant.AntMessageFromAnt
com.dsi.ant.message.fromant.DataMessage
com.dsi.ant.message.fromant.BurstTransferDataMessage
Message received when receiving burst data from a connected device and every
burst packet is acknowledged.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The mask used to retrieve the sequence numberstatic final int
The message content offset to the sequence numberstatic final int
The sequence number for the first message of the burst transferstatic final int
The mask used to get the flag indicating if this message is the last message in the burst transfer.static final int
The value the sequence number increments with each received messagestatic final int
The sequence number before a rollover of sequence numbers occursstatic final int
The shift applied to the retrieved sequence number after applying the maskFields inherited from class com.dsi.ant.message.fromant.DataMessage
LENGTH_STANDARD_PAYLOAD, OFFSET_PAYLOAD_START
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
ConstructorsModifierConstructorDescriptionprotected
BurstTransferDataMessage
(byte[] messageContent) BurstTransferDataMessage
(AntMessageParcel messageParcel) Parse message specific information from the given ANT message parcel. -
Method Summary
Modifier and TypeMethodDescriptionThe type of this message based on its message id and contents.int
Gets the sequence number of this received message in the burst transferboolean
Checks if the message is the first message of the burst transfer.boolean
Checks if the message is the last message of the burst transfer.toString()
Methods inherited from class com.dsi.ant.message.fromant.DataMessage
getExtendedData, getPayload, getStandardPayload, hasExtendedData
Methods inherited from class com.dsi.ant.message.fromant.AntMessageFromAnt
createAntMessage, createAntMessage, createAntMessage, extractCorrectMessageContent, getMessageContent, getMessageId, toStringHeader
Methods inherited from class com.dsi.ant.message.AntMessage
equals, getMessageContentString, getMessageIdString, hashCode, maskChannelNumber
-
Field Details
-
OFFSET_SEQUENCE_NUMBER
public static final int OFFSET_SEQUENCE_NUMBERThe message content offset to the sequence number- Since:
- 4.0
- See Also:
-
BITMASK_SEQUENCE_NUMBER
public static final int BITMASK_SEQUENCE_NUMBERThe mask used to retrieve the sequence number- Since:
- 4.0
- See Also:
-
SHIFT_SEQUENCE_NUMBER
public static final int SHIFT_SEQUENCE_NUMBERThe shift applied to the retrieved sequence number after applying the mask- Since:
- 4.0
- See Also:
-
SEQUENCE_FIRST_MESSAGE
public static final int SEQUENCE_FIRST_MESSAGEThe sequence number for the first message of the burst transfer- Since:
- 4.0
- See Also:
-
SEQUENCE_NUMBER_INC
public static final int SEQUENCE_NUMBER_INCThe value the sequence number increments with each received message- Since:
- 4.0
- See Also:
-
SEQUENCE_NUMBER_ROLLOVER
public static final int SEQUENCE_NUMBER_ROLLOVERThe sequence number before a rollover of sequence numbers occurs- Since:
- 4.0
- See Also:
-
SEQUENCE_FLAG_IS_LAST_MESSAGE
public static final int SEQUENCE_FLAG_IS_LAST_MESSAGEThe mask used to get the flag indicating if this message is the last message in the burst transfer.- Since:
- 4.1
- See Also:
-
-
Constructor Details
-
BurstTransferDataMessage
Parse message specific information from the given ANT message parcel.- Parameters:
messageParcel
- Raw ANT message received form the ANT Radio Service.- Throws:
IllegalArgumentException
- If the parcel is for the wrong message type.- Since:
- 4.0
-
BurstTransferDataMessage
protected BurstTransferDataMessage(byte[] messageContent)
-
-
Method Details
-
getSequenceNumber
public int getSequenceNumber()Gets the sequence number of this received message in the burst transfer- Returns:
- The sequence number of the message.
- Since:
- 4.0
-
isFirstMessage
public boolean isFirstMessage()Checks if the message is the first message of the burst transfer.- Returns:
- True, if message is the first message. False, otherwise.
- Since:
- 4.0
-
isLastMessage
public boolean isLastMessage()Checks if the message is the last message of the burst transfer.- Returns:
- True, if message is the last message. False, otherwise.
- Since:
- 4.0
-
getMessageType
Description copied from class:AntMessageFromAnt
The type of this message based on its message id and contents.It is recommended to use this rather than the raw message ID.
- Specified by:
getMessageType
in classAntMessageFromAnt
- Returns:
- A message type corresponding to this message as defined in
MessageFromAntType
. - Since:
- 4.0
-
toString
- Overrides:
toString
in classDataMessage
- Since:
- 4.0
-