Package com.dsi.ant.message.fromant
Class ChannelEventMessage
java.lang.Object
com.dsi.ant.message.AntMessage
com.dsi.ant.message.fromant.AntMessageFromAnt
com.dsi.ant.message.fromant.ChannelEventMessage
Defines values for reading an
MessageFromAntType.CHANNEL_EVENT
type message.- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The message content offset to the channel event code (EventCode
).static final int
The number of bytes used for the event 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
ChannelEventMessage
(byte[] messageContent) Parse Channel Event data from the given ANT message content.ChannelEventMessage
(AntMessageParcel messageParcel) Parse message specific information from the given ANT message parcel. -
Method Summary
Modifier and TypeMethodDescriptionGets the event code associated with the channel event messageThe type of this message based on its message id and contents.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_EVENT_CODE
public static final int SIZE_EVENT_CODEThe number of bytes used for the event code- Since:
- 4.0
- See Also:
-
OFFSET_EVENT_CODE
public static final int OFFSET_EVENT_CODEThe message content offset to the channel event code (EventCode
).- Since:
- 4.0
- See Also:
-
-
Constructor Details
-
ChannelEventMessage
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
-
ChannelEventMessage
protected ChannelEventMessage(byte[] messageContent) Parse Channel Event data from the given ANT message content.- Parameters:
messageContent
- Raw content of an ANT serial message
-
-
Method Details
-
getEventCode
Gets the event code associated with the channel event message- Returns:
- The
EventCode
. - 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
-