Package com.dsi.ant.message
Class ChannelId
java.lang.Object
com.dsi.ant.message.ChannelId
The Channel ID portion of a Channel ID response or Extended Data message.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The wildcard used to connect to any device numberstatic final int
The wildcard used to connect to any device type.static final int
The wildcard used to connect to any transmission type.static final int
The mask to be used to get the device type.static final int
The mask to be used to get the pairing bit.static final int
The mask to be used to get the shared address.static final int
The maximum device number accepted by ANTstatic final int
The maximum number that can be used for the device type.static final int
The maximum number that can be used for the transmission type.static final int
The minimum device number accepted by ANTstatic final int
The minimum number that can be used for the device type.static final int
The minimum number that can be used for the transmission type.static final int
The message content offset to the device number byte.static final int
The message content offset to the device type byte.static final int
The message content offset to the byte containing the pairing bit.static final int
The message content offset to the device transmission type byte.static final int
Number of bytes for the channel IDstatic final int
Number of bytes for device numberstatic final int
Number of bytes for device typestatic final int
Number of bytes for device transmission type -
Constructor Summary
ConstructorsConstructorDescriptionChannelId
(byte[] messageContent, int startOffset) Constructs the channel ID from the message byte array.ChannelId
(int deviceNumber, int deviceType, int transmissionType) Constructs the channel ID from the given parameters.ChannelId
(int deviceNumber, int deviceType, int transmissionType, boolean pair) Constructs the channel ID from the given parameters, including the pairing bit. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Returns the device number.int
The value of the device type.byte[]
Returns the message byte array representing the channel ID.int
Get the number of bytes that will be used for the shared address field based on the transmission type.boolean
getPair()
Returns the value of the pairing bit.int
The value of the transmission type.int
hashCode()
toString()
-
Field Details
-
SIZE_DEVICE_NUMBER
public static final int SIZE_DEVICE_NUMBERNumber of bytes for device number- Since:
- 4.0
- See Also:
-
SIZE_DEVICE_TYPE
public static final int SIZE_DEVICE_TYPENumber of bytes for device type- Since:
- 4.0
- See Also:
-
SIZE_TRANSMISSION_TYPE
public static final int SIZE_TRANSMISSION_TYPENumber of bytes for device transmission type- Since:
- 4.0
- See Also:
-
SIZE_CHANNEL_ID
public static final int SIZE_CHANNEL_IDNumber of bytes for the channel ID- Since:
- 4.0
- See Also:
-
OFFSET_DEVICE_NUMBER
public static final int OFFSET_DEVICE_NUMBERThe message content offset to the device number byte.- 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 byte.- Since:
- 4.0
- See Also:
-
OFFSET_TRANSMISSION_TYPE
public static final int OFFSET_TRANSMISSION_TYPEThe message content offset to the device transmission type byte.- Since:
- 4.0
- See Also:
-
BITMASK_DEVICE_TYPE
public static final int BITMASK_DEVICE_TYPEThe mask to be used to get the device type.- Since:
- 4.0
- See Also:
-
BITMASK_PAIR
public static final int BITMASK_PAIRThe mask to be used to get the pairing bit.- Since:
- 4.0
- See Also:
-
BITMASK_SHARED_ADDRESS_TYPE
public static final int BITMASK_SHARED_ADDRESS_TYPEThe mask to be used to get the shared address.- Since:
- 4.0
- See Also:
-
ANY_DEVICE_NUMBER
public static final int ANY_DEVICE_NUMBERThe wildcard used to connect to any device number- Since:
- 4.0
- See Also:
-
ANY_DEVICE_TYPE
public static final int ANY_DEVICE_TYPEThe wildcard used to connect to any device type.- Since:
- 4.0
- See Also:
-
ANY_TRANSMISSION_TYPE
public static final int ANY_TRANSMISSION_TYPEThe wildcard used to connect to any transmission type.- Since:
- 4.0
- See Also:
-
MIN_DEVICE_NUMBER
public static final int MIN_DEVICE_NUMBERThe minimum device number accepted by ANT- Since:
- 4.0
- See Also:
-
MAX_DEVICE_NUMBER
public static final int MAX_DEVICE_NUMBERThe maximum device number accepted by ANT- Since:
- 4.0
- See Also:
-
MIN_DEVICE_TYPE
public static final int MIN_DEVICE_TYPEThe minimum number that can be used for the device type.- Since:
- 4.0
- See Also:
-
MAX_DEVICE_TYPE
public static final int MAX_DEVICE_TYPEThe maximum number that can be used for the device type.- Since:
- 4.0
- See Also:
-
MIN_TRANSMISSION_TYPE
public static final int MIN_TRANSMISSION_TYPEThe minimum number that can be used for the transmission type.- Since:
- 4.0
- See Also:
-
MAX_TRANSMISSION_TYPE
public static final int MAX_TRANSMISSION_TYPEThe maximum number that can be used for the transmission type.- Since:
- 4.0
- See Also:
-
-
Constructor Details
-
ChannelId
public ChannelId(byte[] messageContent, int startOffset) Constructs the channel ID from the message byte array.- Parameters:
messageContent
- A byte array that contains the channel ID bytesstartOffset
- The offset in the array where the channel ID bytes start.- Since:
- 4.0
-
ChannelId
public ChannelId(int deviceNumber, int deviceType, int transmissionType) Constructs the channel ID from the given parameters.- Parameters:
deviceNumber
- The unique number identifying the ANT devicedeviceType
- The class or type of the ANT devicetransmissionType
- Denotes certain transmission characteristics of a device- Since:
- 4.0
-
ChannelId
public ChannelId(int deviceNumber, int deviceType, int transmissionType, boolean pair) Constructs the channel ID from the given parameters, including the pairing bit.- Parameters:
deviceNumber
- The unique number identifying the ANT devicedeviceType
- The class or type of the ANT devicetransmissionType
- Denotes certain transmission characteristics of a device.pair
- For devices to connect during a wildcard search, both must have matching pairing bits.- Since:
- 4.0
-
-
Method Details
-
getDeviceNumber
public int getDeviceNumber()Returns the device number.- Returns:
- The device number
- Since:
- 4.0
-
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 pair bit is set. False, otherwise.
- 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()Returns the message byte array representing the channel ID.- Returns:
- The message content.
- Since:
- 4.0
-
toString
-
hashCode
public int hashCode() -
equals
-