Edge AI Add-on API 2.2.0
Loading...
Searching...
No Matches

◆ data_fwd_sensor_value_to_proto_value()

static proto_value_t data_fwd_sensor_value_to_proto_value ( const struct sensor_value * val)
inlinestatic

#include <samples/data_forwarder/src/sensor/data_fwd_sensor.h>

Convert a Zephyr sensor value to a protocol sample value.

When CONFIG_DATA_FWD_PROTO_INT32_VALUES is enabled, the result is clamped to INT32_MIN..INT32_MAX micro-units. Otherwise a float is returned.

Parameters
valZephyr sensor value to convert.
Returns
Value encoded for the active protocol mode.