Class AssignChannelMessage


public final class AssignChannelMessage extends AntMessageFromHost
Message that assigns a channel with the contained parameters.
Since:
4.0
  • Field Details

    • OFFSET_CHANNEL_TYPE

      public static final int OFFSET_CHANNEL_TYPE
      The message content offset to the channel type
      Since:
      4.0
      See Also:
    • OFFSET_NETWORK_NUMBER

      public static final int OFFSET_NETWORK_NUMBER
      The message content offset to the network number
      Since:
      4.0
      See Also:
    • OFFSET_EXTENDED_ASSIGNMENT

      public static final int OFFSET_EXTENDED_ASSIGNMENT
      The message content offset to the extended assignment
      Since:
      4.0
      See Also:
    • SIZE_NETWORK_NUMBER

      public static final int SIZE_NETWORK_NUMBER
      The number of bytes used for the network number
      Since:
      4.0
      See Also:
  • Constructor Details

    • AssignChannelMessage

      public AssignChannelMessage(ChannelType channelType)
      Constructs the message from a specified channel type.
      Parameters:
      channelType - The ChannelType the channel will be assigned as.
      Since:
      4.0
    • AssignChannelMessage

      public AssignChannelMessage(ChannelType channelType, ExtendedAssignment extendedAssignment)
      Constructs the message from the specified channel type and extended assignment.
      Parameters:
      channelType - The ChannelType the channel will be assigned as.
      extendedAssignment - The ExtendedAssignment the channel will be assigned as.
      Since:
      4.0
    • AssignChannelMessage

      protected AssignChannelMessage(byte[] messageContent)
  • Method Details

    • getRawChannelType

      public int getRawChannelType()
      Should generally use getChannelType() instead.
      Returns:
      The raw value of the channel type.
      Since:
      4.1
    • getChannelType

      public ChannelType getChannelType()
      Gets the channel type of the assign channel message. The channel will be assigned as this type.
      Returns:
      The ChannelType of the assign message.
      Since:
      4.0
    • getExtendedAssignment

      public ExtendedAssignment getExtendedAssignment()
      Gets the extended assignment of the assign channel message, which specifies which additional features to be enabled.
      Returns:
      The ExtendedAssignment of the assign message.
      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 class AntMessageFromHost
      Parameters:
      channelNumber - Written to the channel number byte if required
      networkNumber - Written to the network number byte if required
      Returns:
      Message content raw byte array.
      Since:
      4.0
    • getMessageType

      public MessageFromHostType 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 class AntMessageFromHost
      Returns:
      The type of message returned by the host.
      Since:
      4.0
    • toString

      public String toString()
      Overrides:
      toString in class AntMessageFromHost