nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
light_hsl.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_H__
15#define BT_MESH_LIGHT_HSL_H__
16
17#include <zephyr/bluetooth/mesh.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24#define BT_MESH_LIGHT_HSL_MIN 0
25#define BT_MESH_LIGHT_HSL_MAX UINT16_MAX
26#define BT_MESH_LIGHT_HSL_OP_RANGE_DEFAULT \
27 { \
28 .min = BT_MESH_LIGHT_HSL_MIN, .max = BT_MESH_LIGHT_HSL_MAX, \
29 }
30
34 uint16_t lightness;
36 uint16_t hue;
38 uint16_t saturation;
39};
40
44 uint16_t hue;
46 uint16_t saturation;
47};
48
61};
62
66 int16_t delta;
77};
78
85};
86
90 uint16_t lvl;
110};
111
115 uint16_t lvl;
124};
125
129 uint16_t current;
131 uint16_t target;
134};
135
139 uint16_t current;
141 uint16_t target;
144};
145
149 uint16_t min;
151 uint16_t max;
152};
153
160};
161
168};
169
183 enum bt_mesh_rgb_ch ch);
184
186#define BT_MESH_LIGHT_HSL_OP_GET BT_MESH_MODEL_OP_2(0x82, 0x6D)
187#define BT_MESH_LIGHT_HUE_OP_GET BT_MESH_MODEL_OP_2(0x82, 0x6E)
188#define BT_MESH_LIGHT_HUE_OP_SET BT_MESH_MODEL_OP_2(0x82, 0x6F)
189#define BT_MESH_LIGHT_HUE_OP_SET_UNACK BT_MESH_MODEL_OP_2(0x82, 0x70)
190#define BT_MESH_LIGHT_HUE_OP_STATUS BT_MESH_MODEL_OP_2(0x82, 0x71)
191#define BT_MESH_LIGHT_SAT_OP_GET BT_MESH_MODEL_OP_2(0x82, 0x72)
192#define BT_MESH_LIGHT_SAT_OP_SET BT_MESH_MODEL_OP_2(0x82, 0x73)
193#define BT_MESH_LIGHT_SAT_OP_SET_UNACK BT_MESH_MODEL_OP_2(0x82, 0x74)
194#define BT_MESH_LIGHT_SAT_OP_STATUS BT_MESH_MODEL_OP_2(0x82, 0x75)
195#define BT_MESH_LIGHT_HSL_OP_SET BT_MESH_MODEL_OP_2(0x82, 0x76)
196#define BT_MESH_LIGHT_HSL_OP_SET_UNACK BT_MESH_MODEL_OP_2(0x82, 0x77)
197#define BT_MESH_LIGHT_HSL_OP_STATUS BT_MESH_MODEL_OP_2(0x82, 0x78)
198#define BT_MESH_LIGHT_HSL_OP_TARGET_GET BT_MESH_MODEL_OP_2(0x82, 0x79)
199#define BT_MESH_LIGHT_HSL_OP_TARGET_STATUS BT_MESH_MODEL_OP_2(0x82, 0x7A)
200#define BT_MESH_LIGHT_HSL_OP_DEFAULT_GET BT_MESH_MODEL_OP_2(0x82, 0x7B)
201#define BT_MESH_LIGHT_HSL_OP_DEFAULT_STATUS BT_MESH_MODEL_OP_2(0x82, 0x7C)
202#define BT_MESH_LIGHT_HSL_OP_RANGE_GET BT_MESH_MODEL_OP_2(0x82, 0x7D)
203#define BT_MESH_LIGHT_HSL_OP_RANGE_STATUS BT_MESH_MODEL_OP_2(0x82, 0x7E)
204#define BT_MESH_LIGHT_HSL_OP_DEFAULT_SET BT_MESH_MODEL_OP_2(0x82, 0x7F)
205#define BT_MESH_LIGHT_HSL_OP_DEFAULT_SET_UNACK BT_MESH_MODEL_OP_2(0x82, 0x80)
206#define BT_MESH_LIGHT_HSL_OP_RANGE_SET BT_MESH_MODEL_OP_2(0x82, 0x81)
207#define BT_MESH_LIGHT_HSL_OP_RANGE_SET_UNACK BT_MESH_MODEL_OP_2(0x82, 0x82)
208
209#define BT_MESH_LIGHT_HSL_MSG_LEN_GET 0
210#define BT_MESH_LIGHT_HSL_MSG_MINLEN_SET 7
211#define BT_MESH_LIGHT_HSL_MSG_MAXLEN_SET 9
212#define BT_MESH_LIGHT_HSL_MSG_MINLEN_STATUS 6
213#define BT_MESH_LIGHT_HSL_MSG_MAXLEN_STATUS 7
214#define BT_MESH_LIGHT_HSL_MSG_MINLEN_HUE 3
215#define BT_MESH_LIGHT_HSL_MSG_MAXLEN_HUE 5
216#define BT_MESH_LIGHT_HSL_MSG_MINLEN_HUE_STATUS 2
217#define BT_MESH_LIGHT_HSL_MSG_MAXLEN_HUE_STATUS 5
218#define BT_MESH_LIGHT_HSL_MSG_MINLEN_SAT 3
219#define BT_MESH_LIGHT_HSL_MSG_MAXLEN_SAT 5
220#define BT_MESH_LIGHT_HSL_MSG_MINLEN_SAT_STATUS 2
221#define BT_MESH_LIGHT_HSL_MSG_MAXLEN_SAT_STATUS 5
222#define BT_MESH_LIGHT_HSL_MSG_LEN_DEFAULT 6
223#define BT_MESH_LIGHT_HSL_MSG_LEN_RANGE_SET 8
224#define BT_MESH_LIGHT_HSL_MSG_LEN_RANGE_STATUS 9
225
228#ifdef __cplusplus
229}
230#endif
231
232#endif /* BT_MESH_LIGHT_HSL_H__ */
233
uint16_t bt_mesh_light_hsl_to_rgb(const struct bt_mesh_light_hsl *hsl, enum bt_mesh_rgb_ch ch)
Convert HSL to a 16 bit RGB channel value.
bt_mesh_rgb_ch
Definition: model_types.h:66
bt_mesh_model_status
Definition: model_types.h:54
const struct bt_mesh_model_transition * transition
Definition: light_hsl.h:60
struct bt_mesh_light_hsl params
Definition: light_hsl.h:52
Definition: light_hsl.h:50
enum bt_mesh_model_status status_code
Definition: light_hsl.h:165
struct bt_mesh_light_hue_sat_range range
Definition: light_hsl.h:167
Definition: light_hsl.h:163
uint16_t max
Definition: light_hsl.h:151
uint16_t min
Definition: light_hsl.h:149
Definition: light_hsl.h:147
struct bt_mesh_light_hsl params
Definition: light_hsl.h:82
int32_t remaining_time
Definition: light_hsl.h:84
Definition: light_hsl.h:80
uint16_t lightness
Definition: light_hsl.h:34
uint16_t hue
Definition: light_hsl.h:36
uint16_t saturation
Definition: light_hsl.h:38
Definition: light_hsl.h:32
int16_t delta
Definition: light_hsl.h:66
const struct bt_mesh_model_transition * transition
Definition: light_hsl.h:76
Definition: light_hsl.h:64
struct bt_mesh_light_hue_sat min
Definition: light_hsl.h:157
struct bt_mesh_light_hue_sat max
Definition: light_hsl.h:159
Definition: light_hsl.h:155
uint16_t hue
Definition: light_hsl.h:44
uint16_t saturation
Definition: light_hsl.h:46
Definition: light_hsl.h:42
uint16_t target
Definition: light_hsl.h:131
int32_t remaining_time
Definition: light_hsl.h:133
uint16_t current
Definition: light_hsl.h:129
Definition: light_hsl.h:127
int direction
Definition: light_hsl.h:109
uint16_t lvl
Definition: light_hsl.h:90
const struct bt_mesh_model_transition * transition
Definition: light_hsl.h:98
Definition: light_hsl.h:88
uint16_t target
Definition: light_hsl.h:141
uint16_t current
Definition: light_hsl.h:139
int32_t remaining_time
Definition: light_hsl.h:143
Definition: light_hsl.h:137
const struct bt_mesh_model_transition * transition
Definition: light_hsl.h:123
uint16_t lvl
Definition: light_hsl.h:115
Definition: light_hsl.h:113
Definition: model_types.h:37