nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
light_ctl_srv.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_CTL_SRV_H__
15#define BT_MESH_LIGHT_CTL_SRV_H__
16
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
27
35#define BT_MESH_LIGHT_CTL_SRV_INIT(_lightness_handlers, _light_temp_handlers) \
36 { \
37 .lightness_srv = \
38 BT_MESH_LIGHTNESS_SRV_INIT(_lightness_handlers), \
39 .temp_srv = BT_MESH_LIGHT_TEMP_SRV_INIT(_light_temp_handlers), \
40 }
41
48#define BT_MESH_MODEL_LIGHT_CTL_SRV(_srv) \
49 BT_MESH_MODEL_LIGHTNESS_SRV(&(_srv)->lightness_srv), \
50 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_LIGHT_CTL_SRV, \
51 _bt_mesh_light_ctl_srv_op, &(_srv)->pub, \
52 BT_MESH_MODEL_USER_DATA(struct bt_mesh_light_ctl_srv, \
53 _srv), \
54 &_bt_mesh_light_ctl_srv_cb), \
55 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_LIGHT_CTL_SETUP_SRV, \
56 _bt_mesh_light_ctl_setup_srv_op, NULL, \
57 BT_MESH_MODEL_USER_DATA(struct bt_mesh_light_ctl_srv, \
58 _srv), \
59 &_bt_mesh_light_ctl_setup_srv_cb)
60
71 const struct bt_mesh_model *model;
73 struct bt_mesh_model_pub pub;
74 /* Publication buffer */
75 struct net_buf_simple pub_buf;
76 /* Publication data */
77 uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(
78 BT_MESH_LIGHT_CTL_STATUS, BT_MESH_LIGHT_CTL_MSG_MAXLEN_STATUS)];
81};
82
102 struct bt_mesh_msg_ctx *ctx,
103 struct bt_mesh_light_ctl_status *status);
104
124 struct bt_mesh_msg_ctx *ctx,
125 enum bt_mesh_model_status status);
126
145 struct bt_mesh_msg_ctx *ctx);
146
148extern const struct bt_mesh_model_op _bt_mesh_light_ctl_srv_op[];
149extern const struct bt_mesh_model_op _bt_mesh_light_ctl_setup_srv_op[];
150extern const struct bt_mesh_model_cb _bt_mesh_light_ctl_srv_cb;
151extern const struct bt_mesh_model_cb _bt_mesh_light_ctl_setup_srv_cb;
154#ifdef __cplusplus
155}
156#endif
157
158#endif /* BT_MESH_LIGHT_CTL_SRV_H__ */
159
int bt_mesh_light_ctl_default_pub(struct bt_mesh_light_ctl_srv *srv, struct bt_mesh_msg_ctx *ctx)
Publish the current CTL Default status.
int bt_mesh_light_ctl_range_pub(struct bt_mesh_light_ctl_srv *srv, struct bt_mesh_msg_ctx *ctx, enum bt_mesh_model_status status)
Publish the current CTL Range status.
int bt_mesh_light_ctl_pub(struct bt_mesh_light_ctl_srv *srv, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_light_ctl_status *status)
Publish the current CTL status.
bt_mesh_model_status
Definition: model_types.h:54
struct bt_mesh_light_temp_srv temp_srv
Definition: light_ctl_srv.h:67
struct bt_mesh_tid_ctx prev_transaction
Definition: light_ctl_srv.h:80
struct net_buf_simple pub_buf
Definition: light_ctl_srv.h:75
uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(BT_MESH_LIGHT_CTL_STATUS, BT_MESH_LIGHT_CTL_MSG_MAXLEN_STATUS)]
Definition: light_ctl_srv.h:78
struct bt_mesh_model_pub pub
Definition: light_ctl_srv.h:73
const struct bt_mesh_model * model
Definition: light_ctl_srv.h:71
struct bt_mesh_lightness_srv lightness_srv
Definition: light_ctl_srv.h:69
Definition: light_ctl_srv.h:65
Definition: light_ctl.h:64
Definition: light_temp_srv.h:142
Definition: lightness_srv.h:181
Definition: model_types.h:46