nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches
light_xyl_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_XYL_SRV_H__
15#define BT_MESH_LIGHT_XYL_SRV_H__
16
20#if IS_ENABLED(CONFIG_EMDS) && IS_ENABLED(CONFIG_BT_SETTINGS)
21#include "emds/emds.h"
22#endif
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
29
37#define BT_MESH_LIGHT_XYL_SRV_INIT(_lightness_srv, _light_xyl_handlers) \
38 { \
39 .handlers = _light_xyl_handlers, \
40 .lightness_srv = _lightness_srv, \
41 .range = { \
42 .min = { .x = 0, .y = 0 }, \
43 .max = { .x = UINT16_MAX, .y = UINT16_MAX } \
44 } \
45 }
46
53#define BT_MESH_MODEL_LIGHT_XYL_SRV(_srv) \
54 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_LIGHT_XYL_SRV, \
55 _bt_mesh_light_xyl_srv_op, &(_srv)->pub, \
56 BT_MESH_MODEL_USER_DATA( \
57 struct bt_mesh_light_xyl_srv, _srv), \
58 &_bt_mesh_light_xyl_srv_cb), \
59 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_LIGHT_XYL_SETUP_SRV, \
60 _bt_mesh_light_xyl_setup_srv_op, NULL, \
61 BT_MESH_MODEL_USER_DATA( \
62 struct bt_mesh_light_xyl_srv, _srv), \
63 &_bt_mesh_light_xyl_setup_srv_cb)
64
78
88
106 void (*const xy_set)(struct bt_mesh_light_xyl_srv *srv,
107 struct bt_mesh_msg_ctx *ctx,
108 const struct bt_mesh_light_xy_set *set,
109 struct bt_mesh_light_xy_status *rsp);
110
119 void (*const xy_get)(struct bt_mesh_light_xyl_srv *srv,
120 struct bt_mesh_msg_ctx *ctx,
121 struct bt_mesh_light_xy_status *rsp);
122
130 void (*const range_update)(struct bt_mesh_light_xyl_srv *srv,
131 struct bt_mesh_msg_ctx *ctx,
132 const struct bt_mesh_light_xy_range *old_range,
133 const struct bt_mesh_light_xy_range *new_range);
134
142 void (*const default_update)(struct bt_mesh_light_xyl_srv *srv,
143 struct bt_mesh_msg_ctx *ctx,
144 const struct bt_mesh_light_xy *old_default,
145 const struct bt_mesh_light_xy *new_default);
146};
147
154 const struct bt_mesh_model *model;
158 struct bt_mesh_model_pub pub;
159 /* Publication buffer */
160 struct net_buf_simple pub_buf;
161 /* Publication data */
162 uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(
163 BT_MESH_LIGHT_XYL_OP_RANGE_STATUS,
164 BT_MESH_LIGHT_XYL_MSG_LEN_RANGE_STATUS)];
167
174 struct __packed {
176 struct bt_mesh_light_xy xy_last;
178
179#if IS_ENABLED(CONFIG_EMDS) && IS_ENABLED(CONFIG_BT_SETTINGS)
182#endif
183};
184
204 struct bt_mesh_msg_ctx *ctx,
205 struct bt_mesh_light_xyl_status *status);
206
226 struct bt_mesh_msg_ctx *ctx,
227 struct bt_mesh_light_xyl_status *status);
228
248 struct bt_mesh_msg_ctx *ctx,
249 enum bt_mesh_model_status status_code);
250
269 struct bt_mesh_msg_ctx *ctx);
270
272extern const struct bt_mesh_model_op _bt_mesh_light_xyl_srv_op[];
273extern const struct bt_mesh_model_op _bt_mesh_light_xyl_setup_srv_op[];
274extern const struct bt_mesh_model_cb _bt_mesh_light_xyl_srv_cb;
275extern const struct bt_mesh_model_cb _bt_mesh_light_xyl_setup_srv_cb;
278#ifdef __cplusplus
279}
280#endif
281
282#endif /* BT_MESH_LIGHT_XYL_SRV_H__ */
283
int bt_mesh_light_xyl_srv_target_pub(struct bt_mesh_light_xyl_srv *srv, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_light_xyl_status *status)
Publish the current xyL target status.
int bt_mesh_light_xyl_srv_range_pub(struct bt_mesh_light_xyl_srv *srv, struct bt_mesh_msg_ctx *ctx, enum bt_mesh_model_status status_code)
Publish the current xyL Range status.
int bt_mesh_light_xyl_srv_default_pub(struct bt_mesh_light_xyl_srv *srv, struct bt_mesh_msg_ctx *ctx)
Publish the current xyL Default parameter status.
int bt_mesh_light_xyl_srv_pub(struct bt_mesh_light_xyl_srv *srv, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_light_xyl_status *status)
Publish the current xyL status.
bt_mesh_model_status
Definition model_types.h:54
Definition light_xyl.h:73
struct bt_mesh_light_xy params
Definition light_xyl_srv.h:68
struct bt_mesh_model_transition * transition
Definition light_xyl_srv.h:76
Definition light_xyl_srv.h:66
struct bt_mesh_light_xy target
Definition light_xyl_srv.h:84
int32_t remaining_time
Definition light_xyl_srv.h:86
struct bt_mesh_light_xy current
Definition light_xyl_srv.h:82
Definition light_xyl_srv.h:80
Definition light_xyl.h:25
void(*const xy_get)(struct bt_mesh_light_xyl_srv *srv, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_light_xy_status *rsp)
Get the xy state.
Definition light_xyl_srv.h:119
void(*const range_update)(struct bt_mesh_light_xyl_srv *srv, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_xy_range *old_range, const struct bt_mesh_light_xy_range *new_range)
The Range state has changed.
Definition light_xyl_srv.h:130
void(*const xy_set)(struct bt_mesh_light_xyl_srv *srv, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_xy_set *set, struct bt_mesh_light_xy_status *rsp)
Set the xy state.
Definition light_xyl_srv.h:106
void(*const default_update)(struct bt_mesh_light_xyl_srv *srv, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_xy *old_default, const struct bt_mesh_light_xy *new_default)
The Default Parameter state has changed.
Definition light_xyl_srv.h:142
Definition light_xyl_srv.h:90
uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(BT_MESH_LIGHT_XYL_OP_RANGE_STATUS, BT_MESH_LIGHT_XYL_MSG_LEN_RANGE_STATUS)]
Definition light_xyl_srv.h:164
struct bt_mesh_lightness_srv * lightness_srv
Definition light_xyl_srv.h:156
struct bt_mesh_light_xyl_srv::@158 transient
struct net_buf_simple pub_buf
Definition light_xyl_srv.h:160
const struct bt_mesh_light_xyl_srv_handlers * handlers
Definition light_xyl_srv.h:171
struct bt_mesh_model_pub pub
Definition light_xyl_srv.h:158
struct bt_mesh_light_xy_range range
Definition light_xyl_srv.h:169
struct bt_mesh_tid_ctx prev_transaction
Definition light_xyl_srv.h:166
struct bt_mesh_light_xy xy_default
Definition light_xyl_srv.h:173
const struct bt_mesh_model * model
Definition light_xyl_srv.h:154
Definition light_xyl_srv.h:152
Definition light_xyl.h:65
Definition lightness_srv.h:181
Definition model_types.h:37
Definition model_types.h:46
Definition emds.h:46
Definition emds.h:31