Description

The MotionDirectionStream command is used to enable or disable the streaming of the device's motion direction (angle) in a 2D plane. For instance, the device can be worn as a watch and moved around in different directions. For more accurate capture of the motion direction, it is recommended to hold the device in the horizontal plane and move it around on the same 2D plane. The algorithm running on Neblina first detects a stance phase, where the device is stationary, and then it picks up a quick move and streams the direction of the movement. Hence, you need to come to a stop position after each movement to be able to stream the next motion direction packet.

The motion direction angle is represented by one fractional digit precision using the following equation:

\[angle_{est} = floor(angle_{ref} \times 10)\]

For instance, the angle \(-104.731^{\circ}\) is rounded to \(-104.7^{\circ}\), and is represented as the integer number -1047.

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 0x41 ( 0b010 / 0b00001 )
1 Payload Length uint8_t 1
2 CRC uint8_t Calculated
3 Command uint8_t 0x1E

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 0x01 ( 0b000 / 0b00001 )
1 Payload Length uint8_t 4
2 CRC uint8_t Calculated
3 Command uint8_t 0x1E

Payload

Byte Name C Type Value
4 - 5 Downsample uint16_t Varies
6 - 7 Rate uint16_t Varies

Data

Header

Byte Name C Type Value
0 Control Byte ( Packet Type (7:5) / SubSystem (4:0) ) uint8_t 0x61 ( 0b011 / 0b00001 )
1 Payload Length uint8_t 6
2 CRC uint8_t Calculated
3 Command uint8_t 0x1E

Payload

Byte Name C Type Value
4 - 7 Timestamp uint32_t Varies
8 - 9 Direction int16_t *Varies