Class RequestMessage


public final class RequestMessage extends AntMessageFromHost
Sent to the ANT chip to request specific information about the device.
Since:
4.0
  • Field Details

    • SIZE_SUB_MESSAGE_ID

      public static final int SIZE_SUB_MESSAGE_ID
      The number of bytes to be used for the sub message ID
      Since:
      4.0
      See Also:
    • SIZE_REQUESTED_MESSAGE_ID

      public static final int SIZE_REQUESTED_MESSAGE_ID
      The number of bytes to be used for the requested message ID
      Since:
      4.0
      See Also:
    • SIZE_NVM_ADDRESS

      public static final int SIZE_NVM_ADDRESS
      The number of bytes to be used for the start read address of NVM
      Since:
      4.0
      See Also:
    • SIZE_NVM_SIZE

      public static final int SIZE_NVM_SIZE
      The number of bytes to be used for the block size to be read from NVM
      Since:
      4.0
      See Also:
    • OFFSET_SUB_MESSAGE_ID

      public static final int OFFSET_SUB_MESSAGE_ID
      The message content offset to the sub message ID
      Since:
      4.0
      See Also:
    • OFFSET_REQUESTED_MESSAGE_ID

      public static final int OFFSET_REQUESTED_MESSAGE_ID
      The message content offset to the requested message ID
      Since:
      4.0
      See Also:
    • OFFSET_NVM_ADDRESS

      public static final int OFFSET_NVM_ADDRESS
      The message content offset to the start read address of NVM
      Since:
      4.0
      See Also:
    • OFFSET_NVM_SIZE

      public static final int OFFSET_NVM_SIZE
      The message content offset to the block size to be read from NVM
      Since:
      4.0
      See Also:
    • SUB_MESSAGE_REQUEST_ADVANCED_BURST_CAPABILITES

      public static final int SUB_MESSAGE_REQUEST_ADVANCED_BURST_CAPABILITES
      The sub message ID if requesting advanced burst capabilities message
      Since:
      4.0
      See Also:
    • SUB_MESSAGE_REQUEST_ADVANCED_BURST_CURRENT_CONFIGURATION

      public static final int SUB_MESSAGE_REQUEST_ADVANCED_BURST_CURRENT_CONFIGURATION
      The sub message ID if requesting advanced burst configuration
      Since:
      4.0
      See Also:
  • Constructor Details

    • RequestMessage

      public RequestMessage(MessageFromAntType requestedMessageType)
      Constructs the message from the given message type.
      Parameters:
      requestedMessageType - The message being requested.
      Since:
      4.0
    • RequestMessage

      protected RequestMessage(byte[] messageContent)
  • Method Details

    • getRequestedMessageType

      public MessageFromAntType getRequestedMessageType()
      Gets the message type being requested in this message.
      Returns:
      The message type being requested.
      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