forked from unigent/samplelight_cfgreport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zcl_samplelight_data.c
782 lines (740 loc) · 21.9 KB
/
zcl_samplelight_data.c
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
/**************************************************************************************************
Filename: zcl_samplelight_data.c
Revised: $Date: 2014-05-12 13:14:02 -0700 (Mon, 12 May 2014) $
Revision: $Revision: 38502 $
Description: Zigbee Cluster Library - sample device application.
Copyright 2006-2014 Texas Instruments Incorporated. All rights reserved.
IMPORTANT: Your use of this Software is limited to those specific rights
granted under the terms of a software license agreement between the user
who downloaded the software, his/her employer (which must be your employer)
and Texas Instruments Incorporated (the "License"). You may not use this
Software unless you agree to abide by the terms of the License. The License
limits your use, and you acknowledge, that the Software may not be modified,
copied or distributed unless embedded on a Texas Instruments microcontroller
or used solely and exclusively in conjunction with a Texas Instruments radio
frequency transceiver, which is integrated into your product. Other than for
the foregoing purpose, you may not use, reproduce, copy, prepare derivative
works of, modify, distribute, perform, display or sell this Software and/or
its documentation for any purpose.
YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
Should you have any questions regarding your right to use this Software,
contact Texas Instruments Incorporated at www.TI.com.
**************************************************************************************************/
/*********************************************************************
* INCLUDES
*/
#include "ZComDef.h"
#include "OSAL.h"
#include "AF.h"
#include "ZDConfig.h"
#include "zcl.h"
#include "zcl_general.h"
#include "zcl_ha.h"
#include "zcl_ezmode.h"
#include "zcl_poll_control.h"
#include "zcl_electrical_measurement.h"
#include "zcl_diagnostic.h"
#include "zcl_meter_identification.h"
#include "zcl_appliance_identification.h"
#include "zcl_appliance_events_alerts.h"
#include "zcl_power_profile.h"
#include "zcl_appliance_control.h"
#include "zcl_appliance_statistics.h"
#include "zcl_hvac.h"
#include "zcl_samplelight.h"
/*********************************************************************
* CONSTANTS
*/
#define SAMPLELIGHT_DEVICE_VERSION 0
#define SAMPLELIGHT_FLAGS 0
#define SAMPLELIGHT_HWVERSION 1
#define SAMPLELIGHT_ZCLVERSION 1
/*********************************************************************
* TYPEDEFS
*/
/*********************************************************************
* MACROS
*/
/*********************************************************************
* GLOBAL VARIABLES
*/
// Basic Cluster
const uint8 zclSampleLight_HWRevision = SAMPLELIGHT_HWVERSION;
const uint8 zclSampleLight_ZCLVersion = SAMPLELIGHT_ZCLVERSION;
const uint8 zclSampleLight_ManufacturerName[] = { 16, 'T','e','x','a','s','I','n','s','t','r','u','m','e','n','t','s' };
const uint8 zclSampleLight_ModelId[] = { 16, 'T','I','0','0','0','1',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ' };
const uint8 zclSampleLight_DateCode[] = { 16, '2','0','0','6','0','8','3','1',' ',' ',' ',' ',' ',' ',' ',' ' };
const uint8 zclSampleLight_PowerSource = POWER_SOURCE_MAINS_1_PHASE;
uint8 zclSampleLight_LocationDescription[17] = { 16, ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ' };
uint8 zclSampleLight_PhysicalEnvironment = 0;
uint8 zclSampleLight_DeviceEnable = DEVICE_ENABLED;
// Identify Cluster
uint16 zclSampleLight_IdentifyTime = 0;
#ifdef ZCL_EZMODE
uint8 zclSampleLight_IdentifyCommissionState;
#endif
// On/Off Cluster
uint8 zclSampleLight_OnOff = LIGHT_OFF;
//-- MOD START
uint8 zclSampleLight_OnOffLastReportValue = LIGHT_OFF;
//-- MOD END
// Level Control Cluster
#ifdef ZCL_LEVEL_CTRL
uint8 zclSampleLight_LevelCurrentLevel = ATTR_LEVEL_MIN_LEVEL;
//-- MOD START
uint8 zclSampleLight_LevelCurrentLevelChange = 50;
uint8 zclSampleLight_LevelLastReportValue = ATTR_LEVEL_MIN_LEVEL;
//-- MOD END
uint16 zclSampleLight_LevelRemainingTime;
uint16 zclSampleLight_LevelOnOffTransitionTime = 20;
uint8 zclSampleLight_LevelOnLevel = ATTR_LEVEL_MID_LEVEL;
uint16 zclSampleLight_LevelOnTransitionTime = 20;
uint16 zclSampleLight_LevelOffTransitionTime = 20;
uint8 zclSampleLight_LevelDefaultMoveRate = 0; // as fast as possible
#endif
#if ZCL_DISCOVER
CONST zclCommandRec_t zclSampleLight_Cmds[] =
{
{
ZCL_CLUSTER_ID_GEN_BASIC,
COMMAND_BASIC_RESET_FACT_DEFAULT,
CMD_DIR_SERVER_RECEIVED
},
{
ZCL_CLUSTER_ID_GEN_ON_OFF,
COMMAND_OFF,
CMD_DIR_SERVER_RECEIVED
},
{
ZCL_CLUSTER_ID_GEN_ON_OFF,
COMMAND_ON,
CMD_DIR_SERVER_RECEIVED
},
{
ZCL_CLUSTER_ID_GEN_ON_OFF,
COMMAND_TOGGLE,
CMD_DIR_SERVER_RECEIVED
},
#ifdef ZCL_LEVEL_CONTROL
,{
ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL,
COMMAND_LEVEL_MOVE_TO_LEVEL,
CMD_DIR_SERVER_RECEIVED
},
{
ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL,
COMMAND_LEVEL_MOVE,
CMD_DIR_SERVER_RECEIVED
},
{
ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL,
COMMAND_LEVEL_STEP,
CMD_DIR_SERVER_RECEIVED
},
{
ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL,
COMMAND_LEVEL_STOP,
CMD_DIR_SERVER_RECEIVED
},
{
ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL,
COMMAND_LEVEL_MOVE_TO_LEVEL_WITH_ON_OFF,
CMD_DIR_SERVER_RECEIVED
},
{
ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL,
COMMAND_LEVEL_MOVE_WITH_ON_OFF,
CMD_DIR_SERVER_RECEIVED
},
{
ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL,
COMMAND_LEVEL_STEP_WITH_ON_OFF,
CMD_DIR_SERVER_RECEIVED
},
{
ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL,
COMMAND_LEVEL_STOP_WITH_ON_OFF,
CMD_DIR_SERVER_RECEIVED
}
#endif // ZCL_LEVEL_CONTROL
};
CONST uint8 zclCmdsArraySize = ( sizeof(zclSampleLight_Cmds) / sizeof(zclSampleLight_Cmds[0]) );
#endif // ZCL_DISCOVER
//-- MOD START
#ifdef ZCL_REPORT
zclConfigReportRec_t zclSampleLight_ConfigReportRecs[] =
{
// *** On/Off Cluster Attr ConfigReportRec ***
{
ZCL_CLUSTER_ID_GEN_ON_OFF, // clusterId
0xFFFF, // timeup
(void *)&zclSampleLight_OnOffLastReportValue, // lastReportValue
{ // CfgReportRec
ZCL_REPORT_SEND, // direction
ATTRID_ON_OFF, // attrID
ZCL_DATATYPE_BOOLEAN, // dataType
0, // minReportInt
0xFFFF, // maxReportInt
0, // timeoutPeriod
NULL // *reportableChange, no need to set for DISCRETE datatype
}
}
#ifdef ZCL_LEVEL_CTRL
,{
ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL,
0xFFFF,
(void *)&zclSampleLight_LevelLastReportValue,
{
ZCL_REPORT_SEND,
ATTRID_LEVEL_CURRENT_LEVEL,
ZCL_DATATYPE_UINT8,
0,
0xFFFF,
0,
(void *)&zclSampleLight_LevelCurrentLevelChange
}
}
#endif
};
uint8 CONST zclSampleLight_NumConfigReportRecs = ( sizeof(zclSampleLight_ConfigReportRecs) / sizeof(zclSampleLight_ConfigReportRecs[0]) );
#endif
//-- MOD END
/*********************************************************************
* ATTRIBUTE DEFINITIONS - Uses REAL cluster IDs
*/
CONST zclAttrRec_t zclSampleLight_Attrs[] =
{
// *** General Basic Cluster Attributes ***
{
ZCL_CLUSTER_ID_GEN_BASIC, // Cluster IDs - defined in the foundation (ie. zcl.h)
{ // Attribute record
ATTRID_BASIC_HW_VERSION, // Attribute ID - Found in Cluster Library header (ie. zcl_general.h)
ZCL_DATATYPE_UINT8, // Data Type - found in zcl.h
ACCESS_CONTROL_READ, // Variable access control - found in zcl.h
(void *)&zclSampleLight_HWRevision // Pointer to attribute variable
}
},
{
ZCL_CLUSTER_ID_GEN_BASIC,
{ // Attribute record
ATTRID_BASIC_ZCL_VERSION,
ZCL_DATATYPE_UINT8,
ACCESS_CONTROL_READ,
(void *)&zclSampleLight_ZCLVersion
}
},
{
ZCL_CLUSTER_ID_GEN_BASIC,
{ // Attribute record
ATTRID_BASIC_MANUFACTURER_NAME,
ZCL_DATATYPE_CHAR_STR,
ACCESS_CONTROL_READ,
(void *)zclSampleLight_ManufacturerName
}
},
{
ZCL_CLUSTER_ID_GEN_BASIC,
{ // Attribute record
ATTRID_BASIC_MODEL_ID,
ZCL_DATATYPE_CHAR_STR,
ACCESS_CONTROL_READ,
(void *)zclSampleLight_ModelId
}
},
{
ZCL_CLUSTER_ID_GEN_BASIC,
{ // Attribute record
ATTRID_BASIC_DATE_CODE,
ZCL_DATATYPE_CHAR_STR,
ACCESS_CONTROL_READ,
(void *)zclSampleLight_DateCode
}
},
{
ZCL_CLUSTER_ID_GEN_BASIC,
{ // Attribute record
ATTRID_BASIC_POWER_SOURCE,
ZCL_DATATYPE_UINT8,
ACCESS_CONTROL_READ,
(void *)&zclSampleLight_PowerSource
}
},
{
ZCL_CLUSTER_ID_GEN_BASIC,
{ // Attribute record
ATTRID_BASIC_LOCATION_DESC,
ZCL_DATATYPE_CHAR_STR,
(ACCESS_CONTROL_READ | ACCESS_CONTROL_WRITE),
(void *)zclSampleLight_LocationDescription
}
},
{
ZCL_CLUSTER_ID_GEN_BASIC,
{ // Attribute record
ATTRID_BASIC_PHYSICAL_ENV,
ZCL_DATATYPE_UINT8,
(ACCESS_CONTROL_READ | ACCESS_CONTROL_WRITE),
(void *)&zclSampleLight_PhysicalEnvironment
}
},
{
ZCL_CLUSTER_ID_GEN_BASIC,
{ // Attribute record
ATTRID_BASIC_DEVICE_ENABLED,
ZCL_DATATYPE_BOOLEAN,
(ACCESS_CONTROL_READ | ACCESS_CONTROL_WRITE),
(void *)&zclSampleLight_DeviceEnable
}
},
#ifdef ZCL_IDENTIFY
// *** Identify Cluster Attribute ***
{
ZCL_CLUSTER_ID_GEN_IDENTIFY,
{ // Attribute record
ATTRID_IDENTIFY_TIME,
ZCL_DATATYPE_UINT16,
(ACCESS_CONTROL_READ | ACCESS_CONTROL_WRITE),
(void *)&zclSampleLight_IdentifyTime
}
},
#ifdef ZCL_EZMODE
// *** Identify Cluster Attribute ***
{
ZCL_CLUSTER_ID_GEN_IDENTIFY,
{ // Attribute record
ATTRID_IDENTIFY_COMMISSION_STATE,
ZCL_DATATYPE_UINT8,
(ACCESS_CONTROL_READ),
(void *)&zclSampleLight_IdentifyCommissionState
}
},
#endif // ZCL_EZMODE
#endif
// *** On/Off Cluster Attributes ***
{
ZCL_CLUSTER_ID_GEN_ON_OFF,
{ // Attribute record
ATTRID_ON_OFF,
ZCL_DATATYPE_BOOLEAN,
ACCESS_CONTROL_READ,
(void *)&zclSampleLight_OnOff
}
}
#ifdef ZCL_LEVEL_CTRL
, {
ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL,
{ // Attribute record
ATTRID_LEVEL_CURRENT_LEVEL,
ZCL_DATATYPE_UINT8,
ACCESS_CONTROL_READ,
(void *)&zclSampleLight_LevelCurrentLevel
}
},
{
ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL,
{ // Attribute record
ATTRID_LEVEL_REMAINING_TIME,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
(void *)&zclSampleLight_LevelRemainingTime
}
},
{
ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL,
{ // Attribute record
ATTRID_LEVEL_ON_OFF_TRANSITION_TIME,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ | ACCESS_CONTROL_WRITE,
(void *)&zclSampleLight_LevelOnOffTransitionTime
}
},
{
ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL,
{ // Attribute record
ATTRID_LEVEL_ON_LEVEL,
ZCL_DATATYPE_UINT8,
ACCESS_CONTROL_READ | ACCESS_CONTROL_WRITE,
(void *)&zclSampleLight_LevelOnLevel
}
},
{
ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL,
{ // Attribute record
ATTRID_LEVEL_ON_TRANSITION_TIME,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ | ACCESS_CONTROL_WRITE,
(void *)&zclSampleLight_LevelOnTransitionTime
}
},
{
ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL,
{ // Attribute record
ATTRID_LEVEL_OFF_TRANSITION_TIME,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ | ACCESS_CONTROL_WRITE,
(void *)&zclSampleLight_LevelOffTransitionTime
}
},
{
ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL,
{ // Attribute record
ATTRID_LEVEL_DEFAULT_MOVE_RATE,
ZCL_DATATYPE_UINT8,
ACCESS_CONTROL_READ | ACCESS_CONTROL_WRITE,
(void *)&zclSampleLight_LevelDefaultMoveRate
}
}
#endif
#ifdef ZCL_DIAGNOSTIC
, {
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_NUMBER_OF_RESETS,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_PERSISTENT_MEMORY_WRITES,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_MAC_RX_BCAST,
ZCL_DATATYPE_UINT32,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_MAC_TX_BCAST,
ZCL_DATATYPE_UINT32,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_MAC_RX_UCAST,
ZCL_DATATYPE_UINT32,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_MAC_TX_UCAST,
ZCL_DATATYPE_UINT32,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_MAC_TX_UCAST_RETRY,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_MAC_TX_UCAST_FAIL,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_APS_RX_BCAST,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_APS_TX_BCAST,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_APS_RX_UCAST,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_APS_TX_UCAST_SUCCESS,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_APS_TX_UCAST_RETRY,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_APS_TX_UCAST_FAIL,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_ROUTE_DISC_INITIATED,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_NEIGHBOR_ADDED,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_NEIGHBOR_REMOVED,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_NEIGHBOR_STALE,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_JOIN_INDICATION,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_CHILD_MOVED,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_NWK_FC_FAILURE,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_APS_FC_FAILURE,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_APS_UNAUTHORIZED_KEY,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_NWK_DECRYPT_FAILURES,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_APS_DECRYPT_FAILURES,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_PACKET_BUFFER_ALLOCATE_FAILURES,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_RELAYED_UCAST,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_PHY_TO_MAC_QUEUE_LIMIT_REACHED,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_PACKET_VALIDATE_DROP_COUNT,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_AVERAGE_MAC_RETRY_PER_APS_MESSAGE_SENT,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_LAST_MESSAGE_LQI,
ZCL_DATATYPE_UINT8,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
{
ZCL_CLUSTER_ID_HA_DIAGNOSTIC,
{ // Attribute record
ATTRID_DIAGNOSTIC_LAST_MESSAGE_RSSI,
ZCL_DATATYPE_INT8,
ACCESS_CONTROL_READ,
NULL // Use application's callback to Read this attribute
}
},
#endif // ZCL_DIAGNOSTIC
};
uint8 CONST zclSampleLight_NumAttributes = ( sizeof(zclSampleLight_Attrs) / sizeof(zclSampleLight_Attrs[0]) );
/*********************************************************************
* SIMPLE DESCRIPTOR
*/
// This is the Cluster ID List and should be filled with Application
// specific cluster IDs.
const cId_t zclSampleLight_InClusterList[] =
{
ZCL_CLUSTER_ID_GEN_BASIC,
ZCL_CLUSTER_ID_GEN_IDENTIFY,
ZCL_CLUSTER_ID_GEN_GROUPS,
ZCL_CLUSTER_ID_GEN_SCENES,
ZCL_CLUSTER_ID_GEN_ON_OFF
#ifdef ZCL_LEVEL_CTRL
, ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL
#endif
};
// work-around for compiler bug... IAR can't calculate size of array with #if options.
#ifdef ZCL_LEVEL_CTRL
#define ZCLSAMPLELIGHT_MAX_INCLUSTERS 6
#else
#define ZCLSAMPLELIGHT_MAX_INCLUSTERS 5
#endif
const cId_t zclSampleLight_OutClusterList[] =
{
ZCL_CLUSTER_ID_GEN_BASIC
};
#define ZCLSAMPLELIGHT_MAX_OUTCLUSTERS (sizeof(zclSampleLight_OutClusterList) / sizeof(zclSampleLight_OutClusterList[0]))
SimpleDescriptionFormat_t zclSampleLight_SimpleDesc =
{
SAMPLELIGHT_ENDPOINT, // int Endpoint;
ZCL_HA_PROFILE_ID, // uint16 AppProfId;
#ifdef ZCL_LEVEL_CTRL
ZCL_HA_DEVICEID_DIMMABLE_LIGHT, // uint16 AppDeviceId;
#else
ZCL_HA_DEVICEID_ON_OFF_LIGHT, // uint16 AppDeviceId;
#endif
SAMPLELIGHT_DEVICE_VERSION, // int AppDevVer:4;
SAMPLELIGHT_FLAGS, // int AppFlags:4;
ZCLSAMPLELIGHT_MAX_INCLUSTERS, // byte AppNumInClusters;
(cId_t *)zclSampleLight_InClusterList, // byte *pAppInClusterList;
ZCLSAMPLELIGHT_MAX_OUTCLUSTERS, // byte AppNumInClusters;
(cId_t *)zclSampleLight_OutClusterList // byte *pAppInClusterList;
};
/*********************************************************************
* GLOBAL FUNCTIONS
*/
/*********************************************************************
* LOCAL FUNCTIONS
*/
/****************************************************************************
****************************************************************************/