Class ConfigureEventBufferMessage


public final class ConfigureEventBufferMessage extends AntMessageFromHost
Configures the event buffer for the ANT chip.
Since:
4.1
  • Field Details

    • SIZE_BUFFER_EVENTS

      public static final int SIZE_BUFFER_EVENTS
      The number of bytes used for the buffer events value
      Since:
      4.1
      See Also:
    • SIZE_BUFFER_SIZE

      public static final int SIZE_BUFFER_SIZE
      The number of bytes used for the buffer size value
      Since:
      4.1
      See Also:
    • SIZE_BUFFER_TIME

      public static final int SIZE_BUFFER_TIME
      The number of bytes used for the buffer time value
      Since:
      4.1
      See Also:
    • OFFSET_BUFFER_EVENTS

      public static final int OFFSET_BUFFER_EVENTS
      The message content offset to the buffer events value
      Since:
      4.1
      See Also:
    • OFFSET_BUFFER_SIZE

      public static final int OFFSET_BUFFER_SIZE
      The message content offset to the buffer size value
      Since:
      4.1
      See Also:
    • OFFSET_BUFFER_TIME

      public static final int OFFSET_BUFFER_TIME
      The message content offset to the buffer time value
      Since:
      4.1
      See Also:
    • MIN_BUFFER_SIZE

      public static final int MIN_BUFFER_SIZE
      The minimum value allowed for the buffer size
      Since:
      4.1
      See Also:
    • MAX_BUFFER_SIZE

      public static final int MAX_BUFFER_SIZE
      The maximum value allowed for the buffer size
      Since:
      4.1
      See Also:
    • MIN_BUFFER_TIME

      public static final int MIN_BUFFER_TIME
      The minimum value allowed for the buffer time
      Since:
      4.1
      See Also:
    • MAX_BUFFER_TIME

      public static final int MAX_BUFFER_TIME
      The maximum value allowed for the buffer time
      Since:
      4.1
      See Also:
    • TIME_INCREMENTS

      public static final int TIME_INCREMENTS
      Buffer Time is specified in 10ms units
      Since:
      4.1
      See Also:
    • DISABLE_EVENT_BUFFERING

      public static final ConfigureEventBufferMessage DISABLE_EVENT_BUFFERING
      Singleton disable event buffering message.
  • Constructor Details

    • ConfigureEventBufferMessage

      public ConfigureEventBufferMessage(ConfigureEventBufferMessage.BufferEvents events, int bufferSize, int bufferTime)
      Parameters:
      events - Which types of events to buffer. NONE will disable event buffering.
      bufferSize - Stores the maximum number of bytes that will be stored before a buffer flush occurs.
      bufferTime - Maximum time in 10ms units before a buffer flush occurs. Setting time to 0 disables timer.
      Since:
      4.1
    • ConfigureEventBufferMessage

      protected ConfigureEventBufferMessage(byte[] messageContent)
  • Method Details

    • getBufferEvents

      public ConfigureEventBufferMessage.BufferEvents getBufferEvents()
      Gets the types of events that will be buffered.
      Returns:
      The ConfigureEventBufferMessage.BufferEvents that will be buffered.
      Since:
      4.1
    • getMaxBufferSizeBeforeFlush

      public int getMaxBufferSizeBeforeFlush()
      Gets the number of bytes the buffer will hold until flushing all events buffered.
      Returns:
      The maximum size of the buffer.
      Since:
      4.1
    • getMaxBufferTimeBeforeFlush

      public int getMaxBufferTimeBeforeFlush()
      Gets the duration the buffer will buffer events before flushing all the buffered events.
      Returns:
      The maximum buffering time, in 10ms units.
      Since:
      4.1
    • getRealMaxBufferTimeBeforeFlush

      public int getRealMaxBufferTimeBeforeFlush()
      Gets the duration events will be buffered for before flushing all events.
      Returns:
      The maximum buffering time, in milliseconds.
      Since:
      4.5
    • 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.1
    • 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.1
    • toString

      public String toString()
      Overrides:
      toString in class AntMessageFromHost