-
Notifications
You must be signed in to change notification settings - Fork 7.2k
/
esp_ble_mesh_lighting_model_api.h
1675 lines (1499 loc) · 91.2 KB
/
esp_ble_mesh_lighting_model_api.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
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/** @file
* @brief Bluetooth Mesh Light Client Model APIs.
*/
#ifndef _ESP_BLE_MESH_LIGHTING_MODEL_API_H_
#define _ESP_BLE_MESH_LIGHTING_MODEL_API_H_
#include "esp_ble_mesh_defs.h"
/** @def ESP_BLE_MESH_MODEL_LIGHT_LIGHTNESS_CLI
*
* @brief Define a new Light Lightness Client Model.
*
* @note This API needs to be called for each element on which
* the application needs to have a Light Lightness Client Model.
*
* @param cli_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param cli_data Pointer to the unique struct esp_ble_mesh_client_t.
*
* @return New Light Lightness Client Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_LIGHTNESS_CLI(cli_pub, cli_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_LIGHTNESS_CLI, \
NULL, cli_pub, cli_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_CTL_CLI
*
* @brief Define a new Light CTL Client Model.
*
* @note This API needs to be called for each element on which
* the application needs to have a Light CTL Client Model.
*
* @param cli_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param cli_data Pointer to the unique struct esp_ble_mesh_client_t.
*
* @return New Light CTL Client Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_CTL_CLI(cli_pub, cli_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_CTL_CLI, \
NULL, cli_pub, cli_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_HSL_CLI
*
* @brief Define a new Light HSL Client Model.
*
* @note This API needs to be called for each element on which
* the application needs to have a Light HSL Client Model.
*
* @param cli_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param cli_data Pointer to the unique struct esp_ble_mesh_client_t.
*
* @return New Light HSL Client Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_HSL_CLI(cli_pub, cli_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_HSL_CLI, \
NULL, cli_pub, cli_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_XYL_CLI
*
* @brief Define a new Light xyL Client Model.
*
* @note This API needs to be called for each element on which
* the application needs to have a Light xyL Client Model.
*
* @param cli_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param cli_data Pointer to the unique struct esp_ble_mesh_client_t.
*
* @return New Light xyL Client Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_XYL_CLI(cli_pub, cli_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_XYL_CLI, \
NULL, cli_pub, cli_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_LC_CLI
*
* @brief Define a new Light LC Client Model.
*
* @note This API needs to be called for each element on which
* the application needs to have a Light LC Client Model.
*
* @param cli_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param cli_data Pointer to the unique struct esp_ble_mesh_client_t.
*
* @return New Light LC Client Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_LC_CLI(cli_pub, cli_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_LC_CLI, \
NULL, cli_pub, cli_data)
/**
* @brief Bluetooth Mesh Light Lightness Client Model Get and Set parameters structure.
*/
/** Parameters of Light Lightness Set */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t lightness; /*!< Target value of light lightness actual state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_light_lightness_set_t;
/** Parameters of Light Lightness Linear Set */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t lightness; /*!< Target value of light lightness linear state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_light_lightness_linear_set_t;
/** Parameter of Light Lightness Default Set */
typedef struct {
uint16_t lightness; /*!< The value of the Light Lightness Default state */
} esp_ble_mesh_light_lightness_default_set_t;
/** Parameters of Light Lightness Range Set */
typedef struct {
uint16_t range_min; /*!< Value of range min field of light lightness range state */
uint16_t range_max; /*!< Value of range max field of light lightness range state */
} esp_ble_mesh_light_lightness_range_set_t;
/** Parameters of Light CTL Set */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t ctl_lightness; /*!< Target value of light ctl lightness state */
uint16_t ctl_temperatrue; /*!< Target value of light ctl temperature state */
int16_t ctl_delta_uv; /*!< Target value of light ctl delta UV state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_light_ctl_set_t;
/** Parameters of Light CTL Temperature Set */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t ctl_temperatrue; /*!< Target value of light ctl temperature state */
int16_t ctl_delta_uv; /*!< Target value of light ctl delta UV state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_light_ctl_temperature_set_t;
/** Parameters of Light CTL Temperature Range Set */
typedef struct {
uint16_t range_min; /*!< Value of temperature range min field of light ctl temperature range state */
uint16_t range_max; /*!< Value of temperature range max field of light ctl temperature range state */
} esp_ble_mesh_light_ctl_temperature_range_set_t;
/** Parameters of Light CTL Default Set */
typedef struct {
uint16_t lightness; /*!< Value of light lightness default state */
uint16_t temperature; /*!< Value of light temperature default state */
int16_t delta_uv; /*!< Value of light delta UV default state */
} esp_ble_mesh_light_ctl_default_set_t;
/** Parameters of Light HSL Set */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t hsl_lightness; /*!< Target value of light hsl lightness state */
uint16_t hsl_hue; /*!< Target value of light hsl hue state */
uint16_t hsl_saturation; /*!< Target value of light hsl saturation state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_light_hsl_set_t;
/** Parameters of Light HSL Hue Set */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t hue; /*!< Target value of light hsl hue state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_light_hsl_hue_set_t;
/** Parameters of Light HSL Saturation Set */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t saturation; /*!< Target value of light hsl hue state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_light_hsl_saturation_set_t;
/** Parameters of Light HSL Default Set */
typedef struct {
uint16_t lightness; /*!< Value of light lightness default state */
uint16_t hue; /*!< Value of light hue default state */
uint16_t saturation; /*!< Value of light saturation default state */
} esp_ble_mesh_light_hsl_default_set_t;
/** Parameters of Light HSL Range Set */
typedef struct {
uint16_t hue_range_min; /*!< Value of hue range min field of light hsl hue range state */
uint16_t hue_range_max; /*!< Value of hue range max field of light hsl hue range state */
uint16_t saturation_range_min; /*!< Value of saturation range min field of light hsl saturation range state */
uint16_t saturation_range_max; /*!< Value of saturation range max field of light hsl saturation range state */
} esp_ble_mesh_light_hsl_range_set_t;
/** Parameters of Light xyL Set */
typedef struct {
bool op_en; /*!< Indicate whether optional parameters included */
uint16_t xyl_lightness; /*!< The target value of the Light xyL Lightness state */
uint16_t xyl_x; /*!< The target value of the Light xyL x state */
uint16_t xyl_y; /*!< The target value of the Light xyL y state */
uint8_t tid; /*!< Transaction Identifier */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_light_xyl_set_t;
/** Parameters of Light xyL Default Set */
typedef struct {
uint16_t lightness; /*!< The value of the Light Lightness Default state */
uint16_t xyl_x; /*!< The value of the Light xyL x Default state */
uint16_t xyl_y; /*!< The value of the Light xyL y Default state */
} esp_ble_mesh_light_xyl_default_set_t;
/** Parameters of Light xyL Range Set */
typedef struct {
uint16_t xyl_x_range_min; /*!< The value of the xyL x Range Min field of the Light xyL x Range state */
uint16_t xyl_x_range_max; /*!< The value of the xyL x Range Max field of the Light xyL x Range state */
uint16_t xyl_y_range_min; /*!< The value of the xyL y Range Min field of the Light xyL y Range state */
uint16_t xyl_y_range_max; /*!< The value of the xyL y Range Max field of the Light xyL y Range state */
} esp_ble_mesh_light_xyl_range_set_t;
/** Parameter of Light LC Mode Set */
typedef struct {
uint8_t mode; /*!< The target value of the Light LC Mode state */
} esp_ble_mesh_light_lc_mode_set_t;
/** Parameter of Light LC OM Set */
typedef struct {
uint8_t mode; /*!< The target value of the Light LC Occupancy Mode state */
} esp_ble_mesh_light_lc_om_set_t;
/** Parameters of Light LC Light OnOff Set */
typedef struct {
bool op_en; /*!< Indicate whether optional parameters included */
uint8_t light_onoff; /*!< The target value of the Light LC Light OnOff state */
uint8_t tid; /*!< Transaction Identifier */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_light_lc_light_onoff_set_t;
/** Parameter of Light LC Property Get */
typedef struct {
uint16_t property_id; /*!< Property ID identifying a Light LC Property */
} esp_ble_mesh_light_lc_property_get_t;
/** Parameters of Light LC Property Set */
typedef struct {
uint16_t property_id; /*!< Property ID identifying a Light LC Property */
struct net_buf_simple *property_value; /*!< Raw value for the Light LC Property */
} esp_ble_mesh_light_lc_property_set_t;
/**
* @brief Lighting Client Model get message union
*/
typedef union {
esp_ble_mesh_light_lc_property_get_t lc_property_get; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LC_PROPERTY_GET */
} esp_ble_mesh_light_client_get_state_t;
/**
* @brief Lighting Client Model set message union
*/
typedef union {
esp_ble_mesh_light_lightness_set_t lightness_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_SET_UNACK */
esp_ble_mesh_light_lightness_linear_set_t lightness_linear_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_LINEAR_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_LINEAR_SET_UNACK */
esp_ble_mesh_light_lightness_default_set_t lightness_default_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_DEFAULT_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_DEFAULT_SET_UNACK */
esp_ble_mesh_light_lightness_range_set_t lightness_range_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_RANGE_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_RANGE_SET_UNACK */
esp_ble_mesh_light_ctl_set_t ctl_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_SET_UNACK */
esp_ble_mesh_light_ctl_temperature_set_t ctl_temperature_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_SET_UNACK */
esp_ble_mesh_light_ctl_temperature_range_set_t ctl_temperature_range_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_RANGE_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_RANGE_SET_UNACK */
esp_ble_mesh_light_ctl_default_set_t ctl_default_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_DEFAULT_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_DEFAULT_SET_UNACK */
esp_ble_mesh_light_hsl_set_t hsl_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_SET_UNACK */
esp_ble_mesh_light_hsl_hue_set_t hsl_hue_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_HUE_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_HUE_SET_UNACK */
esp_ble_mesh_light_hsl_saturation_set_t hsl_saturation_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_SATURATION_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_SATURATION_SET_UNACK */
esp_ble_mesh_light_hsl_default_set_t hsl_default_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_DEFAULT_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_DEFAULT_SET_UNACK */
esp_ble_mesh_light_hsl_range_set_t hsl_range_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_RANGE_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_RANGE_SET_UNACK */
esp_ble_mesh_light_xyl_set_t xyl_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_SET_UNACK */
esp_ble_mesh_light_xyl_default_set_t xyl_default_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_DEFAULT_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_DEFAULT_SET_UNACK */
esp_ble_mesh_light_xyl_range_set_t xyl_range_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_RANGE_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_RANGE_SET_UNACK */
esp_ble_mesh_light_lc_mode_set_t lc_mode_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LC_MODE_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_LC_MODE_SET_UNACK */
esp_ble_mesh_light_lc_om_set_t lc_om_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LC_OM_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_LC_OM_SET_UNACK */
esp_ble_mesh_light_lc_light_onoff_set_t lc_light_onoff_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LC_LIGHT_ONOFF_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_LC_LIGHT_ONOFF_SET_UNACK */
esp_ble_mesh_light_lc_property_set_t lc_property_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LC_PROPERTY_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_LC_PROPERTY_SET_UNACK */
} esp_ble_mesh_light_client_set_state_t;
/**
* @brief Bluetooth Mesh Light Lightness Client Model Get and Set callback parameters structure.
*/
/** Parameters of Light Lightness Status */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t present_lightness; /*!< Current value of light lightness actual state */
uint16_t target_lightness; /*!< Target value of light lightness actual state (optional) */
uint8_t remain_time; /*!< Time to complete state transition (C.1) */
} esp_ble_mesh_light_lightness_status_cb_t;
/** Parameters of Light Lightness Linear Status */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t present_lightness; /*!< Current value of light lightness linear state */
uint16_t target_lightness; /*!< Target value of light lightness linear state (optional) */
uint8_t remain_time; /*!< Time to complete state transition (C.1) */
} esp_ble_mesh_light_lightness_linear_status_cb_t;
/** Parameter of Light Lightness Last Status */
typedef struct {
uint16_t lightness; /*!< The value of the Light Lightness Last state */
} esp_ble_mesh_light_lightness_last_status_cb_t;
/** Parameter of Light Lightness Default Status */
typedef struct {
uint16_t lightness; /*!< The value of the Light Lightness default State */
} esp_ble_mesh_light_lightness_default_status_cb_t;
/** Parameters of Light Lightness Range Status */
typedef struct {
uint8_t status_code; /*!< Status Code for the request message */
uint16_t range_min; /*!< Value of range min field of light lightness range state */
uint16_t range_max; /*!< Value of range max field of light lightness range state */
} esp_ble_mesh_light_lightness_range_status_cb_t;
/** Parameters of Light CTL Status */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t present_ctl_lightness; /*!< Current value of light ctl lightness state */
uint16_t present_ctl_temperature; /*!< Current value of light ctl temperature state */
uint16_t target_ctl_lightness; /*!< Target value of light ctl lightness state (optional) */
uint16_t target_ctl_temperature; /*!< Target value of light ctl temperature state (C.1) */
uint8_t remain_time; /*!< Time to complete state transition (C.1) */
} esp_ble_mesh_light_ctl_status_cb_t;
/** Parameters of Light CTL Temperature Status */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t present_ctl_temperature; /*!< Current value of light ctl temperature state */
uint16_t present_ctl_delta_uv; /*!< Current value of light ctl delta UV state */
uint16_t target_ctl_temperature; /*!< Target value of light ctl temperature state (optional) */
uint16_t target_ctl_delta_uv; /*!< Target value of light ctl delta UV state (C.1) */
uint8_t remain_time; /*!< Time to complete state transition (C.1) */
} esp_ble_mesh_light_ctl_temperature_status_cb_t;
/** Parameters of Light CTL Temperature Range Status */
typedef struct {
uint8_t status_code; /*!< Status code for the request message */
uint16_t range_min; /*!< Value of temperature range min field of light ctl temperature range state */
uint16_t range_max; /*!< Value of temperature range max field of light ctl temperature range state */
} esp_ble_mesh_light_ctl_temperature_range_status_cb_t;
/** Parameters of Light CTL Default Status */
typedef struct {
uint16_t lightness; /*!< Value of light lightness default state */
uint16_t temperature; /*!< Value of light temperature default state */
int16_t delta_uv; /*!< Value of light delta UV default state */
} esp_ble_mesh_light_ctl_default_status_cb_t;
/** Parameters of Light HSL Status */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t hsl_lightness; /*!< Current value of light hsl lightness state */
uint16_t hsl_hue; /*!< Current value of light hsl hue state */
uint16_t hsl_saturation; /*!< Current value of light hsl saturation state */
uint8_t remain_time; /*!< Time to complete state transition (optional) */
} esp_ble_mesh_light_hsl_status_cb_t;
/** Parameters of Light HSL Target Status */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t hsl_lightness_target; /*!< Target value of light hsl lightness state */
uint16_t hsl_hue_target; /*!< Target value of light hsl hue state */
uint16_t hsl_saturation_target; /*!< Target value of light hsl saturation state */
uint8_t remain_time; /*!< Time to complete state transition (optional) */
} esp_ble_mesh_light_hsl_target_status_cb_t;
/** Parameters of Light HSL Hue Status */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t present_hue; /*!< Current value of light hsl hue state */
uint16_t target_hue; /*!< Target value of light hsl hue state (optional) */
uint8_t remain_time; /*!< Time to complete state transition (C.1) */
} esp_ble_mesh_light_hsl_hue_status_cb_t;
/** Parameters of Light HSL Saturation Status */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t present_saturation; /*!< Current value of light hsl saturation state */
uint16_t target_saturation; /*!< Target value of light hsl saturation state (optional) */
uint8_t remain_time; /*!< Time to complete state transition (C.1) */
} esp_ble_mesh_light_hsl_saturation_status_cb_t;
/** Parameters of Light HSL Default Status */
typedef struct {
uint16_t lightness; /*!< Value of light lightness default state */
uint16_t hue; /*!< Value of light hue default state */
uint16_t saturation; /*!< Value of light saturation default state */
} esp_ble_mesh_light_hsl_default_status_cb_t;
/** Parameters of Light HSL Range Status */
typedef struct {
uint8_t status_code; /*!< Status code for the request message */
uint16_t hue_range_min; /*!< Value of hue range min field of light hsl hue range state */
uint16_t hue_range_max; /*!< Value of hue range max field of light hsl hue range state */
uint16_t saturation_range_min; /*!< Value of saturation range min field of light hsl saturation range state */
uint16_t saturation_range_max; /*!< Value of saturation range max field of light hsl saturation range state */
} esp_ble_mesh_light_hsl_range_status_cb_t;
/** Parameters of Light xyL Status */
typedef struct {
bool op_en; /*!< Indicate whether optional parameters included */
uint16_t xyl_lightness; /*!< The present value of the Light xyL Lightness state */
uint16_t xyl_x; /*!< The present value of the Light xyL x state */
uint16_t xyl_y; /*!< The present value of the Light xyL y state */
uint8_t remain_time; /*!< Time to complete state transition (optional) */
} esp_ble_mesh_light_xyl_status_cb_t;
/** Parameters of Light xyL Target Status */
typedef struct {
bool op_en; /*!< Indicate whether optional parameters included */
uint16_t target_xyl_lightness; /*!< The target value of the Light xyL Lightness state */
uint16_t target_xyl_x; /*!< The target value of the Light xyL x state */
uint16_t target_xyl_y; /*!< The target value of the Light xyL y state */
uint8_t remain_time; /*!< Time to complete state transition (optional) */
} esp_ble_mesh_light_xyl_target_status_cb_t;
/** Parameters of Light xyL Default Status */
typedef struct {
uint16_t lightness; /*!< The value of the Light Lightness Default state */
uint16_t xyl_x; /*!< The value of the Light xyL x Default state */
uint16_t xyl_y; /*!< The value of the Light xyL y Default state */
} esp_ble_mesh_light_xyl_default_status_cb_t;
/** Parameters of Light xyL Range Status */
typedef struct {
uint8_t status_code; /*!< Status Code for the requesting message */
uint16_t xyl_x_range_min; /*!< The value of the xyL x Range Min field of the Light xyL x Range state */
uint16_t xyl_x_range_max; /*!< The value of the xyL x Range Max field of the Light xyL x Range state */
uint16_t xyl_y_range_min; /*!< The value of the xyL y Range Min field of the Light xyL y Range state */
uint16_t xyl_y_range_max; /*!< The value of the xyL y Range Max field of the Light xyL y Range state */
} esp_ble_mesh_light_xyl_range_status_cb_t;
/** Parameter of Light LC Mode Status */
typedef struct {
uint8_t mode; /*!< The present value of the Light LC Mode state */
} esp_ble_mesh_light_lc_mode_status_cb_t;
/** Parameter of Light LC OM Status */
typedef struct {
uint8_t mode; /*!< The present value of the Light LC Occupancy Mode state */
} esp_ble_mesh_light_lc_om_status_cb_t;
/** Parameters of Light LC Light OnOff Status */
typedef struct {
bool op_en; /*!< Indicate whether optional parameters included */
uint8_t present_light_onoff; /*!< The present value of the Light LC Light OnOff state */
uint8_t target_light_onoff; /*!< The target value of the Light LC Light OnOff state (Optional) */
uint8_t remain_time; /*!< Time to complete state transition (C.1) */
} esp_ble_mesh_light_lc_light_onoff_status_cb_t;
/** Parameters of Light LC Property Status */
typedef struct {
uint16_t property_id; /*!< Property ID identifying a Light LC Property */
struct net_buf_simple *property_value; /*!< Raw value for the Light LC Property */
} esp_ble_mesh_light_lc_property_status_cb_t;
/**
* @brief Lighting Client Model received message union
*/
typedef union {
esp_ble_mesh_light_lightness_status_cb_t lightness_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_STATUS */
esp_ble_mesh_light_lightness_linear_status_cb_t lightness_linear_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_LINEAR_STATUS */
esp_ble_mesh_light_lightness_last_status_cb_t lightness_last_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_LAST_STATUS */
esp_ble_mesh_light_lightness_default_status_cb_t lightness_default_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_DEFAULT_STATUS */
esp_ble_mesh_light_lightness_range_status_cb_t lightness_range_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_RANGE_STATUS */
esp_ble_mesh_light_ctl_status_cb_t ctl_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_STATUS */
esp_ble_mesh_light_ctl_temperature_status_cb_t ctl_temperature_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_STATUS */
esp_ble_mesh_light_ctl_temperature_range_status_cb_t ctl_temperature_range_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_RANGE_STATUS */
esp_ble_mesh_light_ctl_default_status_cb_t ctl_default_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_DEFAULT_STATUS */
esp_ble_mesh_light_hsl_status_cb_t hsl_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_STATUS */
esp_ble_mesh_light_hsl_target_status_cb_t hsl_target_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_TARGET_STATUS */
esp_ble_mesh_light_hsl_hue_status_cb_t hsl_hue_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_HUE_STATUS */
esp_ble_mesh_light_hsl_saturation_status_cb_t hsl_saturation_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_SATURATION_STATUS */
esp_ble_mesh_light_hsl_default_status_cb_t hsl_default_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_DEFAULT_STATUS */
esp_ble_mesh_light_hsl_range_status_cb_t hsl_range_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_RANGE_STATUS */
esp_ble_mesh_light_xyl_status_cb_t xyl_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_STATUS */
esp_ble_mesh_light_xyl_target_status_cb_t xyl_target_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_TARGET_STATUS */
esp_ble_mesh_light_xyl_default_status_cb_t xyl_default_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_DEFAULT_STATUS */
esp_ble_mesh_light_xyl_range_status_cb_t xyl_range_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_RANGE_STATUS */
esp_ble_mesh_light_lc_mode_status_cb_t lc_mode_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LC_MODE_STATUS */
esp_ble_mesh_light_lc_om_status_cb_t lc_om_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LC_OM_STATUS */
esp_ble_mesh_light_lc_light_onoff_status_cb_t lc_light_onoff_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LC_LIGHT_ONOFF_STATUS */
esp_ble_mesh_light_lc_property_status_cb_t lc_property_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LC_PROPERTY_STATUS */
} esp_ble_mesh_light_client_status_cb_t;
/** Lighting Client Model callback parameters */
typedef struct {
int error_code; /*!< Appropriate error code */
esp_ble_mesh_client_common_param_t *params; /*!< The client common parameters. */
esp_ble_mesh_light_client_status_cb_t status_cb; /*!< The light status message callback values */
} esp_ble_mesh_light_client_cb_param_t;
/** This enum value is the event of Lighting Client Model */
typedef enum {
ESP_BLE_MESH_LIGHT_CLIENT_GET_STATE_EVT,
ESP_BLE_MESH_LIGHT_CLIENT_SET_STATE_EVT,
ESP_BLE_MESH_LIGHT_CLIENT_PUBLISH_EVT,
ESP_BLE_MESH_LIGHT_CLIENT_TIMEOUT_EVT,
ESP_BLE_MESH_LIGHT_CLIENT_EVT_MAX,
} esp_ble_mesh_light_client_cb_event_t;
/**
* @brief Bluetooth Mesh Light Client Model function.
*/
/**
* @brief Lighting Client Model callback function type
* @param event: Event type
* @param param: Pointer to callback parameter
*/
typedef void (* esp_ble_mesh_light_client_cb_t)(esp_ble_mesh_light_client_cb_event_t event,
esp_ble_mesh_light_client_cb_param_t *param);
/**
* @brief Register BLE Mesh Light Client Model callback.
*
* @param[in] callback: pointer to the callback function.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_register_light_client_callback(esp_ble_mesh_light_client_cb_t callback);
/**
* @brief Get the value of Light Server Model states using the Light Client Model get messages.
*
* @note If you want to know the opcodes and corresponding meanings accepted by this API,
* please refer to esp_ble_mesh_light_message_opcode_t in esp_ble_mesh_defs.h
*
* @param[in] params: Pointer to BLE Mesh common client parameters.
* @param[in] get_state: Pointer of light get message value.
* Shall not be set to NULL.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_light_client_get_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_light_client_get_state_t *get_state);
/**
* @brief Set the value of Light Server Model states using the Light Client Model set messages.
*
* @note If you want to know the opcodes and corresponding meanings accepted by this API,
* please refer to esp_ble_mesh_light_message_opcode_t in esp_ble_mesh_defs.h
*
* @param[in] params: Pointer to BLE Mesh common client parameters.
* @param[in] set_state: Pointer of light set message value.
* Shall not be set to NULL.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_light_client_set_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_light_client_set_state_t *set_state);
/**
* @brief Lighting Server Models related context.
*/
/** @def ESP_BLE_MESH_MODEL_LIGHT_LIGHTNESS_SRV
*
* @brief Define a new Light Lightness Server Model.
*
* @note 1. The Light Lightness Server model extends the Generic Power OnOff
* Server model and the Generic Level Server model. When this model
* is present on an Element, the corresponding Light Lightness Setup
* Server model shall also be present.
* 2. This model shall support model publication and model subscription.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_lightness_srv_t.
*
* @return New Light Lightness Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_LIGHTNESS_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_LIGHTNESS_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_LIGHTNESS_SETUP_SRV
*
* @brief Define a new Light Lightness Setup Server Model.
*
* @note 1. The Light Lightness Setup Server model extends the Light Lightness
* Server model and the Generic Power OnOff Setup Server model.
* 2. This model shall support model subscription.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_lightness_setup_srv_t.
*
* @return New Light Lightness Setup Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_LIGHTNESS_SETUP_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_LIGHTNESS_SETUP_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_CTL_SRV
*
* @brief Define a new Light CTL Server Model.
*
* @note 1. The Light CTL Server model extends the Light Lightness Server model.
* When this model is present on an Element, the corresponding Light
* CTL Temperature Server model and the corresponding Light CTL Setup
* Server model shall also be present.
* 2. This model shall support model publication and model subscription.
* 3. The model requires two elements: the main element and the Temperature
* element. The Temperature element contains the corresponding Light CTL
* Temperature Server model and an instance of a Generic Level state
* bound to the Light CTL Temperature state on the Temperature element.
* The Light CTL Temperature state on the Temperature element is bound to
* the Light CTL state on the main element.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_ctl_srv_t.
*
* @return New Light CTL Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_CTL_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_CTL_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_CTL_SETUP_SRV
*
* @brief Define a new Light CTL Setup Server Model.
*
* @note 1. The Light CTL Setup Server model extends the Light CTL Server and
* the Light Lightness Setup Server.
* 2. This model shall support model subscription.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_ctl_setup_srv_t.
*
* @return New Light CTL Setup Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_CTL_SETUP_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_CTL_SETUP_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_CTL_TEMP_SRV
*
* @brief Define a new Light CTL Temperature Server Model.
*
* @note 1. The Light CTL Temperature Server model extends the Generic Level
* Server model.
* 2. This model shall support model publication and model subscription.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_ctl_temp_srv_t.
*
* @return New Light CTL Temperature Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_CTL_TEMP_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_CTL_TEMP_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_HSL_SRV
*
* @brief Define a new Light HSL Server Model.
*
* @note 1. The Light HSL Server model extends the Light Lightness Server model. When
* this model is present on an Element, the corresponding Light HSL Hue
* Server model and the corresponding Light HSL Saturation Server model and
* the corresponding Light HSL Setup Server model shall also be present.
* 2. This model shall support model publication and model subscription.
* 3. The model requires three elements: the main element and the Hue element
* and the Saturation element. The Hue element contains the corresponding
* Light HSL Hue Server model and an instance of a Generic Level state bound
* to the Light HSL Hue state on the Hue element. The Saturation element
* contains the corresponding Light HSL Saturation Server model and an
* instance of a Generic Level state bound to the Light HSL Saturation state
* on the Saturation element. The Light HSL Hue state on the Hue element is
* bound to the Light HSL state on the main element and the Light HSL
* Saturation state on the Saturation element is bound to the Light HSL state
* on the main element.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_hsl_srv_t.
*
* @return New Light HSL Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_HSL_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_HSL_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_HSL_SETUP_SRV
*
* @brief Define a new Light HSL Setup Server Model.
*
* @note 1. The Light HSL Setup Server model extends the Light HSL Server and
* the Light Lightness Setup Server.
* 2. This model shall support model subscription.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_hsl_setup_srv_t.
*
* @return New Light HSL Setup Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_HSL_SETUP_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_HSL_SETUP_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_HSL_HUE_SRV
*
* @brief Define a new Light HSL Hue Server Model.
*
* @note 1. The Light HSL Hue Server model extends the Generic Level Server model.
* This model is associated with the Light HSL Server model.
* 2. This model shall support model publication and model subscription.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_hsl_hue_srv_t.
*
* @return New Light HSL Hue Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_HSL_HUE_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_HSL_HUE_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_HSL_SAT_SRV
*
* @brief Define a new Light HSL Saturation Server Model.
*
* @note 1. The Light HSL Saturation Server model extends the Generic Level Server
* model. This model is associated with the Light HSL Server model.
* 2. This model shall support model publication and model subscription.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_hsl_sat_srv_t.
*
* @return New Light HSL Saturation Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_HSL_SAT_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_HSL_SAT_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_XYL_SRV
*
* @brief Define a new Light xyL Server Model.
*
* @note 1. The Light xyL Server model extends the Light Lightness Server model.
* When this model is present on an Element, the corresponding Light xyL
* Setup Server model shall also be present.
* 2. This model shall support model publication and model subscription.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_xyl_srv_t.
*
* @return New Light xyL Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_XYL_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_XYL_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_XYL_SETUP_SRV
*
* @brief Define a new Light xyL Setup Server Model.
*
* @note 1. The Light xyL Setup Server model extends the Light xyL Server and
* the Light Lightness Setup Server.
* 2. This model shall support model subscription.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_xyl_setup_srv_t.
*
* @return New Light xyL Setup Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_XYL_SETUP_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_XYL_SETUP_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_LC_SRV
*
* @brief Define a new Light LC Server Model.
*
* @note 1. The Light LC (Lightness Control) Server model extends the Light
* Lightness Server model and the Generic OnOff Server model. When
* this model is present on an Element, the corresponding Light LC
* Setup Server model shall also be present.
* 2. This model shall support model publication and model subscription.
* 3. This model may be used to represent an element that is a client to
* a Sensor Server model and controls the Light Lightness Actual state
* via defined state bindings.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_lc_srv_t.
*
* @return New Light LC Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_LC_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_LC_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_LC_SETUP_SRV
*
* @brief Define a new Light LC Setup Server Model.
*
* @note 1. The Light LC (Lightness Control) Setup model extends the Light LC
* Server model.
* 2. This model shall support model publication and model subscription.
* 3. This model may be used to configure setup parameters for the Light
* LC Server model.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_lc_setup_srv_t.
*
* @return New Light LC Setup Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_LC_SETUP_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_LC_SETUP_SRV, \
NULL, srv_pub, srv_data)
/** Parameters of Light Lightness state */
typedef struct {
uint16_t lightness_linear; /*!< The present value of Light Lightness Linear state */
uint16_t target_lightness_linear; /*!< The target value of Light Lightness Linear state */
uint16_t lightness_actual; /*!< The present value of Light Lightness Actual state */
uint16_t target_lightness_actual; /*!< The target value of Light Lightness Actual state */
uint16_t lightness_last; /*!< The value of Light Lightness Last state */
uint16_t lightness_default; /*!< The value of Light Lightness Default state */
uint8_t status_code; /*!< The status code of setting Light Lightness Range state */
uint16_t lightness_range_min; /*!< The minimum value of Light Lightness Range state */
uint16_t lightness_range_max; /*!< The maximum value of Light Lightness Range state */
} esp_ble_mesh_light_lightness_state_t;
/** User data of Light Lightness Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting Lightness Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_lightness_state_t *state; /*!< Parameters of the Light Lightness state */
esp_ble_mesh_last_msg_info_t last; /*!< Parameters of the last received set message */
esp_ble_mesh_state_transition_t actual_transition; /*!< Parameters of state transition */
esp_ble_mesh_state_transition_t linear_transition; /*!< Parameters of state transition */
int32_t tt_delta_lightness_actual; /*!< Delta change value of lightness actual state transition */
int32_t tt_delta_lightness_linear; /*!< Delta change value of lightness linear state transition */
} esp_ble_mesh_light_lightness_srv_t;
/** User data of Light Lightness Setup Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting Lightness Setup Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_lightness_state_t *state; /*!< Parameters of the Light Lightness state */
} esp_ble_mesh_light_lightness_setup_srv_t;
/** Parameters of Light CTL state */
typedef struct {
uint16_t lightness; /*!< The present value of Light CTL Lightness state */
uint16_t target_lightness; /*!< The target value of Light CTL Lightness state */
uint16_t temperature; /*!< The present value of Light CTL Temperature state */
uint16_t target_temperature; /*!< The target value of Light CTL Temperature state */
int16_t delta_uv; /*!< The present value of Light CTL Delta UV state */
int16_t target_delta_uv; /*!< The target value of Light CTL Delta UV state */
uint8_t status_code; /*!< The statue code of setting Light CTL Temperature Range state */
uint16_t temperature_range_min; /*!< The minimum value of Light CTL Temperature Range state */
uint16_t temperature_range_max; /*!< The maximum value of Light CTL Temperature Range state */
uint16_t lightness_default; /*!< The value of Light Lightness Default state */
uint16_t temperature_default; /*!< The value of Light CTL Temperature Default state */
int16_t delta_uv_default; /*!< The value of Light CTL Delta UV Default state */
} esp_ble_mesh_light_ctl_state_t;
/** User data of Light CTL Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting CTL Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_ctl_state_t *state; /*!< Parameters of the Light CTL state */
esp_ble_mesh_last_msg_info_t last; /*!< Parameters of the last received set message */
esp_ble_mesh_state_transition_t transition; /*!< Parameters of state transition */
int32_t tt_delta_lightness; /*!< Delta change value of lightness state transition */
int32_t tt_delta_temperature; /*!< Delta change value of temperature state transition */
int32_t tt_delta_delta_uv; /*!< Delta change value of delta uv state transition */
} esp_ble_mesh_light_ctl_srv_t;
/** User data of Light CTL Setup Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting CTL Setup Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_ctl_state_t *state; /*!< Parameters of the Light CTL state */
} esp_ble_mesh_light_ctl_setup_srv_t;
/** User data of Light CTL Temperature Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting CTL Temperature Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_ctl_state_t *state; /*!< Parameters of the Light CTL state */
esp_ble_mesh_last_msg_info_t last; /*!< Parameters of the last received set message */
esp_ble_mesh_state_transition_t transition; /*!< Parameters of state transition */
int32_t tt_delta_temperature; /*!< Delta change value of temperature state transition */
int32_t tt_delta_delta_uv; /*!< Delta change value of delta uv state transition */
} esp_ble_mesh_light_ctl_temp_srv_t;
/** Parameters of Light HSL state */
typedef struct {
uint16_t lightness; /*!< The present value of Light HSL Lightness state */
uint16_t target_lightness; /*!< The target value of Light HSL Lightness state */
uint16_t hue; /*!< The present value of Light HSL Hue state */
uint16_t target_hue; /*!< The target value of Light HSL Hue state */
uint16_t saturation; /*!< The present value of Light HSL Saturation state */
uint16_t target_saturation; /*!< The target value of Light HSL Saturation state */
uint16_t lightness_default; /*!< The value of Light Lightness Default state */
uint16_t hue_default; /*!< The value of Light HSL Hue Default state */
uint16_t saturation_default; /*!< The value of Light HSL Saturation Default state */
uint8_t status_code; /*!< The status code of setting Light HSL Hue & Saturation Range state */
uint16_t hue_range_min; /*!< The minimum value of Light HSL Hue Range state */
uint16_t hue_range_max; /*!< The maximum value of Light HSL Hue Range state */
uint16_t saturation_range_min; /*!< The minimum value of Light HSL Saturation state */
uint16_t saturation_range_max; /*!< The maximum value of Light HSL Saturation state */
} esp_ble_mesh_light_hsl_state_t;
/** User data of Light HSL Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting HSL Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_hsl_state_t *state; /*!< Parameters of the Light HSL state */
esp_ble_mesh_last_msg_info_t last; /*!< Parameters of the last received set message */
esp_ble_mesh_state_transition_t transition; /*!< Parameters of state transition */
int32_t tt_delta_lightness; /*!< Delta change value of lightness state transition */
int32_t tt_delta_hue; /*!< Delta change value of hue state transition */
int32_t tt_delta_saturation; /*!< Delta change value of saturation state transition */
} esp_ble_mesh_light_hsl_srv_t;
/** User data of Light HSL Setup Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting HSL Setup Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_hsl_state_t *state; /*!< Parameters of the Light HSL state */
} esp_ble_mesh_light_hsl_setup_srv_t;
/** User data of Light HSL Hue Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting HSL Hue Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_hsl_state_t *state; /*!< Parameters of the Light HSL state */
esp_ble_mesh_last_msg_info_t last; /*!< Parameters of the last received set message */
esp_ble_mesh_state_transition_t transition; /*!< Parameters of state transition */
int32_t tt_delta_hue; /*!< Delta change value of hue state transition */
} esp_ble_mesh_light_hsl_hue_srv_t;
/** User data of Light HSL Saturation Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting HSL Saturation Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_hsl_state_t *state; /*!< Parameters of the Light HSL state */
esp_ble_mesh_last_msg_info_t last; /*!< Parameters of the last received set message */
esp_ble_mesh_state_transition_t transition; /*!< Parameters of state transition */
int32_t tt_delta_saturation; /*!< Delta change value of saturation state transition */
} esp_ble_mesh_light_hsl_sat_srv_t;
/** Parameters of Light xyL state */
typedef struct {
uint16_t lightness; /*!< The present value of Light xyL Lightness state */
uint16_t target_lightness; /*!< The target value of Light xyL Lightness state */
uint16_t x; /*!< The present value of Light xyL x state */
uint16_t target_x; /*!< The target value of Light xyL x state */
uint16_t y; /*!< The present value of Light xyL y state */
uint16_t target_y; /*!< The target value of Light xyL y state */
uint16_t lightness_default; /*!< The value of Light Lightness Default state */
uint16_t x_default; /*!< The value of Light xyL x Default state */
uint16_t y_default; /*!< The value of Light xyL y Default state */
uint8_t status_code; /*!< The status code of setting Light xyL x & y Range state */
uint16_t x_range_min; /*!< The minimum value of Light xyL x Range state */
uint16_t x_range_max; /*!< The maximum value of Light xyL x Range state */