nRF Connect SDK API 2.8.99
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
107 void (*prop)(struct bt_mesh_light_ctrl_cli *cli,
108 struct bt_mesh_msg_ctx *ctx,
110 const struct bt_mesh_sensor_value *value);
111
122 void (*coeff)(struct bt_mesh_light_ctrl_cli *cli,
123 struct bt_mesh_msg_ctx *ctx,
125 float value);
126};
127
134 const struct bt_mesh_model *model;
136 struct bt_mesh_model_pub pub;
137 /* Publication buffer */
138 struct net_buf_simple pub_buf;
139 /* Publication data */
140 uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(
141 BT_MESH_LIGHT_CTRL_OP_PROP_SET,
144 struct bt_mesh_msg_ack_ctx ack_ctx;
148 uint8_t tid;
149};
150
175 struct bt_mesh_msg_ctx *ctx, bool *rsp);
176
202 struct bt_mesh_msg_ctx *ctx, bool enabled,
203 bool *rsp);
204
222 struct bt_mesh_msg_ctx *ctx,
223 bool enabled);
224
250 struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx,
251 bool *rsp);
252
279 struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx,
280 bool enabled, bool *rsp);
281
299 struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx,
300 bool enabled);
301
326 struct bt_mesh_msg_ctx *ctx,
327 struct bt_mesh_onoff_status *rsp);
328
356 struct bt_mesh_msg_ctx *ctx,
357 const struct bt_mesh_onoff_set *set,
358 struct bt_mesh_onoff_status *rsp);
359
379 struct bt_mesh_light_ctrl_cli *cli, struct bt_mesh_msg_ctx *ctx,
380 const struct bt_mesh_onoff_set *set);
381
407 struct bt_mesh_msg_ctx *ctx,
409 struct bt_mesh_sensor_value *rsp);
410
437 struct bt_mesh_msg_ctx *ctx,
439 const struct bt_mesh_sensor_value *val,
440 struct bt_mesh_sensor_value *rsp);
441
460 struct bt_mesh_light_ctrl_cli *cli,
461 struct bt_mesh_msg_ctx *ctx,
463 const struct bt_mesh_sensor_value *val);
464
486 struct bt_mesh_msg_ctx *ctx,
488 float *rsp);
489
512 struct bt_mesh_msg_ctx *ctx,
514 float val, float *rsp);
515
534 struct bt_mesh_msg_ctx *ctx,
536 float val);
537
539extern const struct bt_mesh_model_op _bt_mesh_light_ctrl_cli_op[];
540extern const struct bt_mesh_model_cb _bt_mesh_light_ctrl_cli_cb;
543#ifdef __cplusplus
544}
545#endif
546
547#endif /* BT_MESH_LIGHT_CTRL_CLI_H__ */
548
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:107
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:122
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:142
uint8_t tid
Definition light_ctrl_cli.h:148
struct net_buf_simple pub_buf
Definition light_ctrl_cli.h:138
const struct bt_mesh_model * model
Definition light_ctrl_cli.h:134
struct bt_mesh_model_pub pub
Definition light_ctrl_cli.h:136
struct bt_mesh_msg_ack_ctx ack_ctx
Definition light_ctrl_cli.h:144
const struct bt_mesh_light_ctrl_cli_handlers * handlers
Definition light_ctrl_cli.h:146
Light Lightness Control Client instance.
Definition light_ctrl_cli.h:132
Definition gen_onoff.h:24
Definition gen_onoff.h:40
Definition sensor.h:164