sensor_get_unit()

Retrieve the sensor unit associated with a sensor handle

Synopsis:

#include <sensor/sensor_api.h>
sensor_error_t sensor_get_unit(sensor_handle_t handle,
                               sensor_unit_t *unit)

Arguments:

handle
The handle that's returned from calling sensor_open().
unit
On success, it is set to the sensor unit associated with the handle passed as argument.

Library:

libsensor

Description:

This function can be used for example inside a sensor data callback function to discover from which sensor unit is the buffer coming.

Returns:

SENSOR_EOK when the function successfully completes, otherwise another sensor_error_t value that provides the reason that the call failed.