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

◆ bt_mesh_sensor_ch_to_str()

int bt_mesh_sensor_ch_to_str ( const struct bt_mesh_sensor_value ch,
char *  str,
size_t  len 
)

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

Get a human readable representation of a single sensor channel.

Note
This prints float values internally for most formats, which requires
embed:rst:inline :kconfig:option:`CONFIG_CBPRINTF_FP_SUPPORT` 
to be enabled.
Parameters
[in]chSensor channel to represent.
[out]strString buffer to fill. Should be BT_MESH_SENSOR_CH_STR_LEN bytes long.
[in]lenLength of str buffer.
Returns
Number of bytes that should have been written if str is sufficiently large.