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

◆ bt_mesh_sensor_srv_sample()

int bt_mesh_sensor_srv_sample ( struct bt_mesh_sensor_srv * srv,
struct bt_mesh_sensor * sensor )

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

Make the server to take a sample of the sensor, and publish if the value changed sufficiently.

Works the same way as bt_mesh_sensor_srv_pub(), except that the server makes a decision on whether to publish the value based on the delta from the previous publication and the sensor's threshold parameters. Only single channel sensor values will be considered.

Parameters
[in]srvSensor server instance.
[in]sensorSensor instance to sample.
Return values
0The sensor value was published.
-EBUSYFailed sampling the sensor value.
-EALREADYThe sensor value has not changed sufficiently to require a publication.
-EADDRNOTAVAILA message context was not provided and publishing is not configured.
-EAGAINThe device has not been provisioned.