Package com.dsi.ant.message.fromhost
Class AntMessageFromHost
java.lang.Object
com.dsi.ant.message.AntMessage
com.dsi.ant.message.fromhost.AntMessageFromHost
- Direct Known Subclasses:
AddChannelIdToListMessage
,AssignChannelMessage
,ChannelIdMessageFromHost
,ChannelPeriodMessage
,ChannelRfFrequencyMessage
,ChannelSearchPriorityMessage
,CloseChannelMessage
,ConfigIdListMessage
,ConfigureEventBufferMessage
,CrystalEnableMessage
,CwInitMessage
,DataMessageFromHost
,FrequencyAgilityMessage
,LibConfigMessage
,LoadOrStoreEncryptionKeyMessage
,LowPrioritySearchTimeoutMessage
,OpenChannelMessage
,OpenRxScanModeMessage
,ProximitySearchMessage
,RequestMessage
,ResetSystemMessage
,SearchTimeoutMessage
,SerialNumberSetChannelIdMessage
,SetChannelTransmitPowerMessage
,SetNetworkKeyMessage
,SleepMessage
,TransmitPowerMessage
,UnassignChannelMessage
A message sent Host -> ANT.
Takes individual pieces of information from an application, and the message type and sends this
to the ANT Radio Service, which is pieced together to a single ANT message byte array.
- Since:
- 4.0
-
Field Summary
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 TypeMethodDescriptionprotected static AntMessageFromHost
createAntMessage
(MessageFromHostType messageType, byte[] messageContent) static AntMessageFromHost
createAntMessage
(AntMessageParcel antParcel, ChannelType channelType) Takes a message received over IPC and converts it to an AntMessageFromHost objectbyte[]
The content of the message with no channel number or network number set.byte[]
getMessageContent
(int channelNumber) The content of the message with specified channel number set if required.abstract byte[]
getMessageContent
(int channelNumber, int networkNumber) The content of the message with specified channel number and network number set if required.int
Get the ANT message ID.abstract MessageFromHostType
The unique type of this message based on its message id, contents, and intended channel type.byte[]
getRawMessage
(int channelNumber, int networkNumber) Creates a message which can be written to the chip.toString()
protected String
Methods inherited from class com.dsi.ant.message.AntMessage
equals, getMessageContentString, getMessageIdString, hashCode, maskChannelNumber
-
Constructor Details
-
AntMessageFromHost
public AntMessageFromHost()
-
-
Method Details
-
getMessageId
public int getMessageId()Description copied from class:AntMessage
Get the ANT message ID.- Specified by:
getMessageId
in classAntMessage
- Returns:
- Raw value of this messages Message ID byte.
- Since:
- 4.0
-
getMessageType
The unique type of this message based on its message id, contents, and intended channel type.It is recommended to use this rather than the raw message ID.
- Returns:
- The type of message returned by the host.
- Since:
- 4.0
-
getMessageContent
public byte[] getMessageContent()The content of the message with no channel number or network number set.- Specified by:
getMessageContent
in classAntMessage
- Returns:
- Message content raw byte array.
- Since:
- 4.0
-
getMessageContent
public byte[] getMessageContent(int channelNumber) The content of the message with specified channel number set if required.- Parameters:
channelNumber
- Written to the channel number byte if required- Returns:
- Raw byte array with network number not set.
- Since:
- 4.0
-
getMessageContent
public abstract byte[] getMessageContent(int channelNumber, int networkNumber) The content of the message with specified channel number and network number set if required.- Parameters:
channelNumber
- Written to the channel number byte if requirednetworkNumber
- Written to the network number byte if required- Returns:
- Message content raw byte array.
- Since:
- 4.0
-
getRawMessage
public byte[] getRawMessage(int channelNumber, int networkNumber) Creates a message which can be written to the chip.- Parameters:
channelNumber
- Specific channel to write in to this message, if required.networkNumber
- Specific network to write in to this message, if required.- Returns:
- An ANT message that can be written to the chip.
- Since:
- 4.0
-
createAntMessage
public static AntMessageFromHost createAntMessage(AntMessageParcel antParcel, ChannelType channelType) Takes a message received over IPC and converts it to an AntMessageFromHost object- Parameters:
antParcel
- The basic ANT message data received over IPC.channelType
- The channel type of the channel this message is intended for.- Returns:
- A new specific message type instance, or NULL if not a From Host message or not a
known
MessageFromHostType
. - Since:
- 4.0
-
createAntMessage
protected static AntMessageFromHost createAntMessage(MessageFromHostType messageType, byte[] messageContent) -
toStringHeader
-
toString
- Overrides:
toString
in classAntMessage
- Since:
- 4.0
-