Package com.dsi.ant.message.fromhost
Class ConfigureEventBufferMessage
java.lang.Object
com.dsi.ant.message.AntMessage
com.dsi.ant.message.fromhost.AntMessageFromHost
com.dsi.ant.message.fromhost.ConfigureEventBufferMessage
Configures the event buffer for the ANT chip.
- Since:
- 4.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The groups of messages to buffer. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConfigureEventBufferMessage
Singleton disable event buffering message.static final int
The maximum value allowed for the buffer sizestatic final int
The maximum value allowed for the buffer timestatic final int
The minimum value allowed for the buffer sizestatic final int
The minimum value allowed for the buffer timestatic final int
The message content offset to the buffer events valuestatic final int
The message content offset to the buffer size valuestatic final int
The message content offset to the buffer time valuestatic final int
The number of bytes used for the buffer events valuestatic final int
The number of bytes used for the buffer size valuestatic final int
The number of bytes used for the buffer time valuestatic final int
Buffer Time is specified in 10ms unitsFields inherited from class com.dsi.ant.message.AntMessage
BITMASK_CHANNEL_NUMBER, FILLER_BYTE, OFFSET_CHANNEL_NUMBER, RAW_OFFSET_MESSAGE_CONTENT_START, RAW_OFFSET_MESSAGE_ID, RAW_OFFSET_MESSAGE_SIZE, SIZE_CHANNEL_NUMBER, SIZE_FILLER_BYTE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ConfigureEventBufferMessage
(byte[] messageContent) ConfigureEventBufferMessage
(ConfigureEventBufferMessage.BufferEvents events, int bufferSize, int bufferTime) -
Method Summary
Modifier and TypeMethodDescriptionGets the types of events that will be buffered.int
Gets the number of bytes the buffer will hold until flushing all events buffered.int
Gets the duration the buffer will buffer events before flushing all the buffered events.byte[]
getMessageContent
(int channelNumber, int networkNumber) The content of the message with specified channel number and network number set if required.The unique type of this message based on its message id, contents, and intended channel type.int
Gets the duration events will be buffered for before flushing all events.toString()
Methods inherited from class com.dsi.ant.message.fromhost.AntMessageFromHost
createAntMessage, createAntMessage, getMessageContent, getMessageContent, getMessageId, getRawMessage, toStringHeader
Methods inherited from class com.dsi.ant.message.AntMessage
equals, getMessageContentString, getMessageIdString, hashCode, maskChannelNumber
-
Field Details
-
SIZE_BUFFER_EVENTS
public static final int SIZE_BUFFER_EVENTSThe number of bytes used for the buffer events value- Since:
- 4.1
- See Also:
-
SIZE_BUFFER_SIZE
public static final int SIZE_BUFFER_SIZEThe number of bytes used for the buffer size value- Since:
- 4.1
- See Also:
-
SIZE_BUFFER_TIME
public static final int SIZE_BUFFER_TIMEThe number of bytes used for the buffer time value- Since:
- 4.1
- See Also:
-
OFFSET_BUFFER_EVENTS
public static final int OFFSET_BUFFER_EVENTSThe message content offset to the buffer events value- Since:
- 4.1
- See Also:
-
OFFSET_BUFFER_SIZE
public static final int OFFSET_BUFFER_SIZEThe message content offset to the buffer size value- Since:
- 4.1
- See Also:
-
OFFSET_BUFFER_TIME
public static final int OFFSET_BUFFER_TIMEThe message content offset to the buffer time value- Since:
- 4.1
- See Also:
-
MIN_BUFFER_SIZE
public static final int MIN_BUFFER_SIZEThe minimum value allowed for the buffer size- Since:
- 4.1
- See Also:
-
MAX_BUFFER_SIZE
public static final int MAX_BUFFER_SIZEThe maximum value allowed for the buffer size- Since:
- 4.1
- See Also:
-
MIN_BUFFER_TIME
public static final int MIN_BUFFER_TIMEThe minimum value allowed for the buffer time- Since:
- 4.1
- See Also:
-
MAX_BUFFER_TIME
public static final int MAX_BUFFER_TIMEThe maximum value allowed for the buffer time- Since:
- 4.1
- See Also:
-
TIME_INCREMENTS
public static final int TIME_INCREMENTSBuffer Time is specified in 10ms units- Since:
- 4.1
- See Also:
-
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
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 classAntMessageFromHost
- Parameters:
channelNumber
- Written to the channel number byte if requirednetworkNumber
- Written to the network number byte if required- Returns:
- Message content raw byte array.
- Since:
- 4.1
-
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 classAntMessageFromHost
- Returns:
- The type of message returned by the host.
- Since:
- 4.1
-
toString
- Overrides:
toString
in classAntMessageFromHost
-