Select one of the symbols to view example projects that use it.
 
Outline
#define _LIGHTING_SERVER_H_
#include "mesh/server_common.h"
bt_mesh_light_lightness_state
bt_mesh_light_lightness_srv
bt_mesh_light_lightness_setup_srv
bt_mesh_light_ctl_state
bt_mesh_light_ctl_srv
bt_mesh_light_ctl_setup_srv
bt_mesh_light_ctl_temp_srv
bt_mesh_light_hsl_state
bt_mesh_light_hsl_srv
bt_mesh_light_hsl_setup_srv
bt_mesh_light_hsl_hue_srv
bt_mesh_light_hsl_sat_srv
bt_mesh_light_xyl_state
bt_mesh_light_xyl_srv
bt_mesh_light_xyl_setup_srv
bt_mesh_light_lc_state
bt_mesh_light_lc_property_state
bt_mesh_lc_state
bt_mesh_light_lc_state_machine
bt_mesh_light_control
bt_mesh_light_lc_srv
bt_mesh_light_lc_setup_srv
bt_mesh_light_server_state_change_t
bt_mesh_light_server_recv_get_msg_t
bt_mesh_light_server_recv_set_msg_t
bt_mesh_light_server_recv_status_msg_t
bt_mesh_light_server_lock();
bt_mesh_light_server_unlock();
bt_mesh_get_lc_prop_value(struct bt_mesh_model *, uint16_t);
light_lightness_publish(struct bt_mesh_model *, uint16_t);
light_ctl_publish(struct bt_mesh_model *, uint16_t);
light_hsl_publish(struct bt_mesh_model *, uint16_t);
light_xyl_publish(struct bt_mesh_model *, uint16_t);
light_lc_publish(struct bt_mesh_model *, uint16_t);
Files
ESP-IDF
components
app_trace
app_update
bootloader_support
bt
common
controller
esp_ble_mesh
api
btc
common
core
lib
models
client
common
server
include
mesh
v1.1
host
include
porting
cmock
console
cxx
driver
efuse
esp_adc
esp_app_format
esp_bootloader_format
esp_coex
esp_common
esp_driver_ana_cmpr
esp_driver_cam
esp_driver_dac
esp_driver_gpio
esp_driver_gptimer
esp_driver_i2c
esp_driver_i2s
esp_driver_jpeg
esp_driver_ledc
esp_driver_mcpwm
esp_driver_parlio
esp_driver_pcnt
esp_driver_rmt
esp_driver_sdio
esp_driver_sdm
esp_driver_sdmmc
esp_driver_sdspi
esp_driver_spi
esp_driver_tsens
esp_driver_uart
esp_driver_usb_serial_jtag
esp_eth
esp_event
esp_gdbstub
esp_hid
esp_http_client
esp_http_server
esp_https_ota
esp_https_server
esp_hw_support
esp_lcd
esp_local_ctrl
esp_mm
esp_netif
esp_partition
esp_phy
esp_pm
esp_psram
esp_ringbuf
esp_rom
esp_security
esp_system
esp_timer
esp_vfs_console
esp_wifi
esp-tls
espcoredump
hal
heap
http_parser
ieee802154
log
mqtt
newlib
nvs_flash
nvs_sec_provider
openthread
perfmon
protobuf-c
protocomm
pthread
rt
sdmmc
soc
spi_flash
spiffs
tcp_transport
ulp
unity
vfs
wear_levelling
wifi_provisioning
wpa_supplicant
xtensa
examples
lwIP
FreeRTOS
cJSON
mbedTLS
SourceVuESP-IDF Framework and ExamplesESP-IDFcomponents/bt/esp_ble_mesh/models/server/include/mesh/lighting_server.h
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models * * SPDX-FileCopyrightText: 2018 Vikrant More * SPDX-FileContributor: 2018-2021 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 *//* ... */ #ifndef _LIGHTING_SERVER_H_ #define _LIGHTING_SERVER_H_ #include "mesh/server_common.h" #ifdef __cplusplus extern "C" { #endif struct bt_mesh_light_lightness_state { uint16_t lightness_linear; uint16_t target_lightness_linear; uint16_t lightness_actual; uint16_t target_lightness_actual; uint16_t lightness_last; uint16_t lightness_default; uint8_t status_code; uint16_t lightness_range_min; uint16_t lightness_range_max; }{ ... }; struct bt_mesh_light_lightness_srv { struct bt_mesh_model *model; struct bt_mesh_server_rsp_ctrl rsp_ctrl; struct bt_mesh_light_lightness_state *state; struct bt_mesh_last_msg_info last; struct bt_mesh_state_transition actual_transition; struct bt_mesh_state_transition linear_transition; int32_t tt_delta_lightness_actual; int32_t tt_delta_lightness_linear; }{ ... }; struct bt_mesh_light_lightness_setup_srv { struct bt_mesh_model *model; struct bt_mesh_server_rsp_ctrl rsp_ctrl; struct bt_mesh_light_lightness_state *state; }{ ... }; struct bt_mesh_light_ctl_state { uint16_t lightness; uint16_t target_lightness; uint16_t temperature; uint16_t target_temperature; int16_t delta_uv; int16_t target_delta_uv; uint8_t status_code; uint16_t temperature_range_min; uint16_t temperature_range_max; uint16_t lightness_default; uint16_t temperature_default; int16_t delta_uv_default; }{ ... }; struct bt_mesh_light_ctl_srv { struct bt_mesh_model *model; struct bt_mesh_server_rsp_ctrl rsp_ctrl; struct bt_mesh_light_ctl_state *state; struct bt_mesh_last_msg_info last; struct bt_mesh_state_transition transition; int32_t tt_delta_lightness; int32_t tt_delta_temperature; int32_t tt_delta_delta_uv; }{ ... }; struct bt_mesh_light_ctl_setup_srv { struct bt_mesh_model *model; struct bt_mesh_server_rsp_ctrl rsp_ctrl; struct bt_mesh_light_ctl_state *state; }{ ... }; struct bt_mesh_light_ctl_temp_srv { struct bt_mesh_model *model; struct bt_mesh_server_rsp_ctrl rsp_ctrl; struct bt_mesh_light_ctl_state *state; struct bt_mesh_last_msg_info last; struct bt_mesh_state_transition transition; int32_t tt_delta_temperature; int32_t tt_delta_delta_uv; }{ ... }; struct bt_mesh_light_hsl_state { uint16_t lightness; uint16_t target_lightness; uint16_t hue; uint16_t target_hue; uint16_t saturation; uint16_t target_saturation; uint16_t lightness_default; uint16_t hue_default; uint16_t saturation_default; uint8_t status_code; uint16_t hue_range_min; uint16_t hue_range_max; uint16_t saturation_range_min; uint16_t saturation_range_max; }{ ... }; struct bt_mesh_light_hsl_srv { struct bt_mesh_model *model; struct bt_mesh_server_rsp_ctrl rsp_ctrl; struct bt_mesh_light_hsl_state *state; struct bt_mesh_last_msg_info last; struct bt_mesh_state_transition transition; int32_t tt_delta_lightness; int32_t tt_delta_hue; int32_t tt_delta_saturation; }{ ... }; struct bt_mesh_light_hsl_setup_srv { struct bt_mesh_model *model; struct bt_mesh_server_rsp_ctrl rsp_ctrl; struct bt_mesh_light_hsl_state *state; }{ ... }; struct bt_mesh_light_hsl_hue_srv { struct bt_mesh_model *model; struct bt_mesh_server_rsp_ctrl rsp_ctrl; struct bt_mesh_light_hsl_state *state; struct bt_mesh_last_msg_info last; struct bt_mesh_state_transition transition; int32_t tt_delta_hue; }{ ... }; struct bt_mesh_light_hsl_sat_srv { struct bt_mesh_model *model; struct bt_mesh_server_rsp_ctrl rsp_ctrl; struct bt_mesh_light_hsl_state *state; struct bt_mesh_last_msg_info last; struct bt_mesh_state_transition transition; int32_t tt_delta_saturation; }{ ... }; struct bt_mesh_light_xyl_state { uint16_t lightness; uint16_t target_lightness; uint16_t x; uint16_t target_x; uint16_t y; uint16_t target_y; uint16_t lightness_default; uint16_t x_default; uint16_t y_default; uint8_t status_code; uint16_t x_range_min; uint16_t x_range_max; uint16_t y_range_min; uint16_t y_range_max; }{ ... }; struct bt_mesh_light_xyl_srv { struct bt_mesh_model *model; struct bt_mesh_server_rsp_ctrl rsp_ctrl; struct bt_mesh_light_xyl_state *state; struct bt_mesh_last_msg_info last; struct bt_mesh_state_transition transition; int32_t tt_delta_lightness; int32_t tt_delta_x; int32_t tt_delta_y; }{ ... }; struct bt_mesh_light_xyl_setup_srv { struct bt_mesh_model *model; struct bt_mesh_server_rsp_ctrl rsp_ctrl; struct bt_mesh_light_xyl_state *state; }{ ... }; struct bt_mesh_light_lc_state { uint32_t mode : 1, /* default 0 */ occupancy_mode : 1, /* default 1 */ light_onoff : 1, target_light_onoff : 1, occupancy : 1, ambient_luxlevel : 24; /* 0x000000 ~ 0xFFFFFF */ uint16_t linear_output; /* 0x0000 ~ 0xFFFF */ }{ ... }; struct bt_mesh_light_lc_property_state { uint32_t time_occupancy_delay; /* 0x003A */ uint32_t time_fade_on; /* 0x0037 */ uint32_t time_run_on; /* 0x003C */ uint32_t time_fade; /* 0x0036 */ uint32_t time_prolong; /* 0x003B */ uint32_t time_fade_standby_auto; /* 0x0038 */ uint32_t time_fade_standby_manual; /* 0x0039 */ uint16_t lightness_on; /* 0x002E */ uint16_t lightness_prolong; /* 0x002F */ uint16_t lightness_standby; /* 0x0030 */ uint16_t ambient_luxlevel_on; /* 0x002B, 0x0000 ~ 0xFFFF */ uint16_t ambient_luxlevel_prolong; /* 0x002C, 0x0000 ~ 0xFFFF */ uint16_t ambient_luxlevel_standby; /* 0x002D, 0x0000 ~ 0xFFFF */ float regulator_kiu; /* 0x0033, 0.0 ~ 1000.0, default 250.0 */ float regulator_kid; /* 0x0032, 0.0 ~ 1000.0, default 25.0 */ float regulator_kpu; /* 0x0035, 0.0 ~ 1000.0, default 80.0 */ float regulator_kpd; /* 0x0034, 0.0 ~ 1000.0, default 80.0 */ int8_t regulator_accuracy; /* 0x0031, 0.0 ~ 100.0, default 2.0 */ uint32_t set_occupancy_to_1_delay; }{ ... }; typedef enum { LC_OFF, LC_STANDBY, LC_FADE_ON, LC_RUN, LC_FADE, LC_PROLONG, LC_FADE_STANDBY_AUTO, LC_FADE_STANDBY_MANUAL, }{ ... } bt_mesh_lc_state; struct bt_mesh_light_lc_state_machine { struct { uint8_t fade_on; uint8_t fade; uint8_t fade_standby_auto; uint8_t fade_standby_manual; }{ ... } trans_time; bt_mesh_lc_state state; struct k_delayed_work timer; }{ ... }; struct bt_mesh_light_control { struct bt_mesh_light_lc_state state; struct bt_mesh_light_lc_property_state prop_state; struct bt_mesh_light_lc_state_machine state_machine; }{ ... }; struct bt_mesh_light_lc_srv { struct bt_mesh_model *model; struct bt_mesh_server_rsp_ctrl rsp_ctrl; struct bt_mesh_light_control *lc; struct bt_mesh_last_msg_info last; struct bt_mesh_state_transition transition; }{ ... }; struct bt_mesh_light_lc_setup_srv { struct bt_mesh_model *model; struct bt_mesh_server_rsp_ctrl rsp_ctrl; struct bt_mesh_light_control *lc; }{ ... }; typedef union { struct { uint16_t lightness; }{ ... } lightness_set; struct { uint16_t lightness; }{ ... } lightness_linear_set; struct { uint16_t lightness; }{ ... } lightness_default_set; struct { uint16_t range_min; uint16_t range_max; }{ ... } lightness_range_set; struct { uint16_t lightness; uint16_t temperature; int16_t delta_uv; }{ ... } ctl_set; struct { uint16_t temperature; int16_t delta_uv; }{ ... } ctl_temp_set; struct { uint16_t range_min; uint16_t range_max; }{ ... } ctl_temp_range_set; struct { uint16_t lightness; uint16_t temperature; int16_t delta_uv; }{ ... } ctl_default_set; struct { uint16_t lightness; uint16_t hue; uint16_t saturation; }{ ... } hsl_set; struct { uint16_t hue; }{ ... } hsl_hue_set; struct { uint16_t saturation; }{ ... } hsl_saturation_set; struct { uint16_t lightness; uint16_t hue; uint16_t saturation; }{ ... } hsl_default_set; struct { uint16_t hue_range_min; uint16_t hue_range_max; uint16_t sat_range_min; uint16_t sat_range_max; }{ ... } hsl_range_set; struct { uint16_t lightness; uint16_t x; uint16_t y; }{ ... } xyl_set; struct { uint16_t lightness; uint16_t x; uint16_t y; }{ ... } xyl_default_set; struct { uint16_t x_range_min; uint16_t x_range_max; uint16_t y_range_min; uint16_t y_range_max; }{ ... } xyl_range_set; struct { uint8_t mode; }{ ... } lc_mode_set; struct { uint8_t mode; }{ ... } lc_om_set; struct { uint8_t onoff; }{ ... } lc_light_onoff_set; struct { uint16_t id; struct net_buf_simple *value; }{ ... } lc_property_set; struct { uint16_t property_id; union { uint8_t occupancy; uint32_t set_occupancy_to_1_delay; uint32_t ambient_luxlevel; }{ ... } state; }{ ... } sensor_status; }{ ... } bt_mesh_light_server_state_change_t; typedef union { struct { uint16_t id; }{ ... } lc_property_get; }{ ... } bt_mesh_light_server_recv_get_msg_t; typedef union { struct { bool op_en; uint16_t lightness; uint8_t tid; uint8_t trans_time; uint8_t delay; }{ ... } lightness_set; struct { bool op_en; uint16_t lightness; uint8_t tid; uint8_t trans_time; uint8_t delay; }{ ... } lightness_linear_set; struct { uint16_t lightness; }{ ... } lightness_default_set; struct { uint16_t range_min; uint16_t range_max; }{ ... } lightness_range_set; struct { bool op_en; uint16_t lightness; uint16_t temperature; int16_t delta_uv; uint8_t tid; uint8_t trans_time; uint8_t delay; }{ ... } ctl_set; struct { bool op_en; uint16_t temperature; int16_t delta_uv; uint8_t tid; uint8_t trans_time; uint8_t delay; }{ ... } ctl_temp_set; struct { uint16_t range_min; uint16_t range_max; }{ ... } ctl_temp_range_set; struct { uint16_t lightness; uint16_t temperature; int16_t delta_uv; }{ ... } ctl_default_set; struct { bool op_en; uint16_t lightness; uint16_t hue; uint16_t saturation; uint8_t tid; uint8_t trans_time; uint8_t delay; }{ ... } hsl_set; struct { bool op_en; uint16_t hue; uint8_t tid; uint8_t trans_time; uint8_t delay; }{ ... } hsl_hue_set; struct { bool op_en; uint16_t saturation; uint8_t tid; uint8_t trans_time; uint8_t delay; }{ ... } hsl_saturation_set; struct { uint16_t lightness; uint16_t hue; uint16_t saturation; }{ ... } hsl_default_set; struct { uint16_t hue_range_min; uint16_t hue_range_max; uint16_t sat_range_min; uint16_t sat_range_max; }{ ... } hsl_range_set; struct { bool op_en; uint16_t lightness; uint16_t x; uint16_t y; uint8_t tid; uint8_t trans_time; uint8_t delay; }{ ... } xyl_set; struct { uint16_t lightness; uint16_t x; uint16_t y; }{ ... } xyl_default_set; struct { uint16_t x_range_min; uint16_t x_range_max; uint16_t y_range_min; uint16_t y_range_max; }{ ... } xyl_range_set; struct { uint8_t mode; }{ ... } lc_mode_set; struct { uint8_t mode; }{ ... } lc_om_set; struct { bool op_en; uint8_t light_onoff; uint8_t tid; uint8_t trans_time; uint8_t delay; }{ ... } lc_light_onoff_set; struct { uint16_t id; struct net_buf_simple *value; }{ ... } lc_property_set; }{ ... } bt_mesh_light_server_recv_set_msg_t; typedef union { struct { struct net_buf_simple *data; }{ ... } sensor_status; }{ ... } bt_mesh_light_server_recv_status_msg_t; void bt_mesh_light_server_lock(void); void bt_mesh_light_server_unlock(void); uint8_t *bt_mesh_get_lc_prop_value(struct bt_mesh_model *model, uint16_t prop_id); void light_lightness_publish(struct bt_mesh_model *model, uint16_t opcode); void light_ctl_publish(struct bt_mesh_model *model, uint16_t opcode); void light_hsl_publish(struct bt_mesh_model *model, uint16_t opcode); void light_xyl_publish(struct bt_mesh_model *model, uint16_t opcode); void light_lc_publish(struct bt_mesh_model *model, uint16_t opcode); #ifdef __cplusplus }{...} #endif /* ... */ #endif /* _LIGHTING_SERVER_H_ */
Details
Show:
from
Types: Columns:
This file uses the notable symbols shown below. Click anywhere in the file to view more details.