Updated: October 28, 2024 |
Retrieve an enumerated list of sensors available on the device
#include <sensor/sensor_api.h>
sensor_error_t sensor_get_supported_sensors(uint32_t num_asked, uint32_t type_mask, uint32_t *num_supported, supported_sensor_info_t *sensor_info)
This function writes an array of information about supported sensors of a given type.
The sensor_info argument must point to an array which has at least num_asked elements allocated. To find the required size for this array, you can invoke this function with num_asked set to zero or sensor_info set to NULL. The required array size is then written into the memory pointed to by num_supported. You can then allocate an array of this size and invoke this function again with num_asked set to the value previously written into num_supported and sensor_info pointing to the allocated array.
SENSOR_EOK when the function successfully completes, otherwise another sensor_error_t value that provides the reason that the call failed.