Updated: October 28, 2024 |
Retrieve the sensor unit associated with a sensor handle
#include <sensor/sensor_api.h>
sensor_error_t sensor_get_unit(sensor_handle_t handle, sensor_unit_t *unit)
This function retrieves the sensor unit associated with a sensor handle. For example, it can be used inside a sensor data callback function to discover which sensor unit the buffer is coming from.
SENSOR_EOK when the function successfully completes, otherwise another sensor_error_t value that provides the reason that the call failed.