Sensors data

Data from sensors are sent in the following TLV structure:

type

length [B]

value

0x0005

up to 23

active_sensors (1B), sensors_data (up to 22B)


This structure has different lengths. The length of it depends on activated sensors that want to send their data. Information about which sensors are active is encoded in the first byte of the structure.

The active sensors byte is encoded in the following way.

bit

sensor

Description

7

pushbutton

It is set to 1 in one blink after the pushbutton was pressed. No added payload.

6

reserved


5

reserved


4

reserved


3

barometer

It is set to 1 if the barometer is active. If active the 4 bytes of sensors data are added to the payload. Order of data: raw_temperature (1B), raw_pressure (3B)*

2

magnetometer

It is set to 1 if the magnetometer is active. If active the 6 bytes of sensors data are added to the payload. Order of the data: x_axis (2B)*, y_axis (2B)*, z_axis (2B)*

1

gyroscope

It is set to 1 if the gyroscope is active. If active the 6 bytes of sensors data are added to the payload. Order of the data: x_axis (2B)*, y_axis (2B)*, z_axis (2B)*

0

accelerometer

It is set to 1 if the accelerometer is active. If active the 6 bytes of sensors data are added to the payload. Order of the data: x_axis (2B)*, y_axis (2B)*, z_axis (2B)*

*all multibyte values are in little-endian order


If more than one sensors are active, the sensors data are ordered in the following orderBarometer (temperature, pressure), Magnetometer, Gyroscope, Accelerometer.

All sensors data are sent in the raw form - the following formulas must be used to get in base units:

Temperature

Atmospheric pressure

Acceleration

The formula depends on the configurable parameter - dynamic range of the accelerometer which can be found in the infoMsg.

Gyroscope

The formula depends on the configurable parameter - dynamic range of the gyroscope which can be found in the infoMsg.

Magnetometer