![]() |
nRF Connect SDK API 3.3.99
|
| 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.
| [in] | srv | Sensor server instance. |
| [in] | sensor | Sensor instance to sample. |
| 0 | The sensor value was published. |
| -EBUSY | Failed sampling the sensor value. |
| -EALREADY | The sensor value has not changed sufficiently to require a publication. |
| -EADDRNOTAVAIL | A message context was not provided and publishing is not configured. |
| -EAGAIN | The device has not been provisioned. |