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

◆ bt_mesh_sensor_cli_series_entries_get()

int bt_mesh_sensor_cli_series_entries_get ( struct bt_mesh_sensor_cli * cli,
struct bt_mesh_msg_ctx * ctx,
const struct bt_mesh_sensor_type * sensor,
const union bt_mesh_sensor_column_key * range_start,
const union bt_mesh_sensor_column_key * range_end,
struct bt_mesh_sensor_series_entry * rsp,
uint32_t * count )

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

Get multiple sensor series data entries.

Retrieves all data series columns starting within the given range (inclusive), or all data series entries if range_start or range_end is NULL. For instance, requesting range [1, 5] from a sensor with columns [0, 2], [1, 4], [4, 5] and [5, 8] will return all columns except [0, 2]. For sensors with only one or two channels, the range values are indices into the column series, inclusive.

If a rsp array is provided and the client received a response, the array will be filled with as many of the response columns 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.

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

Parameters
[in]cliSensor client instance.
[in]ctxMessage context parameters, or NULL to use the configured publish parameters.
[in]sensorSensor instance present on the targeted sensor server.
[in]range_startStart of column range to get, or NULL to get all columns.
[in]range_endEnd of column range to get, or NULL to get all columns.
[out]rspArray of entries to copy the response into, or NULL to keep from blocking.
[in,out]countThe number of entries in rsp. Is changed to reflect the number of entries in the response.
Return values
0Successfully received the full list of sensor series columns. The rsp array and count has been changed to reflect the response contents.
-ENODEVThe sensor server doesn't have the given sensor.
-E2BIGThe list of sensor columns in the response was too big to fit in the rsp array. The rsp array has been filled up to the original count, and count has been changed to the number of columns in the response.
-ENOTSUPThe sensor doesn't support series data.
-EADDRNOTAVAILA message context was not provided and publishing is not configured.
-EAGAINThe device has not been provisioned.
-ETIMEDOUTThe request timed out without a response.