Class ChannelResponseMessage


public class ChannelResponseMessage extends AntMessageFromAnt
Message generated in response to a message.
Since:
4.0
  • Field Details

    • SIZE_INITIATING_MESSAGE_ID

      public static final int SIZE_INITIATING_MESSAGE_ID
      The number of bytes used for the initiating message ID
      Since:
      4.0
      See Also:
    • SIZE_RESPONSE_CODE

      public static final int SIZE_RESPONSE_CODE
      The number of bytes used for the response code
      Since:
      4.0
      See Also:
    • OFFSET_INITIATING_MESSAGE_ID

      public static final int OFFSET_INITIATING_MESSAGE_ID
      The message content offset to the previously sent message ID that the response is for.
      Since:
      4.0
      See Also:
    • OFFSET_RESPONSE_CODE

      public static final int OFFSET_RESPONSE_CODE
      The message content offset to the response code (ResponseCode).
      Since:
      4.0
      See Also:
  • Constructor Details

    • ChannelResponseMessage

      public ChannelResponseMessage(AntMessageParcel messageParcel)
      Parse message specific information from the given ANT message parcel.
      Parameters:
      messageParcel - Raw ANT message received form the ANT Radio Service.
      Throws:
      IllegalArgumentException - If the parcel is for the wrong message type.
      Since:
      4.0
    • ChannelResponseMessage

      protected ChannelResponseMessage(byte[] messageContent)
  • Method Details

    • getInitiatingMessageId

      public int getInitiatingMessageId()
      Gets the message ID of the message that was sent to ANT.
      Returns:
      The value corresponding to an element in MessageId.
      Since:
      4.0
    • getRawResponseCode

      public int getRawResponseCode()
      Should generally use getResponseCode() instead.
      Returns:
      The raw value received from the ANT Adapter.
      Since:
      4.0
    • getResponseCode

      public ResponseCode getResponseCode()
      Gets the response code associated with the response message.
      Returns:
      The ResponseCode.
      Since:
      4.0.
    • getMessageType

      public MessageFromAntType getMessageType()
      Description copied from class: AntMessageFromAnt
      The type of this message based on its message id and contents.

      It is recommended to use this rather than the raw message ID.

      Specified by:
      getMessageType in class AntMessageFromAnt
      Returns:
      A message type corresponding to this message as defined in MessageFromAntType.
      Since:
      4.0
    • toString

      public String toString()
      Overrides:
      toString in class AntMessageFromAnt
      Since:
      4.0