nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
light_ctrl_cli.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
14#ifndef BT_MESH_LIGHT_CTRL_CLI_H__
15#define BT_MESH_LIGHT_CTRL_CLI_H__
16
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
27
36#define BT_MESH_LIGHT_CTRL_CLI_INIT(_handlers) \
37 { \
38 .handlers = _handlers, \
39 }
40
47#define BT_MESH_MODEL_LIGHT_CTRL_CLI(_cli) \
48 BT_MESH_MODEL_CB( \
49 BT_MESH_MODEL_ID_LIGHT_LC_CLI, _bt_mesh_light_ctrl_cli_op, \
50 &(_cli)->pub, \
51 BT_MESH_MODEL_USER_DATA(struct bt_mesh_light_ctrl_cli, _cli), \
52 &_bt_mesh_light_ctrl_cli_cb)
53
65 void (*mode)(struct bt_mesh_light_ctrl_cli *cli,
66 struct bt_mesh_msg_ctx *ctx, bool enabled);
67
79 struct bt_mesh_msg_ctx *ctx, bool enabled);
80
93 struct bt_mesh_msg_ctx *ctx,
94 const struct bt_mesh_onoff_status *status);
95
96#if !defined(CONFIG_BT_MESH_SENSOR_USE_LEGACY_SENSOR_VALUE) || defined(__DOXYGEN__)
108 void (*prop)(struct bt_mesh_light_ctrl_cli *cli,
109 struct bt_mesh_msg_ctx *ctx,
111 const struct bt_mesh_sensor_value *value);
112#else
124 void (*prop)(struct bt_mesh_light_ctrl_cli *cli,
125 struct bt_mesh_msg_ctx *ctx,
127 const struct sensor_value *value);
128#endif
129
140 void (*coeff)(struct bt_mesh_light_ctrl_cli *cli,
141 struct bt_mesh_msg_ctx *ctx,
143 float value);
144};
145
152 const struct bt_mesh_model *model;
154 struct bt_mesh_model_pub pub;
155 /* Publication buffer */
156 struct net_buf_simple pub_buf;
157 /* Publication data */
158 uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(
159 BT_MESH_LIGHT_CTRL_OP_PROP_SET,
162 struct bt_mesh_msg_ack_ctx ack_ctx;
166 uint8_t tid;
167};
168
193 struct bt_mesh_msg_ctx *ctx, bool *rsp);
194
220 struct bt_mesh_msg_ctx *ctx, bool enabled,
221 bool *rsp);
222
240 struct bt_mesh_msg_ctx *ctx,
241 bool enabled);
242
268 struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx,
269 bool *rsp);
270
297 struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx,
298 bool enabled, bool *rsp);
299
317 struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx,
318 bool enabled);
319
344 struct bt_mesh_msg_ctx *ctx,
345 struct bt_mesh_onoff_status *rsp);
346
374 struct bt_mesh_msg_ctx *ctx,
375 const struct bt_mesh_onoff_set *set,
376 struct bt_mesh_onoff_status *rsp);
377
397 struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx,
398 const struct bt_mesh_onoff_set *set);
399
400#if !defined(CONFIG_BT_MESH_SENSOR_USE_LEGACY_SENSOR_VALUE) || defined(__DOXYGEN__)
426 struct bt_mesh_msg_ctx *ctx,
428 struct bt_mesh_sensor_value *rsp);
429
456 struct bt_mesh_msg_ctx *ctx,
458 const struct bt_mesh_sensor_value *val,
459 struct bt_mesh_sensor_value *rsp);
460
479 struct bt_mesh_light_ctrl_cli *cli,
480 struct bt_mesh_msg_ctx *ctx,
482 const struct bt_mesh_sensor_value *val);
483#else
509 struct bt_mesh_msg_ctx *ctx,
511 struct sensor_value *rsp);
512
539 struct bt_mesh_msg_ctx *ctx,
541 const struct sensor_value *val,
542 struct sensor_value *rsp);
543
562 struct bt_mesh_msg_ctx *ctx,
564 const struct sensor_value *val);
565#endif
566
588 struct bt_mesh_msg_ctx *ctx,
590 float *rsp);
591
614 struct bt_mesh_msg_ctx *ctx,
616 float val, float *rsp);
617
636 struct bt_mesh_msg_ctx *ctx,
638 float val);
639
641extern const struct bt_mesh_model_op _bt_mesh_light_ctrl_cli_op[];
642extern const struct bt_mesh_model_cb _bt_mesh_light_ctrl_cli_cb;
645#ifdef __cplusplus
646}
647#endif
648
649#endif /* BT_MESH_LIGHT_CTRL_CLI_H__ */
650
int bt_mesh_light_ctrl_cli_light_onoff_set_unack(struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_onoff_set *set)
Tell a Light Lightness Control Server to turn the light on or off without requesting a response.
int bt_mesh_light_ctrl_cli_occupancy_enabled_get(struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx, bool *rsp)
Get a Light Lightness Control Server's current Occupancy Mode.
int bt_mesh_light_ctrl_cli_mode_get(struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx, bool *rsp)
Get a Light Lightness Control Server's current Mode.
int bt_mesh_light_ctrl_cli_mode_set(struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx, bool enabled, bool *rsp)
Set a Light Lightness Control Server's current Mode.
int bt_mesh_light_ctrl_cli_light_onoff_get(struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_onoff_status *rsp)
Get a Light Lightness Control Server's current OnOff state.
int bt_mesh_light_ctrl_cli_coeff_set_unack(struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx, enum bt_mesh_light_ctrl_coeff id, float val)
Set a Light Lightness Control Server Regulator Coefficient value without requesting a response.
int bt_mesh_light_ctrl_cli_prop_set(struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx, enum bt_mesh_light_ctrl_prop id, const struct bt_mesh_sensor_value *val, struct bt_mesh_sensor_value *rsp)
Set a Light Lightness Control Server property value.
int bt_mesh_light_ctrl_cli_mode_set_unack(struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx, bool enabled)
Set a Light Lightness Control Server's current Mode without requesting a response.
int bt_mesh_light_ctrl_cli_prop_set_unack(struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx, enum bt_mesh_light_ctrl_prop id, const struct bt_mesh_sensor_value *val)
Set a Light Lightness Control Server property value without requesting a response.
int bt_mesh_light_ctrl_cli_prop_get(struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx, enum bt_mesh_light_ctrl_prop id, struct bt_mesh_sensor_value *rsp)
Get a Light Lightness Control Server property value.
int bt_mesh_light_ctrl_cli_occupancy_enabled_set(struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx, bool enabled, bool *rsp)
Set a Light Lightness Control Server's current Occupancy Mode.
int bt_mesh_light_ctrl_cli_coeff_get(struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx, enum bt_mesh_light_ctrl_coeff id, float *rsp)
Get a Light Lightness Control Server Regulator Coefficient value.
int bt_mesh_light_ctrl_cli_coeff_set(struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx, enum bt_mesh_light_ctrl_coeff id, float val, float *rsp)
Set a Light Lightness Control Server Regulator Coefficient value.
int bt_mesh_light_ctrl_cli_light_onoff_set(struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_onoff_set *set, struct bt_mesh_onoff_status *rsp)
Tell a Light Lightness Control Server to turn the light on or off.
int bt_mesh_light_ctrl_cli_occupancy_enabled_set_unack(struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx, bool enabled)
Set a Light Lightness Control Server's current Occupancy Mode without requesting a response.
bt_mesh_light_ctrl_prop
Definition: light_ctrl.h:24
bt_mesh_light_ctrl_coeff
Definition: light_ctrl.h:153
#define CONFIG_BT_MESH_SENSOR_CHANNEL_ENCODED_SIZE_MAX
Definition: sensor.h:26
void(* prop)(struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx, enum bt_mesh_light_ctrl_prop id, const struct bt_mesh_sensor_value *value)
Light LC Property status handler.
Definition: light_ctrl_cli.h:108
void(* mode)(struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx, bool enabled)
Light LC Mode status handler.
Definition: light_ctrl_cli.h:65
void(* occupancy_mode)(struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx, bool enabled)
Light LC Occupancy Mode status handler.
Definition: light_ctrl_cli.h:78
void(* light_onoff)(struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_onoff_status *status)
Light LC OnOff status handler.
Definition: light_ctrl_cli.h:92
void(* coeff)(struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx, enum bt_mesh_light_ctrl_coeff id, float value)
Light LC Regulator Coefficient status handler.
Definition: light_ctrl_cli.h:140
Definition: light_ctrl_cli.h:55
uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(BT_MESH_LIGHT_CTRL_OP_PROP_SET, 2+CONFIG_BT_MESH_SENSOR_CHANNEL_ENCODED_SIZE_MAX)]
Definition: light_ctrl_cli.h:160
uint8_t tid
Definition: light_ctrl_cli.h:166
struct net_buf_simple pub_buf
Definition: light_ctrl_cli.h:156
const struct bt_mesh_model * model
Definition: light_ctrl_cli.h:152
struct bt_mesh_model_pub pub
Definition: light_ctrl_cli.h:154
struct bt_mesh_msg_ack_ctx ack_ctx
Definition: light_ctrl_cli.h:162
const struct bt_mesh_light_ctrl_cli_handlers * handlers
Definition: light_ctrl_cli.h:164
Light Lightness Control Client instance.
Definition: light_ctrl_cli.h:150
Definition: gen_onoff.h:24
Definition: gen_onoff.h:40
Definition: sensor.h:176