Class CapabilitiesMessage


public final class CapabilitiesMessage extends AntMessageFromAnt
Provides possible ANT capabilities, and whether they are supported or not. Constants defined in Options are used to access the capability option information.

See the ANT Message Protocol and Usage document for more details.

Since:
4.0
  • Constructor Details

    • CapabilitiesMessage

      public CapabilitiesMessage(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
    • CapabilitiesMessage

      protected CapabilitiesMessage(byte[] messageContent)
      Creates a capabilities message
      Parameters:
      messageContent - adapter capabilities
  • Method Details

    • getCapability

      public boolean getCapability(CapabilitiesMessage.Option option)
      Accessor method for the various capabilities settings.
      Parameters:
      option - An enum of the Capability type
      Returns:
      true if capability is available, false otherwise.
      Since:
      4.0
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AntMessage
      Since:
      4.0
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class AntMessage
      Since:
      4.0
    • toString

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

      public int getNumberOfChannels()
      Returns the number of channels supported by the ANT hardware.
      Returns:
      The number of channels supported.
      Since:
      4.0
    • getNumberOfNetworks

      public int getNumberOfNetworks()
      Returns how many networks are supported by this channel.
      Returns:
      The number of networks supported.
      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