nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
light_hue_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_HUE_SRV_H__
15#define BT_MESH_LIGHT_HUE_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_HUE_SRV_INIT(_handlers) \
38 { \
39 .handlers = _handlers, \
40 .lvl = BT_MESH_LVL_SRV_INIT( \
41 &_bt_mesh_light_hue_srv_lvl_handlers), \
42 .range = BT_MESH_LIGHT_HSL_OP_RANGE_DEFAULT, \
43 }
44
51#define BT_MESH_MODEL_LIGHT_HUE_SRV(_srv) \
52 BT_MESH_MODEL_LVL_SRV(&(_srv)->lvl), \
53 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_LIGHT_HSL_HUE_SRV, \
54 _bt_mesh_light_hue_srv_op, &(_srv)->pub, \
55 BT_MESH_MODEL_USER_DATA(struct bt_mesh_light_hue_srv, \
56 _srv), \
57 &_bt_mesh_light_hue_srv_cb)
58
83 void (*const set)(struct bt_mesh_light_hue_srv *srv,
84 struct bt_mesh_msg_ctx *ctx,
85 const struct bt_mesh_light_hue *set,
86 struct bt_mesh_light_hue_status *rsp);
87
108 void (*const move_set)(struct bt_mesh_light_hue_srv *srv,
109 struct bt_mesh_msg_ctx *ctx,
110 const struct bt_mesh_light_hue_move *move,
111 struct bt_mesh_light_hue_status *rsp);
112
121 void (*const get)(struct bt_mesh_light_hue_srv *srv,
122 struct bt_mesh_msg_ctx *ctx,
123 struct bt_mesh_light_hue_status *rsp);
124
133 void (*const default_update)(struct bt_mesh_light_hue_srv *srv,
134 struct bt_mesh_msg_ctx *ctx,
135 uint16_t old_default,
136 uint16_t new_default);
137
146 void (*const range_update)(
147 struct bt_mesh_light_hue_srv *srv,
148 struct bt_mesh_msg_ctx *ctx,
149 const struct bt_mesh_light_hsl_range *old_range,
150 const struct bt_mesh_light_hsl_range *new_range);
151};
152
162
164 const struct bt_mesh_model *model;
170 struct bt_mesh_model_pub pub;
172 struct net_buf_simple buf;
174 uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(
175 BT_MESH_LIGHT_HUE_OP_STATUS,
176 BT_MESH_LIGHT_HSL_MSG_MAXLEN_HUE_STATUS)];
179
183 uint16_t dflt;
184 struct __packed {
186 uint16_t last;
188
189#if IS_ENABLED(CONFIG_EMDS) && IS_ENABLED(CONFIG_BT_SETTINGS)
192#endif
193};
194
214 struct bt_mesh_msg_ctx *ctx,
215 const struct bt_mesh_light_hue_status *status);
216
218extern const struct bt_mesh_model_op _bt_mesh_light_hue_srv_op[];
219extern const struct bt_mesh_model_cb _bt_mesh_light_hue_srv_cb;
220extern const struct bt_mesh_lvl_srv_handlers
221 _bt_mesh_light_hue_srv_lvl_handlers;
224#ifdef __cplusplus
225}
226#endif
227
228#endif /* BT_MESH_LIGHT_HUE_SRV_H__ */
229
int bt_mesh_light_hue_srv_pub(struct bt_mesh_light_hue_srv *srv, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_hue_status *status)
Publish the current HSL Hue status.
Definition: light_hsl.h:147
Definition: light_hsl_srv.h:94
Definition: light_hsl.h:64
void(*const default_update)(struct bt_mesh_light_hue_srv *srv, struct bt_mesh_msg_ctx *ctx, uint16_t old_default, uint16_t new_default)
The default hue has been updated.
Definition: light_hue_srv.h:133
void(*const move_set)(struct bt_mesh_light_hue_srv *srv, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_hue_move *move, struct bt_mesh_light_hue_status *rsp)
Move the hue continuously at a certain rate.
Definition: light_hue_srv.h:108
void(*const range_update)(struct bt_mesh_light_hue_srv *srv, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_hsl_range *old_range, const struct bt_mesh_light_hsl_range *new_range)
The valid hue range has been updated.
Definition: light_hue_srv.h:146
void(*const set)(struct bt_mesh_light_hue_srv *srv, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_hue *set, struct bt_mesh_light_hue_status *rsp)
Set the Hue state.
Definition: light_hue_srv.h:83
void(*const get)(struct bt_mesh_light_hue_srv *srv, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_light_hue_status *rsp)
Get the Hue state.
Definition: light_hue_srv.h:121
Definition: light_hue_srv.h:60
struct bt_mesh_lvl_srv lvl
Definition: light_hue_srv.h:159
const struct bt_mesh_light_hue_srv_handlers * handlers
Definition: light_hue_srv.h:161
struct bt_mesh_light_hsl_range range
Definition: light_hue_srv.h:181
const struct bt_mesh_light_hsl_srv * hsl
Definition: light_hue_srv.h:168
uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(BT_MESH_LIGHT_HUE_OP_STATUS, BT_MESH_LIGHT_HSL_MSG_MAXLEN_HUE_STATUS)]
Definition: light_hue_srv.h:176
struct bt_mesh_model_pub pub
Definition: light_hue_srv.h:170
struct net_buf_simple buf
Definition: light_hue_srv.h:172
struct bt_mesh_light_hue_srv::@152 transient
struct bt_mesh_tid_ctx prev_transaction
Definition: light_hue_srv.h:178
uint16_t dflt
Definition: light_hue_srv.h:183
uint16_t last
Definition: light_hue_srv.h:186
const struct bt_mesh_model * model
Definition: light_hue_srv.h:164
Definition: light_hue_srv.h:157
Definition: light_hsl.h:127
Definition: light_hsl.h:88
Definition: gen_lvl_srv.h:52
Definition: gen_lvl_srv.h:143
Definition: model_types.h:46
Definition: emds.h:46
Definition: emds.h:31