nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches

◆ bt_mesh_sensor_cli_desc_all_get()

int bt_mesh_sensor_cli_desc_all_get ( struct bt_mesh_sensor_cli * cli,
struct bt_mesh_msg_ctx * ctx,
struct bt_mesh_sensor_info * sensors,
uint32_t * count )

#include <include/bluetooth/mesh/sensor_cli.h>

Retrieve all sensor descriptors in a sensor server.

This call is blocking if the sensors buffer is non-NULL. Otherwise, this function will return, and the response will be passed to the bt_mesh_sensor_cli_handlers::sensor callback as a list of sensor descriptors.

If a sensors array is provided and the client received a response, the array will be filled with as many of the response sensors as it can fit, even if the buffer isn't big enough. If the call fails in a way that results in no response, count is set to 0.

Parameters
[in]cliSensor client instance.
[in]ctxMessage context parameters, or NULL to use the configured publish parameters.
[out]sensorsArray of sensors to fill with the response, or NULL to keep from blocking.
[in,out]countThe number of elements in the sensors array. Will be changed to reflect the resulting number of sensors.
Return values
0Successfully received the full list of sensors. The sensors array and count has been changed to reflect the response contents.
-EALREADYA blocking request is already in progress.
-E2BIGThe list of sensors in the response was too big to fit in the sensors array. The sensors array has been filled up to the original count, and count has been changed to the number of sensors in the response.
-EADDRNOTAVAILA message context was not provided and publishing is not configured.
-EAGAINThe device has not been provisioned.
-ETIMEDOUTThe request timed out without a response.