Class AntMessage

java.lang.Object
com.dsi.ant.message.AntMessage
Direct Known Subclasses:
AntMessageFromAnt, AntMessageFromHost, AntMessageParcel

public abstract class AntMessage extends Object
Common definitions for messages from ANT and from Host.
Since:
4.0
  • Field Details

    • OFFSET_CHANNEL_NUMBER

      public static final int OFFSET_CHANNEL_NUMBER
      The message content offest to the channel number
      Since:
      4.0
      See Also:
    • RAW_OFFSET_MESSAGE_SIZE

      public static final int RAW_OFFSET_MESSAGE_SIZE
      The offset for the entire raw message for message size
      Since:
      4.0
      See Also:
    • RAW_OFFSET_MESSAGE_ID

      public static final int RAW_OFFSET_MESSAGE_ID
      The offset for the entire raw message for message ID
      Since:
      4.0
      See Also:
    • RAW_OFFSET_MESSAGE_CONTENT_START

      public static final int RAW_OFFSET_MESSAGE_CONTENT_START
      The offset for the entire raw message for message content start
      Since:
      4.0
      See Also:
    • FILLER_BYTE

      public static final byte FILLER_BYTE
      The value used as filler
      Since:
      4.0
      See Also:
    • SIZE_CHANNEL_NUMBER

      public static final int SIZE_CHANNEL_NUMBER
      The number of bytes for the channel number
      Since:
      4.0
      See Also:
    • SIZE_FILLER_BYTE

      public static final int SIZE_FILLER_BYTE
      The number of bytes for the filler value
      Since:
      4.0
      See Also:
    • BITMASK_CHANNEL_NUMBER

      public static final int BITMASK_CHANNEL_NUMBER
      The mask to be used to get the channel number from the byte containing the channel number
      Since:
      4.0
      See Also:
  • Constructor Details

    • AntMessage

      public AntMessage()
  • Method Details

    • maskChannelNumber

      public static final int maskChannelNumber(int channelNumber)
      Returns the channel number from the given channel number byte.
      Parameters:
      channelNumber - The byte that contains the channel number
      Returns:
      The channel number contained in the byte.
      Since:
      4.0
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
      Since:
      4.0
    • hashCode

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

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

      public abstract int getMessageId()
      Get the ANT message ID.
      Returns:
      Raw value of this messages Message ID byte.
      Since:
      4.0
    • getMessageIdString

      public String getMessageIdString()
      Get message ID as a hex string
      Returns:
      A String of the form 0x##
      Since:
      4.0
    • getMessageContent

      public abstract byte[] getMessageContent()
      The content of the message.
      Returns:
      Message content raw byte array.
      Since:
      4.0
    • getMessageContentString

      public String getMessageContentString()
      Get message content as a hex string
      Returns:
      A String of the form [##][##]...
      Since:
      4.0