13#ifndef BT_MESH_SENSOR_CLI_H__
14#define BT_MESH_SENSOR_CLI_H__
33#define BT_MESH_SENSOR_CLI_INIT(_handlers) \
44#define BT_MESH_MODEL_SENSOR_CLI(_cli) \
45 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_SENSOR_CLI, _bt_mesh_sensor_cli_op, \
47 BT_MESH_MODEL_USER_DATA(struct bt_mesh_sensor_cli, \
49 &_bt_mesh_sensor_cli_cb)
57 const struct bt_mesh_model *
model;
59 struct bt_mesh_model_pub
pub;
64 BT_MESH_MODEL_BUF_LEN(BT_MESH_SENSOR_OP_CADENCE_SET,
65 BT_MESH_SENSOR_MSG_MAXLEN_CADENCE_SET),
66 BT_MESH_MODEL_BUF_LEN(BT_MESH_SENSOR_OP_SETTING_SET,
67 BT_MESH_SENSOR_MSG_MAXLEN_SETTING_SET))];
92#if !defined(CONFIG_BT_MESH_SENSOR_USE_LEGACY_SENSOR_VALUE) || defined(__DOXYGEN__)
153 struct bt_mesh_msg_ctx *ctx,
172 struct bt_mesh_msg_ctx *ctx,
189 struct bt_mesh_msg_ctx *ctx,
206 struct bt_mesh_msg_ctx *ctx,
208 const uint16_t *ids, uint32_t count);
251 struct bt_mesh_msg_ctx *ctx,
253 uint8_t index, uint8_t count,
268 struct bt_mesh_msg_ctx *ctx, uint16_t id,
446 struct sensor_value
value[CONFIG_BT_MESH_SENSOR_CHANNELS_MAX];
456 struct sensor_value
value[CONFIG_BT_MESH_SENSOR_CHANNELS_MAX];
472 struct sensor_value
value[CONFIG_BT_MESH_SENSOR_CHANNELS_MAX];
491 struct bt_mesh_msg_ctx *ctx,
493 const struct sensor_value *value);
510 struct bt_mesh_msg_ctx *ctx,
527 struct bt_mesh_msg_ctx *ctx,
544 struct bt_mesh_msg_ctx *ctx,
546 const uint16_t *ids, uint32_t count);
589 struct bt_mesh_msg_ctx *ctx,
591 uint8_t index, uint8_t count,
606 struct bt_mesh_msg_ctx *ctx, uint16_t id,
640 const struct sensor_value *value,
662 const struct sensor_value *value);
688 struct sensor_value *rsp);
810 struct bt_mesh_msg_ctx *ctx,
837 struct bt_mesh_msg_ctx *ctx,
864 struct bt_mesh_msg_ctx *ctx,
955 struct bt_mesh_msg_ctx *ctx,
957 uint16_t *ids, uint32_t *count);
983 struct bt_mesh_msg_ctx *ctx,
1011 struct bt_mesh_msg_ctx *ctx,
1016extern const struct bt_mesh_model_op _bt_mesh_sensor_cli_op[];
1017extern const struct bt_mesh_model_cb _bt_mesh_sensor_cli_cb;
int bt_mesh_sensor_cli_cadence_set(struct bt_mesh_sensor_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_sensor_type *sensor, const struct bt_mesh_sensor_cadence_status *cadence, struct bt_mesh_sensor_cadence_status *rsp)
Set the cadence state for the given sensor.
int bt_mesh_sensor_cli_setting_get(struct bt_mesh_sensor_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_sensor_type *sensor, const struct bt_mesh_sensor_type *setting, struct bt_mesh_sensor_setting_status *rsp)
Get a setting value for a sensor.
int bt_mesh_sensor_cli_series_entry_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 *column, struct bt_mesh_sensor_series_entry *rsp)
Read a single sensor series data entry.
int bt_mesh_sensor_cli_settings_get(struct bt_mesh_sensor_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_sensor_type *sensor, uint16_t *ids, uint32_t *count)
Get the list of settings for the given sensor.
int bt_mesh_sensor_cli_cadence_get(struct bt_mesh_sensor_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_sensor_type *sensor, struct bt_mesh_sensor_cadence_status *rsp)
Get the cadence state.
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)
Get multiple sensor series data entries.
int bt_mesh_sensor_cli_desc_all_get(struct bt_mesh_sensor_cli *cli, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_sensor_info *sensors, uint32_t *count)
Retrieve all sensor descriptors in a sensor server.
int bt_mesh_sensor_cli_setting_set_unack(struct bt_mesh_sensor_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_sensor_type *sensor, const struct bt_mesh_sensor_type *setting, const struct bt_mesh_sensor_value *value)
Set a setting value for a sensor without requesting a response.
int bt_mesh_sensor_cli_desc_get(struct bt_mesh_sensor_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_sensor_type *sensor, struct bt_mesh_sensor_descriptor *rsp)
Get the descriptor for the given sensor.
int bt_mesh_sensor_cli_get(struct bt_mesh_sensor_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_sensor_type *sensor, struct bt_mesh_sensor_value *rsp)
Read sensor data from a sensor instance.
int bt_mesh_sensor_cli_all_get(struct bt_mesh_sensor_cli *cli, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_sensor_data *sensors, uint32_t *count)
Read sensor data from all sensors on a server.
int bt_mesh_sensor_cli_setting_set(struct bt_mesh_sensor_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_sensor_type *sensor, const struct bt_mesh_sensor_type *setting, const struct bt_mesh_sensor_value *value, struct bt_mesh_sensor_setting_status *rsp)
Set a setting value for a sensor.
int bt_mesh_sensor_cli_cadence_set_unack(struct bt_mesh_sensor_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_sensor_type *sensor, const struct bt_mesh_sensor_cadence_status *cadence)
Set the cadence state for the given sensor without requesting a response.
struct bt_mesh_sensor_threshold threshold
Definition: sensor_cli.h:89
uint8_t fast_period_div
Definition: sensor_cli.h:81
uint8_t min_int
Definition: sensor_cli.h:87
Definition: sensor_cli.h:75
void(* unknown_type)(struct bt_mesh_sensor_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t id, uint32_t opcode)
Unknown type callback.
Definition: sensor_cli.h:267
void(* series_entry)(struct bt_mesh_sensor_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_sensor_type *sensor, uint8_t index, uint8_t count, const struct bt_mesh_sensor_series_entry *entry)
Series entry callback.
Definition: sensor_cli.h:250
void(* cadence)(struct bt_mesh_sensor_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_sensor_type *sensor, const struct bt_mesh_sensor_cadence_status *cadence)
Sensor cadence callback.
Definition: sensor_cli.h:188
void(* settings)(struct bt_mesh_sensor_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_sensor_type *sensor, const uint16_t *ids, uint32_t count)
Sensor settings list callback.
Definition: sensor_cli.h:205
void(* setting_status)(struct bt_mesh_sensor_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_sensor_type *sensor, const struct bt_mesh_sensor_setting_status *setting)
Sensor setting status callback.
Definition: sensor_cli.h:222
void(* sensor)(struct bt_mesh_sensor_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_sensor_info *sensor)
Sensor description callback.
Definition: sensor_cli.h:171
void(* data)(struct bt_mesh_sensor_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_sensor_type *sensor, const struct bt_mesh_sensor_value *value)
Sensor data callback.
Definition: sensor_cli.h:152
Definition: sensor_cli.h:138
uint8_t pub_data[MAX(BT_MESH_MODEL_BUF_LEN(BT_MESH_SENSOR_OP_CADENCE_SET, BT_MESH_SENSOR_MSG_MAXLEN_CADENCE_SET), BT_MESH_MODEL_BUF_LEN(BT_MESH_SENSOR_OP_SETTING_SET, BT_MESH_SENSOR_MSG_MAXLEN_SETTING_SET))]
Definition: sensor_cli.h:67
struct bt_mesh_model_pub pub
Definition: sensor_cli.h:59
const struct bt_mesh_model * model
Definition: sensor_cli.h:57
const struct bt_mesh_sensor_cli_handlers * cb
Definition: sensor_cli.h:71
struct net_buf_simple pub_buf
Definition: sensor_cli.h:61
struct bt_mesh_msg_ack_ctx ack_ctx
Definition: sensor_cli.h:69
Definition: sensor_cli.h:55
const struct bt_mesh_sensor_type * type
Definition: sensor_cli.h:122
struct bt_mesh_sensor_value value[CONFIG_BT_MESH_SENSOR_CHANNELS_MAX]
Definition: sensor_cli.h:124
Definition: sensor_cli.h:120
uint16_t id
Definition: sensor_cli.h:114
struct bt_mesh_sensor_descriptor descriptor
Definition: sensor_cli.h:116
Definition: sensor_cli.h:112
struct bt_mesh_sensor_value value[CONFIG_BT_MESH_SENSOR_CHANNELS_MAX]
Definition: sensor_cli.h:108
struct bt_mesh_sensor_column column
Definition: sensor_cli.h:106
Definition: sensor_cli.h:104
bool writable
Definition: sensor_cli.h:100
const struct bt_mesh_sensor_type * type
Definition: sensor_cli.h:96
struct bt_mesh_sensor_value value[CONFIG_BT_MESH_SENSOR_CHANNELS_MAX]
Definition: sensor_cli.h:98
Definition: sensor_cli.h:94
struct bt_mesh_sensor_value sensor_value
Definition: sensor_cli.h:133
uint16_t index
Definition: sensor_cli.h:134
Sensor column indexing value.
Definition: sensor_cli.h:132