Description

The AccelerometerStream command is used to enable or disable streaming of accelerometer data.

The 3-axis accelerometer captures the acceleration vector in 3D space. The acceleration vector consists of the gravity plus some external force that has been applied to the device. If the device is stationary, the acceleration vector will be equal to the gravity vector reading in the sensor's frame of reference. The software layer in our protocol can configure the accelerometer's range to be one of the following values: \(\pm2g, \pm4g, \pm8g, \pm16g\), where \(g=9.8m/s^2\).

Protocol

This command uses the Command-Ack-Response-Data protocol.

Command

Byte Name C Type Value
0 Control Byte ( Packet Type (7:5) / SubSystem (4:0) ) uint8_t 0x4D ( 0b010 / 0b01101 )
1 Payload Length uint8_t 1
2 CRC uint8_t Calculated
3 Command uint8_t 0x0A

Payload

Byte Name C Type Value
4 State uint8_t 0x00 (Disable) or 0x01 (Enable)

Response

Header

Byte Name C Type Value
0 Control Byte ( Packet Type (7:5) / SubSystem (4:0) ) uint8_t 0x0D ( 0b000 / 0b01101 )
1 Payload Length uint8_t 6
2 CRC uint8_t Calculated
3 Command uint8_t 0x0A

Payload

Byte Name C Type Value
4 - 5 Downsample uint16_t Varies
6 - 7 Accelerometer Range uint16_t Varies
8 - 9 Rate uint16_t Varies

Data

Header

Byte Name C Type Value
0 Control Byte ( Packet Type (7:5) / SubSystem (4:0) ) uint8_t 0x6D ( 0b011 / 0b01101 )
1 Payload Length uint8_t 10
2 CRC uint8_t Calculated
3 Command uint8_t 0x0A

Payload

Byte Name C Type Value
4 - 7 Timestamp uint32_t Varies
8 - 9 Accelerometer (X) int16_t Varies
10 - 11 Accelerometer (Y) int16_t Varies
12 - 13 Accelerometer (Z) int16_t Varies