sensor_format_user_data_t

A format used for user data that's published as interim sensor data

Synopsis:

#include <sensor/sensor_api.h>
typedef struct sensor_format_user_data_t {
    uint32_t data_size;
    uint32_t data_id;
    int64_t publish_timestamp;
    uint8_t reserved[SENSOR_DATA_EXTENDED_SIZE];
} sensor_format_user_data_t;

Data:

uint32_t data_size
The size of the data, in bytes.
uint32_t data_id
Identifier for the type of user data.

Interpretation of this field is left to the user to define in his application and permits defining of different user data items

int64_t publish_timestamp
The timestamp when the buffer was filled.

The timestamp is referenced to the system monotonic clock (CLOCK_MONOTONIC).

uint8_t reserved[SENSOR_DATA_EXTENDED_SIZE]
The remaining bytes are left to the user to use to describe the user data.

It is recommended that the user casts a user-defined structure over this area that will depend on data_id.

Library:

libsensor

Description:

There is a basic structure that the user is free to expand to meet his needs.