Class ChannelId

java.lang.Object
com.dsi.ant.message.ChannelId

public class ChannelId extends Object
The Channel ID portion of a Channel ID response or Extended Data message.
Since:
4.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The wildcard used to connect to any device number
    static 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 ANT
    static 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 ANT
    static 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 ID
    static final int
    Number of bytes for device number
    static final int
    Number of bytes for device type
    static final int
    Number of bytes for device transmission type
  • Constructor Summary

    Constructors
    Constructor
    Description
    ChannelId(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 Type
    Method
    Description
    boolean
     
    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
    Returns the value of the pairing bit.
    int
    The value of the transmission type.
    int
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • SIZE_DEVICE_NUMBER

      public static final int SIZE_DEVICE_NUMBER
      Number of bytes for device number
      Since:
      4.0
      See Also:
    • SIZE_DEVICE_TYPE

      public static final int SIZE_DEVICE_TYPE
      Number of bytes for device type
      Since:
      4.0
      See Also:
    • SIZE_TRANSMISSION_TYPE

      public static final int SIZE_TRANSMISSION_TYPE
      Number of bytes for device transmission type
      Since:
      4.0
      See Also:
    • SIZE_CHANNEL_ID

      public static final int SIZE_CHANNEL_ID
      Number of bytes for the channel ID
      Since:
      4.0
      See Also:
    • OFFSET_DEVICE_NUMBER

      public static final int OFFSET_DEVICE_NUMBER
      The message content offset to the device number byte.
      Since:
      4.0
      See Also:
    • OFFSET_PAIRING_BIT

      public static final int OFFSET_PAIRING_BIT
      The message content offset to the byte containing the pairing bit.
      Since:
      4.0
      See Also:
    • OFFSET_DEVICE_TYPE

      public static final int OFFSET_DEVICE_TYPE
      The message content offset to the device type byte.
      Since:
      4.0
      See Also:
    • OFFSET_TRANSMISSION_TYPE

      public static final int OFFSET_TRANSMISSION_TYPE
      The message content offset to the device transmission type byte.
      Since:
      4.0
      See Also:
    • BITMASK_DEVICE_TYPE

      public static final int BITMASK_DEVICE_TYPE
      The mask to be used to get the device type.
      Since:
      4.0
      See Also:
    • BITMASK_PAIR

      public static final int BITMASK_PAIR
      The 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_TYPE
      The mask to be used to get the shared address.
      Since:
      4.0
      See Also:
    • ANY_DEVICE_NUMBER

      public static final int ANY_DEVICE_NUMBER
      The wildcard used to connect to any device number
      Since:
      4.0
      See Also:
    • ANY_DEVICE_TYPE

      public static final int ANY_DEVICE_TYPE
      The wildcard used to connect to any device type.
      Since:
      4.0
      See Also:
    • ANY_TRANSMISSION_TYPE

      public static final int ANY_TRANSMISSION_TYPE
      The wildcard used to connect to any transmission type.
      Since:
      4.0
      See Also:
    • MIN_DEVICE_NUMBER

      public static final int MIN_DEVICE_NUMBER
      The minimum device number accepted by ANT
      Since:
      4.0
      See Also:
    • MAX_DEVICE_NUMBER

      public static final int MAX_DEVICE_NUMBER
      The maximum device number accepted by ANT
      Since:
      4.0
      See Also:
    • MIN_DEVICE_TYPE

      public static final int MIN_DEVICE_TYPE
      The minimum number that can be used for the device type.
      Since:
      4.0
      See Also:
    • MAX_DEVICE_TYPE

      public static final int MAX_DEVICE_TYPE
      The maximum number that can be used for the device type.
      Since:
      4.0
      See Also:
    • MIN_TRANSMISSION_TYPE

      public static final int MIN_TRANSMISSION_TYPE
      The minimum number that can be used for the transmission type.
      Since:
      4.0
      See Also:
    • MAX_TRANSMISSION_TYPE

      public static final int MAX_TRANSMISSION_TYPE
      The 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 bytes
      startOffset - 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 device
      deviceType - The class or type of the ANT device
      transmissionType - 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 device
      deviceType - The class or type of the ANT device
      transmissionType - 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
    • getNumberofBytesForSharedAddress

      public int getNumberofBytesForSharedAddress()
      Get the number of bytes that will be used for the shared address field based on the transmission type. Applications need only be concerned with the shared address field of a message payload if the channel is assigned as a shared ChannelType.
      Returns:
      The number of bytes the shared address field will be in the message payload.
      Since:
      4.1
    • getMessageContent

      public byte[] getMessageContent()
      Returns the message byte array representing the channel ID.
      Returns:
      The message content.
      Since:
      4.0
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Since:
      4.0
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object