-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathesp_zigbee_attribute.h
723 lines (670 loc) · 25.9 KB
/
esp_zigbee_attribute.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
/*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "esp_err.h"
#include "esp_zigbee_type.h"
#include "zcl/esp_zigbee_zcl_common.h"
/**
* @brief Create an empty attribute list.
*
* @note This attribute list is ready for certain cluster id to add / update attribute refer to esp_zb_xx_cluster_add_attr() and esp_zb_cluster_update_attr().
* @note Attribute list groups up a cluster.
*
* @param[in] cluster_id The cluster id for attribute list refer to esp_zb_zcl_cluster_id
*
* @return pointer to @ref esp_zb_attribute_list_s
*
*/
esp_zb_attribute_list_t *esp_zb_zcl_attr_list_create(uint16_t cluster_id);
/**
* @brief Get ZCL attribute descriptor.
*
* @note Getting the local attribute from the specific endpoint and cluster.
*
* @param[in] endpoint The endpoint
* @param[in] cluster_id Cluster id for attribute list refer to esp_zb_zcl_cluster_id
* @param[in] cluster_role Cluster role of this cluster, either server or client role refer to esp_zb_zcl_cluster_role
* @param[in] attr_id Attribute id
*
* @return pointer to @ref esp_zb_zcl_attr_s
*
*/
esp_zb_zcl_attr_t *esp_zb_zcl_get_attribute(uint8_t endpoint, uint16_t cluster_id, uint8_t cluster_role, uint16_t attr_id);
/**
* @brief Set ZCL attribute value.
*
* @note Set the local attribute from the specific endpoint, cluster and attribute.
*
* @param[in] endpoint The endpoint
* @param[in] cluster_id Cluster id for attribute list refer to esp_zb_zcl_cluster_id
* @param[in] cluster_role Cluster role of this cluster, either server or client role refer to esp_zb_zcl_cluster_role
* @param[in] attr_id Attribute id
* @param[in] value_p pointer to new value
* @param[in] check The access method of attribute whether is required to check or not
*
* @note Please look up the Zigbee Cluster Library for the access method of attribute
* @return zcl status refer to esp_zb_zcl_status_t
*
*/
esp_zb_zcl_status_t esp_zb_zcl_set_attribute_val(uint8_t endpoint, uint16_t cluster_id, uint8_t cluster_role,
uint16_t attr_id, void *value_p, bool check);
/**
* @brief Get the manufacturer attribute descriptor
*
* @param endpoint The endpoint identifier where the attribute is located
* @param cluster_id The cluster identifier where the attribute is located
* @param cluster_role The role of cluster
* @param attr_id The attribute identifier
* @param manuf_code The manufacturer code
* @return A pointer to @ref esp_zb_zcl_attr_s for attribute descriptor
*/
esp_zb_zcl_attr_t *esp_zb_zcl_get_manufacturer_attribute(uint8_t endpoint, uint16_t cluster_id, uint8_t cluster_role, uint16_t attr_id,
uint16_t manuf_code);
/**
* @brief Set the manufacturer attribute value
*
* @param endpoint The endpoint identifier where the attribute is located
* @param cluster_id The cluster identifier where the attribute is located
* @param cluster_role The role of cluster
* @param manuf_code The manufacturer code
* @param attr_id The attribute identifier
* @param value_p The value of attribute expected to set
* @param check The access method of attribute whether is required to check or not
* @return The zcl status refer to esp_zb_zcl_status_t
*/
esp_zb_zcl_status_t esp_zb_zcl_set_manufacturer_attribute_val(uint8_t endpoint, uint16_t cluster_id, uint8_t cluster_role, uint16_t manuf_code,
uint16_t attr_id, void *value_p, bool check);
/**
* @brief Add an attribute in basic cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_basic_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in power config cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
* @note Attribute for battery information, battery settings 2 and 3 sets haven't supported yet.
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_power_config_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in identify cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_identify_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in groups cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_groups_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in scenes cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_scenes_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in on_off cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_on_off_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in on_off switch config cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_on_off_switch_config_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in level cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_level_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in color control cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_color_control_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in time cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_time_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in binary input cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_binary_input_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in Commissioning cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_commissioning_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in shade config cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_shade_config_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in door lock cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_door_lock_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in IAS zone cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_ias_zone_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Set the IAS zone CIE address for IAS zone server
*
* @param[in] endpoint A 8-bit endpoint ID which the IAS zone cluster attach
* @param[in] cie_ieee_addr The 8-byte IEEE address will be regarded as the IAS message destination address
* @return
* - ESP_OK on success
* - ESP_FAIL The CIE address has been set, invalid argument or IAS zone cluster does not exist
*
*/
esp_err_t esp_zb_ias_zone_cluster_set_cie_address(uint8_t endpoint, esp_zb_ieee_addr_t cie_ieee_addr);
/**
* @brief Get the zone table size of the IAS ACE cluster
*
* @param[in] endpoint A 8-bit endpoint ID which the IAS ACE cluster attach
* @param[out] table_size The zone table size of IAS ACE cluster on the given endpoint.
* @return
* - ESP_OK on success
* - ESP_ERR_NOT_FOUND The IAS ACE cluster is not founded on the given endpoint.
*
*/
esp_err_t esp_zb_ias_ace_get_zone_table_length(uint8_t endpoint, uint8_t *table_size);
/**
* @brief Get the zone table of the IAS ACE cluster
*
* @param[in] endpoint A 8-bit endpoint ID which the IAS ACE cluster attach
* @param[out] table_p The address of the zone table of IAS ACE cluster on the given endpoint.
* @return
* - ESP_OK on success
* - ESP_ERR_NOT_FOUND The IAS ACE cluster is not founded on the given endpoint.
*
*/
esp_err_t esp_zb_ias_ace_get_zone_table(uint8_t endpoint, esp_zb_zcl_ias_ace_zone_table_t** table_p);
/**
* @brief Add an attribute in IAS_WD cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_ias_wd_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in temperature measurement cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_temperature_meas_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in humidity measurement cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_humidity_meas_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute and variables in OTA client cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_ota_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in illuminance measurement cluster
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_illuminance_meas_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in pressure measurement cluster
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_pressure_meas_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in flow measurement cluster
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_flow_meas_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in electrical measurement cluster
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_electrical_meas_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in window covering cluster
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_window_covering_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in occupancy sensor cluster
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_occupancy_sensing_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in thermostat cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_thermostat_cluster_add_attr(esp_zb_attribute_list_t* attr_list, uint16_t attr_id, void* value_p);
/**
* @brief Add an attribute in fan control cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_fan_control_cluster_add_attr(esp_zb_attribute_list_t* attr_list, uint16_t attr_id, void* value_p);
/**
* @brief Add an attribute in thermostat ui configuration cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_thermostat_ui_config_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in analog input cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_analog_input_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in analog output cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_analog_output_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in analog value cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_analog_value_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in electrical conductivity measurement cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_ec_measurement_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in pH measurement cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_ph_measurement_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in wind speed measurement cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_wind_speed_measurement_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in carbon dioxide measurement cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_carbon_dioxide_measurement_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in pm2.5 measurement cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_pm2_5_measurement_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in multistate value cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_multistate_value_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in diagnostics cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_diagnostics_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in meter identification cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_meter_identification_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
/**
* @brief Add an attribute in a specified cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] cluster_id The cluster ID to which the attribute will be added, refer to esp_zb_zcl_cluster_id_t
* @param[in] attr_id An attribute id to be added
* @param[in] attr_type Type of attribute to be added, refer to esp_zb_zcl_attr_type_t
* @param[in] attr_access Access type of attribute to be added, refer to esp_zb_zcl_attr_access_t
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or attribute type is unsupported
*
*/
esp_err_t esp_zb_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t cluster_id, uint16_t attr_id, uint8_t attr_type, uint8_t attr_access, void *value_p);
/**
* @brief Add customized attribute in customized cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id to be added
* @param[in] attr_type Type of attribute to be added, refer to esp_zb_zcl_attr_type_t
* @param[in] attr_access Access type of attribute to be added, refer to esp_zb_zcl_attr_access_t
* @param[in] value_p A pointer to attribute value wants to add
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute is existed or unsupported
*
*/
esp_err_t esp_zb_custom_cluster_add_custom_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, uint8_t attr_type, uint8_t attr_access, void *value_p);
/**
* @brief Update an attribute in a specific cluster.
*
* @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s
* @param[in] attr_id An attribute id which wants to update
* @param[in] value_p A pointer to attribute value wants to update
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if attribute list not initialized
* - ESP_ERR_NOT_FOUND the request update attribute is not found
*
*/
esp_err_t esp_zb_cluster_update_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);
#ifdef __cplusplus
}
#endif