Package com.dsi.ant.message.fromhost
Class SerialNumberSetChannelIdMessage
java.lang.Object
com.dsi.ant.message.AntMessage
com.dsi.ant.message.fromhost.AntMessageFromHost
com.dsi.ant.message.fromhost.SerialNumberSetChannelIdMessage
Sets the channel ID for the channel, using the two least significant bytes
for the device's serial number.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The mask used to retrieve the device typestatic final int
The mask used to retrieve the pairing bitstatic final int
The message content offset to the device typestatic final int
The message content offset to the byte containing the pairing bitstatic final int
The message content offset to the transmission typestatic final int
The number of bytes used for the device typestatic final int
The number of bytes used for the transmission typeFields 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
ConstructorsModifierConstructorDescriptionSerialNumberSetChannelIdMessage
(boolean pair, int deviceType, int transmissionType) Constructs the message from the given channel ID parameters.protected
SerialNumberSetChannelIdMessage
(byte[] messageContent) -
Method Summary
Modifier and TypeMethodDescriptionint
The value of the device type.byte[]
getMessageContent
(int channelNumber, int networkNumber) The content of the message with specified channel number and network number set if required.The unique type of this message based on its message id, contents, and intended channel type.boolean
getPair()
Returns the value of the pairing bit.int
The value of the transmission type.toString()
Methods inherited from class com.dsi.ant.message.fromhost.AntMessageFromHost
createAntMessage, createAntMessage, getMessageContent, getMessageContent, getMessageId, getRawMessage, toStringHeader
Methods inherited from class com.dsi.ant.message.AntMessage
equals, getMessageContentString, getMessageIdString, hashCode, maskChannelNumber
-
Field Details
-
SIZE_DEVICE_TYPE
public static final int SIZE_DEVICE_TYPEThe number of bytes used for the device type- Since:
- 4.0
- See Also:
-
SIZE_TRANSMISSION_TYPE
public static final int SIZE_TRANSMISSION_TYPEThe number of bytes used for the transmission type- Since:
- 4.0
- See Also:
-
OFFSET_PAIRING_BIT
public static final int OFFSET_PAIRING_BITThe message content offset to the byte containing the pairing bit- Since:
- 4.0
- See Also:
-
OFFSET_DEVICE_TYPE
public static final int OFFSET_DEVICE_TYPEThe message content offset to the device type- Since:
- 4.0
- See Also:
-
OFFSET_TRANSMISSION_TYPE
public static final int OFFSET_TRANSMISSION_TYPEThe message content offset to the transmission type- Since:
- 4.0
- See Also:
-
BITMASK_DEVICE_TYPE
public static final int BITMASK_DEVICE_TYPEThe mask used to retrieve the device type- Since:
- 4.0
- See Also:
-
BITMASK_PAIR
public static final int BITMASK_PAIRThe mask used to retrieve the pairing bit- Since:
- 4.0
- See Also:
-
-
Constructor Details
-
SerialNumberSetChannelIdMessage
public SerialNumberSetChannelIdMessage(boolean pair, int deviceType, int transmissionType) Constructs the message from the given channel ID parameters.- Parameters:
pair
- The pairing bit.deviceType
- The class or type of the ANT devicetransmissionType
- Denotes certain transmission characteristics of a device- Since:
- 4.0
-
SerialNumberSetChannelIdMessage
protected SerialNumberSetChannelIdMessage(byte[] messageContent)
-
-
Method Details
-
getPair
public boolean getPair()Returns the value of the pairing bit. For devices to connect during a wildcard search, devices must have matching pairing bits.- Returns:
- True if the pairing bit is set.
- Since:
- 4.0
-
getDeviceType
public int getDeviceType()The value of the device type.- Returns:
- The device type.
- Since:
- 4.0
-
getTransmissionType
public int getTransmissionType()The value of the transmission type.- Returns:
- The transmission type.
- Since:
- 4.0
-
getMessageContent
public byte[] getMessageContent(int channelNumber, int networkNumber) Description copied from class:AntMessageFromHost
The content of the message with specified channel number and network number set if required.- Specified by:
getMessageContent
in classAntMessageFromHost
- 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
-
getMessageType
Description copied from class:AntMessageFromHost
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.
- Specified by:
getMessageType
in classAntMessageFromHost
- Returns:
- The type of message returned by the host.
- Since:
- 4.0
-
toString
- Overrides:
toString
in classAntMessageFromHost
-