Package com.dsi.ant.message
Class AntMessage
java.lang.Object
com.dsi.ant.message.AntMessage
- Direct Known Subclasses:
AntMessageFromAnt
,AntMessageFromHost
,AntMessageParcel
Common definitions for messages from ANT and from Host.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The mask to be used to get the channel number from the byte containing the channel numberstatic final byte
The value used as fillerstatic final int
The message content offest to the channel numberstatic final int
The offset for the entire raw message for message content startstatic final int
The offset for the entire raw message for message IDstatic final int
The offset for the entire raw message for message sizestatic final int
The number of bytes for the channel numberstatic final int
The number of bytes for the filler value -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
abstract byte[]
The content of the message.Get message content as a hex stringabstract int
Get the ANT message ID.Get message ID as a hex stringint
hashCode()
static final int
maskChannelNumber
(int channelNumber) Returns the channel number from the given channel number byte.toString()
-
Field Details
-
OFFSET_CHANNEL_NUMBER
public static final int OFFSET_CHANNEL_NUMBERThe message content offest to the channel number- Since:
- 4.0
- See Also:
-
RAW_OFFSET_MESSAGE_SIZE
public static final int RAW_OFFSET_MESSAGE_SIZEThe offset for the entire raw message for message size- Since:
- 4.0
- See Also:
-
RAW_OFFSET_MESSAGE_ID
public static final int RAW_OFFSET_MESSAGE_IDThe offset for the entire raw message for message ID- Since:
- 4.0
- See Also:
-
RAW_OFFSET_MESSAGE_CONTENT_START
public static final int RAW_OFFSET_MESSAGE_CONTENT_STARTThe offset for the entire raw message for message content start- Since:
- 4.0
- See Also:
-
FILLER_BYTE
public static final byte FILLER_BYTEThe value used as filler- Since:
- 4.0
- See Also:
-
SIZE_CHANNEL_NUMBER
public static final int SIZE_CHANNEL_NUMBERThe number of bytes for the channel number- Since:
- 4.0
- See Also:
-
SIZE_FILLER_BYTE
public static final int SIZE_FILLER_BYTEThe number of bytes for the filler value- Since:
- 4.0
- See Also:
-
BITMASK_CHANNEL_NUMBER
public static final int BITMASK_CHANNEL_NUMBERThe mask to be used to get the channel number from the byte containing the channel number- Since:
- 4.0
- See Also:
-
-
Constructor Details
-
AntMessage
public AntMessage()
-
-
Method Details
-
maskChannelNumber
public static final int maskChannelNumber(int channelNumber) Returns the channel number from the given channel number byte.- Parameters:
channelNumber
- The byte that contains the channel number- Returns:
- The channel number contained in the byte.
- Since:
- 4.0
-
equals
-
hashCode
public int hashCode() -
toString
-
getMessageId
public abstract int getMessageId()Get the ANT message ID.- Returns:
- Raw value of this messages Message ID byte.
- Since:
- 4.0
-
getMessageIdString
Get message ID as a hex string- Returns:
- A String of the form 0x##
- Since:
- 4.0
-
getMessageContent
public abstract byte[] getMessageContent()The content of the message.- Returns:
- Message content raw byte array.
- Since:
- 4.0
-
getMessageContentString
Get message content as a hex string- Returns:
- A String of the form [##][##]...
- Since:
- 4.0
-