Updated: April 19, 2023 |
Format for user data published as interim sensor data
#include <sensor/sensor_api.h>
typedef struct sensor_format_user_data_t { uint32_t data_size; uint32_t data_id; int64_t publish_timestamp; sensor_type_t data_type; uint8_t reserved[SENSOR_DATA_EXTENDED_SIZE]; } sensor_format_user_data_t;
This field permits the definition of different user data items. Interpretation of this field is up to the user application.
The timestamp is referenced to the clock specified in the sensor configuration file (which defaults to system monotonic clock, CLOCK_MONOTONIC) and is in microseconds.
This can be used with data_id to differentiate between multiple data sources in the system.
It is recommended to cast a user-defined structure that depends on data_id over this area.
This is a basic structure that the user can expand to meet their needs.