nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches
light_hsl_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_HSL_SRV_H__
15#define BT_MESH_LIGHT_HSL_SRV_H__
16
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
28
37#define BT_MESH_LIGHT_HSL_SRV_INIT(_lightness_srv, _hue_handlers, _sat_handlers) \
38 { \
39 .lightness = _lightness_srv, \
40 .hue = BT_MESH_LIGHT_HUE_SRV_INIT(_hue_handlers), \
41 .sat = BT_MESH_LIGHT_SAT_SRV_INIT(_sat_handlers), \
42 }
43
53#define BT_MESH_MODEL_LIGHT_HSL_SRV(_srv, ...) \
54 BT_MESH_MODEL_METADATA_CB(BT_MESH_MODEL_ID_LIGHT_HSL_SRV, \
55 _bt_mesh_light_hsl_srv_op, &(_srv)->pub, \
56 BT_MESH_MODEL_USER_DATA(struct bt_mesh_light_hsl_srv, \
57 _srv), \
58 &_bt_mesh_light_hsl_srv_cb, __VA_ARGS__), \
59 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_LIGHT_HSL_SETUP_SRV, \
60 _bt_mesh_light_hsl_setup_srv_op, NULL, \
61 BT_MESH_MODEL_USER_DATA(struct bt_mesh_light_hsl_srv, \
62 _srv), \
63 &_bt_mesh_light_hsl_setup_srv_cb)
64
66#define BT_MESH_LIGHT_HSL_HUE_RANGE_METADATA_ID 0x0005
67
69#define BT_MESH_LIGHT_HSL_SAT_RANGE_METADATA_ID 0x0006
70
77#define BT_MESH_LIGHT_HSL_HUE_RANGE_METADATA(range_min, range_max) \
78 BT_MESH_MODELS_METADATA_ENTRY(4, BT_MESH_LIGHT_HSL_HUE_RANGE_METADATA_ID, \
79 ((uint16_t[]){(range_min), (range_max)}))
80
87#define BT_MESH_LIGHT_HSL_SAT_RANGE_METADATA(range_min, range_max) \
88 BT_MESH_MODELS_METADATA_ENTRY(4, BT_MESH_LIGHT_HSL_SAT_RANGE_METADATA_ID, \
89 ((uint16_t[]){(range_min), (range_max)}))
90
101
103 const struct bt_mesh_model *model;
105 struct bt_mesh_model_pub pub;
107 struct net_buf_simple buf;
109 uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(
110 BT_MESH_LIGHT_HSL_OP_STATUS,
111 BT_MESH_LIGHT_HSL_MSG_MAXLEN_STATUS)];
119};
120
140 struct bt_mesh_msg_ctx *ctx,
141 const struct bt_mesh_light_hsl_status *status);
142
144extern const struct bt_mesh_model_op _bt_mesh_light_hsl_srv_op[];
145extern const struct bt_mesh_model_op _bt_mesh_light_hsl_setup_srv_op[];
146extern const struct bt_mesh_model_cb _bt_mesh_light_hsl_srv_cb;
147extern const struct bt_mesh_model_cb _bt_mesh_light_hsl_setup_srv_cb;
150#ifdef __cplusplus
151}
152#endif
153
154#endif /* BT_MESH_LIGHT_HSL_SRV_H__ */
155
int bt_mesh_light_hsl_srv_pub(struct bt_mesh_light_hsl_srv *srv, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_hsl_status *status)
Publish the current HSL status.
struct bt_mesh_light_sat_srv sat
Definition light_hsl_srv.h:98
struct bt_mesh_model_pub pub
Definition light_hsl_srv.h:105
struct bt_mesh_light_hue_srv hue
Definition light_hsl_srv.h:96
struct bt_mesh_tid_ctx prev_transaction
Definition light_hsl_srv.h:118
const struct bt_mesh_model * model
Definition light_hsl_srv.h:103
struct net_buf_simple buf
Definition light_hsl_srv.h:107
struct bt_mesh_lightness_srv * lightness
Definition light_hsl_srv.h:100
uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(BT_MESH_LIGHT_HSL_OP_STATUS, BT_MESH_LIGHT_HSL_MSG_MAXLEN_STATUS)]
Definition light_hsl_srv.h:111
bool pub_pending
Definition light_hsl_srv.h:116
Definition light_hsl_srv.h:94
Definition light_hsl.h:80
Definition light_hue_srv.h:157
Definition light_sat_srv.h:127
Definition lightness_srv.h:181
Definition model_types.h:46