ContinuousDataStream
ContinuousDataStream

Contains the logic for the "Continuous Data Stream" command.

Constants
Packet Bytes
CMD_ID

CMD_CONTINUOUS_DATA_STREAM  - The InertialTypes::Command for this command

FIELD_DATA_BYTE

0x85  - The Data Field Descriptor byte

Functions
getDeviceSelector
static uint8 getDeviceSelector(
InertialTypes::InertialCategory type
)

Converts an InertialTypes::InertialCategory to the device selector for this command.

Parameters
type

The InertialTypes::InertialCategory to get the device selector for.

Returns

The device selector for the given InertialTypes::InertialCategory.

buildCommand_get
static ByteStream buildCommand_get(
InertialTypes::InertialCategory type
)

Builds the bytes for the "get" command.

Parameters
type

The InertialTypes::InertialCategory to get the current state for.

Returns

A ByteStream that holds the bytes that make up the command.

buildCommand_set
static ByteStream buildCommand_set(
InertialTypes::InertialCategory type,
bool enable
)

Builds the bytes for the "set" command.

Parameters
type

The InertialTypes::InertialCategory to set the state for.

enable
bool

Whether to enable (true) or disable (false) continuous data streaming.

Returns

A ByteStream that holds the bytes that make up the command.

Response
public
GenericInertialCommand.​Response
ResponsePattern
Response

Handles the response to the ContinuousDataStream command.

Variables
m_deviceSelector
uint8 m_deviceSelector

The device selector to look for in the response.

Functions
Response
Response(
std::weak_ptr<ResponseCollectorcollector,
bool dataResponse,
InertialTypes::InertialCategory type
)

Creates the ContinuousDataStream::Response object.

Parameters
collector
std::weak_ptr<ResponseCollector>

The ResponseCollector to register the response with.

dataResponse
bool

Whether the command is expecting a data field response

type

The InertialTypes::InertialCategory to use for the command/response.

match_data
virtual bool match_data(
const InertialDataField &field
) override

Attempts to match an InertialDataField to the expected data field response.

Returns

true if the field matches the expected data, false if it does not.

parseResponse
bool parseResponse(
const GenericInertialCommandResponse &response
) const

Parses a successfully matched response for the ContinuousDataStream command.

Parameters
response

The GenericInertialCommandResponse that matches the data field for this response.

Returns

true if the data stream is enabled, false if it is disabled.