Package com.dsi.ant.message.fromhost
Class SetShortNetworkKeyMessage
java.lang.Object
com.dsi.ant.message.AntMessage
com.dsi.ant.message.fromhost.AntMessageFromHost
com.dsi.ant.message.fromhost.SetNetworkKeyMessage
com.dsi.ant.message.fromhost.SetShortNetworkKeyMessage
Configures which network is used by a network slot, specified with a 64 bit
(8 byte) key.
- Since:
- 4.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The valid length in bytes of the network key for this message.Fields inherited from class com.dsi.ant.message.fromhost.SetNetworkKeyMessage
OFFSET_NETWORK_KEY, OFFSET_NETWORK_NUMBER, SIZE_NETWORK_NUMBER
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
ConstructorsConstructorDescriptionSetShortNetworkKeyMessage
(byte[] networkKey) Constructs the message to contain the provided network key. -
Method Summary
Modifier and TypeMethodDescriptionThe unique type of this message based on its message id, contents, and intended channel type.protected int
Gets the network key length supported by this message.Methods inherited from class com.dsi.ant.message.fromhost.SetNetworkKeyMessage
createSetNetworkKeyMessage, getMessageContent, getNetworkKey, getRawNetworkKey, 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
-
LENGTH_NETWORK_KEY_BYTES
public static final int LENGTH_NETWORK_KEY_BYTESThe valid length in bytes of the network key for this message.- Since:
- 4.3
- See Also:
-
-
Constructor Details
-
SetShortNetworkKeyMessage
public SetShortNetworkKeyMessage(byte[] networkKey) Constructs the message to contain the provided network key.- Parameters:
networkKey
- The network key that is to be assigned to a network number.- Throws:
IllegalArgumentException
- Occurs when received an invalid network key byte array (null or invalid length)- Since:
- 4.3
-
-
Method Details
-
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.
-
getNetworkKeyLengthBytes
protected int getNetworkKeyLengthBytes()Description copied from class:SetNetworkKeyMessage
Gets the network key length supported by this message.- Specified by:
getNetworkKeyLengthBytes
in classSetNetworkKeyMessage
- Returns:
- The length in bytes for the network key.
-