Updated: October 28, 2024 |
Request a handle to access a logical sensor unit
#include <sensor/sensor_api.h>
sensor_error_t sensor_open(sensor_unit_t unit, sensor_access_mode_t mode, sensor_handle_t *handle)
If the given sensor unit is available, this function provides a handle for accessing it.
There is a limit on the number of handles that can be opened on a given logical sensor unit. If this limit is exceeded, this function fails and returns SENSOR_EAGAIN.
SENSOR_EOK when the function successfully completes, otherwise another sensor_error_t value that provides the reason that the call failed.