Package com.dsi.ant.message.fromant
Class ChannelResponseMessage
java.lang.Object
com.dsi.ant.message.AntMessage
com.dsi.ant.message.fromant.AntMessageFromAnt
com.dsi.ant.message.fromant.ChannelResponseMessage
Message generated in response to a message.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The message content offset to the previously sent message ID that the response is for.static final int
The message content offset to the response code (ResponseCode
).static final int
The number of bytes used for the initiating message IDstatic final int
The number of bytes used for the response codeFields 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
ChannelResponseMessage
(byte[] messageContent) ChannelResponseMessage
(AntMessageParcel messageParcel) Parse message specific information from the given ANT message parcel. -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the message ID of the message that was sent to ANT.The type of this message based on its message id and contents.int
Should generally usegetResponseCode()
instead.Gets the response code associated with the response message.toString()
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
-
SIZE_INITIATING_MESSAGE_ID
public static final int SIZE_INITIATING_MESSAGE_IDThe number of bytes used for the initiating message ID- Since:
- 4.0
- See Also:
-
SIZE_RESPONSE_CODE
public static final int SIZE_RESPONSE_CODEThe number of bytes used for the response code- Since:
- 4.0
- See Also:
-
OFFSET_INITIATING_MESSAGE_ID
public static final int OFFSET_INITIATING_MESSAGE_IDThe message content offset to the previously sent message ID that the response is for.- Since:
- 4.0
- See Also:
-
OFFSET_RESPONSE_CODE
public static final int OFFSET_RESPONSE_CODEThe message content offset to the response code (ResponseCode
).- Since:
- 4.0
- See Also:
-
-
Constructor Details
-
ChannelResponseMessage
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
-
ChannelResponseMessage
protected ChannelResponseMessage(byte[] messageContent)
-
-
Method Details
-
getInitiatingMessageId
public int getInitiatingMessageId()Gets the message ID of the message that was sent to ANT.- Returns:
- The value corresponding to an element in
MessageId
. - Since:
- 4.0
-
getRawResponseCode
public int getRawResponseCode()Should generally usegetResponseCode()
instead.- Returns:
- The raw value received from the ANT Adapter.
- Since:
- 4.0
-
getResponseCode
Gets the response code associated with the response message.- Returns:
- The
ResponseCode
. - 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 classAntMessageFromAnt
- Since:
- 4.0
-