nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
Bluetooth Mesh Sensors

API for Bluetooth Mesh Sensors. More...

Data Structures

struct  bt_mesh_sensor_unit
 
struct  bt_mesh_sensor_channel
 
struct  bt_mesh_sensor_type
 
struct  bt_mesh_sensor_value
 
struct  bt_mesh_sensor_descriptor
 
struct  bt_mesh_sensor_deltas
 
struct  bt_mesh_sensor_threshold
 
struct  bt_mesh_sensor_column
 
struct  bt_mesh_sensor_format_cb
 
struct  bt_mesh_sensor_format
 
struct  bt_mesh_sensor_setting
 
struct  bt_mesh_sensor_series
 
struct  bt_mesh_sensor
 

Macros

#define CONFIG_BT_MESH_SENSOR_CHANNEL_ENCODED_SIZE_MAX   0
 
#define BT_MESH_SENSOR_PERIOD_DIV_MAX   15
 
#define BT_MESH_SENSOR_INTERVAL_MAX   26
 
#define BT_MESH_SENSOR_CH_STR_LEN   23
 
#define BT_MESH_SENSOR_VALUE_IN_RANGE(_value, _start, _end)
 Returns whether or not encoded sensor value _value is in the range [_start, _end], inclusive.
 
#define BT_MESH_SENSOR_TYPE_FLAG_SERIES   BIT(0)
 
#define BT_MESH_SENSOR_TOLERANCE_ENCODE(_percent)   ((_percent) * 4095) / 100
 Encode a sensor tolerance percentage.
 

Enumerations

enum  bt_mesh_sensor_sampling {
  BT_MESH_SENSOR_SAMPLING_UNSPECIFIED , BT_MESH_SENSOR_SAMPLING_INSTANTANEOUS , BT_MESH_SENSOR_SAMPLING_ARITHMETIC_MEAN , BT_MESH_SENSOR_SAMPLING_RMS ,
  BT_MESH_SENSOR_SAMPLING_MAXIMUM , BT_MESH_SENSOR_SAMPLING_MINIMUM , BT_MESH_SENSOR_SAMPLING_ACCUMULATED , BT_MESH_SENSOR_SAMPLING_COUNT
}
 
enum  bt_mesh_sensor_cadence { BT_MESH_SENSOR_CADENCE_NORMAL , BT_MESH_SENSOR_CADENCE_FAST }
 
enum  bt_mesh_sensor_value_status {
  BT_MESH_SENSOR_VALUE_NUMBER = 0 , BT_MESH_SENSOR_VALUE_CONVERSION_ERROR , BT_MESH_SENSOR_VALUE_CLAMPED , BT_MESH_SENSOR_VALUE_UNKNOWN ,
  BT_MESH_SENSOR_VALUE_INVALID , BT_MESH_SENSOR_VALUE_MAX_OR_GREATER , BT_MESH_SENSOR_VALUE_MIN_OR_LESS , BT_MESH_SENSOR_VALUE_TOTAL_DEVICE_LIFE
}
 

Functions

int bt_mesh_sensor_value_compare (const struct bt_mesh_sensor_value *a, const struct bt_mesh_sensor_value *b)
 Compare two bt_mesh_sensor_value instances.
 
static bool bt_mesh_sensor_value_status_is_numeric (enum bt_mesh_sensor_value_status status)
 Returns true if status is a value which can be represented by a number, meaning one of BT_MESH_SENSOR_VALUE_NUMBER, BT_MESH_SENSOR_VALUE_MIN_OR_LESS, BT_MESH_SENSOR_VALUE_MAX_OR_GREATER and BT_MESH_SENSOR_VALUE_CLAMPED.
 
enum bt_mesh_sensor_value_status bt_mesh_sensor_value_to_float (const struct bt_mesh_sensor_value *sensor_val, float *val)
 Convert a bt_mesh_sensor_value to a float.
 
int bt_mesh_sensor_value_from_float (const struct bt_mesh_sensor_format *format, float val, struct bt_mesh_sensor_value *sensor_val)
 Convert a float to a bt_mesh_sensor_value.
 
enum bt_mesh_sensor_value_status bt_mesh_sensor_value_to_micro (const struct bt_mesh_sensor_value *sensor_val, int64_t *val)
 Convert a bt_mesh_sensor_value instance to an integer in micro units.
 
int bt_mesh_sensor_value_from_micro (const struct bt_mesh_sensor_format *format, int64_t val, struct bt_mesh_sensor_value *sensor_val)
 Convert an integer in micro units to a bt_mesh_sensor_value.
 
enum bt_mesh_sensor_value_status bt_mesh_sensor_value_to_sensor_value (const struct bt_mesh_sensor_value *sensor_val, struct sensor_value *val)
 Convert a bt_mesh_sensor_value instance to a sensor_value (include/zephyr/drivers/sensor.h).
 
int bt_mesh_sensor_value_from_sensor_value (const struct bt_mesh_sensor_format *format, const struct sensor_value *val, struct bt_mesh_sensor_value *sensor_val)
 Convert a sensor_value (include/zephyr/drivers/sensor.h) instance to a bt_mesh_sensor_value.
 
enum bt_mesh_sensor_value_status bt_mesh_sensor_value_get_status (const struct bt_mesh_sensor_value *sensor_val)
 Return a bt_mesh_sensor_value_status describing the value in a bt_mesh_sensor_value.
 
int bt_mesh_sensor_value_from_special_status (const struct bt_mesh_sensor_format *format, enum bt_mesh_sensor_value_status status, struct bt_mesh_sensor_value *sensor_val)
 Convert a bt_mesh_sensor_value_status value to a bt_mesh_sensor_value.
 
bool bt_mesh_sensor_value_in_column (const struct bt_mesh_sensor_value *value, const struct bt_mesh_sensor_column *col)
 Check whether a single channel sensor value lies within a column.
 
int bt_mesh_sensor_ch_to_str (const struct bt_mesh_sensor_value *ch, char *str, size_t len)
 Get a human readable representation of a single sensor channel.
 
const char * bt_mesh_sensor_ch_str (const struct bt_mesh_sensor_value *ch)
 Get a human readable representation of a single sensor channel.
 
const struct bt_mesh_sensor_typebt_mesh_sensor_type_get (uint16_t id)
 Get the sensor type associated with the given Device Property ID.
 
const struct bt_mesh_sensor_formatbt_mesh_sensor_column_format_get (const struct bt_mesh_sensor_type *type)
 Get the format of the sensor column data.
 

Detailed Description

API for Bluetooth Mesh Sensors.