Skip to content

Commit 3947223

Browse files
vivien-applepull[bot]
authored andcommitted
Extract OnOff cluster definition from general.xml and zll.xml (#8330)
* Extract OnOff cluster definition from general.xml and zll.xml to have it into its own file and reformat it to make it easier to read when comparing to the spec * Update some attributes name into the tests file to match the name update in onoff.xml * Update zap files to takes into account the names changes, as well as the Cluster Revision change * Use as[Upper/Lower]CamelCase instead of asCamelCased for src/darwin/Framework/CHIP/templates * Update gen/ folders
1 parent 6b4388b commit 3947223

File tree

36 files changed

+925
-235
lines changed

36 files changed

+925
-235
lines changed

examples/all-clusters-app/all-clusters-common/all-clusters-app.zap

+83-8
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@
572572
"commands": [],
573573
"attributes": [
574574
{
575-
"name": "on/off",
575+
"name": "OnOff",
576576
"code": 0,
577577
"mfgCode": null,
578578
"side": "server",
@@ -6602,7 +6602,7 @@
66026602
"commands": [],
66036603
"attributes": [
66046604
{
6605-
"name": "on/off",
6605+
"name": "OnOff",
66066606
"code": 0,
66076607
"mfgCode": null,
66086608
"side": "server",
@@ -6617,7 +6617,7 @@
66176617
"reportableChange": 0
66186618
},
66196619
{
6620-
"name": "global scene control",
6620+
"name": "GlobalSceneControl",
66216621
"code": 16384,
66226622
"mfgCode": null,
66236623
"side": "server",
@@ -6632,7 +6632,7 @@
66326632
"reportableChange": 0
66336633
},
66346634
{
6635-
"name": "on time",
6635+
"name": "OnTime",
66366636
"code": 16385,
66376637
"mfgCode": null,
66386638
"side": "server",
@@ -6647,7 +6647,7 @@
66476647
"reportableChange": 0
66486648
},
66496649
{
6650-
"name": "off wait time",
6650+
"name": "OffWaitTime",
66516651
"code": 16386,
66526652
"mfgCode": null,
66536653
"side": "server",
@@ -6662,7 +6662,7 @@
66626662
"reportableChange": 0
66636663
},
66646664
{
6665-
"name": "start up on off",
6665+
"name": "StartUpOnOff",
66666666
"code": 16387,
66676667
"mfgCode": null,
66686668
"side": "server",
@@ -6700,7 +6700,7 @@
67006700
"storageOption": "RAM",
67016701
"singleton": 0,
67026702
"bounded": 0,
6703-
"defaultValue": "2",
6703+
"defaultValue": "3",
67046704
"reportable": 0,
67056705
"minInterval": 0,
67066706
"maxInterval": 65344,
@@ -14167,7 +14167,7 @@
1416714167
"commands": [],
1416814168
"attributes": [
1416914169
{
14170-
"name": "on/off",
14170+
"name": "OnOff",
1417114171
"code": 0,
1417214172
"mfgCode": null,
1417314173
"side": "server",
@@ -14181,6 +14181,81 @@
1418114181
"maxInterval": 65344,
1418214182
"reportableChange": 0
1418314183
},
14184+
{
14185+
"name": "GlobalSceneControl",
14186+
"code": 16384,
14187+
"mfgCode": null,
14188+
"side": "server",
14189+
"included": 1,
14190+
"storageOption": "RAM",
14191+
"singleton": 0,
14192+
"bounded": 0,
14193+
"defaultValue": "1",
14194+
"reportable": 0,
14195+
"minInterval": 0,
14196+
"maxInterval": 65344,
14197+
"reportableChange": 0
14198+
},
14199+
{
14200+
"name": "OnTime",
14201+
"code": 16385,
14202+
"mfgCode": null,
14203+
"side": "server",
14204+
"included": 1,
14205+
"storageOption": "RAM",
14206+
"singleton": 0,
14207+
"bounded": 0,
14208+
"defaultValue": "0",
14209+
"reportable": 0,
14210+
"minInterval": 0,
14211+
"maxInterval": 65344,
14212+
"reportableChange": 0
14213+
},
14214+
{
14215+
"name": "OffWaitTime",
14216+
"code": 16386,
14217+
"mfgCode": null,
14218+
"side": "server",
14219+
"included": 1,
14220+
"storageOption": "RAM",
14221+
"singleton": 0,
14222+
"bounded": 0,
14223+
"defaultValue": "0",
14224+
"reportable": 0,
14225+
"minInterval": 0,
14226+
"maxInterval": 65344,
14227+
"reportableChange": 0
14228+
},
14229+
{
14230+
"name": "StartUpOnOff",
14231+
"code": 16387,
14232+
"mfgCode": null,
14233+
"side": "server",
14234+
"included": 1,
14235+
"storageOption": "RAM",
14236+
"singleton": 0,
14237+
"bounded": 0,
14238+
"defaultValue": "",
14239+
"reportable": 0,
14240+
"minInterval": 0,
14241+
"maxInterval": 65344,
14242+
"reportableChange": 0
14243+
},
14244+
{
14245+
"name": "feature map",
14246+
"code": 65532,
14247+
"mfgCode": null,
14248+
"side": "server",
14249+
"included": 1,
14250+
"storageOption": "RAM",
14251+
"singleton": 0,
14252+
"bounded": 0,
14253+
"defaultValue": "0x0000",
14254+
"reportable": 0,
14255+
"minInterval": 0,
14256+
"maxInterval": 65344,
14257+
"reportableChange": 0
14258+
},
1418414259
{
1418514260
"name": "cluster revision",
1418614261
"code": 65533,

examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h

+32-17
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,11 @@
956956
0x00, 0x00, 0x00, 0x00, \
957957
\
958958
/* 10414 - total active power, */ \
959+
0x00, 0x00, 0x00, 0x00, \
960+
\
961+
/* Endpoint: 2, Cluster: On/off (server), big-endian */ \
962+
\
963+
/* 10418 - feature map, */ \
959964
0x00, 0x00, 0x00, 0x00, \
960965
}
961966

@@ -1892,12 +1897,17 @@
18921897
0x00, 0x00, 0x00, 0x00, \
18931898
\
18941899
/* 10414 - total active power, */ \
1900+
0x00, 0x00, 0x00, 0x00, \
1901+
\
1902+
/* Endpoint: 2, Cluster: On/off (server), little-endian */ \
1903+
\
1904+
/* 10418 - feature map, */ \
18951905
0x00, 0x00, 0x00, 0x00, \
18961906
}
18971907

18981908
#endif // BIGENDIAN_CPU
18991909

1900-
#define GENERATED_DEFAULTS_COUNT (126)
1910+
#define GENERATED_DEFAULTS_COUNT (127)
19011911

19021912
#define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE
19031913
#define ZAP_LONG_DEFAULTS_INDEX(index) \
@@ -1925,7 +1935,7 @@
19251935

19261936
#define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask
19271937
// This is an array of EmberAfAttributeMetadata structures.
1928-
#define GENERATED_ATTRIBUTE_COUNT 369
1938+
#define GENERATED_ATTRIBUTE_COUNT 374
19291939
#define GENERATED_ATTRIBUTES \
19301940
{ \
19311941
\
@@ -2106,13 +2116,13 @@
21062116
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* cluster revision */ \
21072117
\
21082118
/* Endpoint: 1, Cluster: On/off (server) */ \
2109-
{ 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* on/off */ \
2110-
{ 0x4000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* global scene control */ \
2111-
{ 0x4001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* on time */ \
2112-
{ 0x4002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* off wait time */ \
2113-
{ 0x4003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* start up on off */ \
2119+
{ 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* OnOff */ \
2120+
{ 0x4000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* GlobalSceneControl */ \
2121+
{ 0x4001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OnTime */ \
2122+
{ 0x4002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OffWaitTime */ \
2123+
{ 0x4003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \
21142124
{ 0xFFFC, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3482) }, /* feature map */ \
2115-
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* cluster revision */ \
2125+
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* cluster revision */ \
21162126
\
21172127
/* Endpoint: 1, Cluster: Level Control (server) */ \
21182128
{ 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current level */ \
@@ -2416,8 +2426,13 @@
24162426
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \
24172427
\
24182428
/* Endpoint: 2, Cluster: On/off (server) */ \
2419-
{ 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* on/off */ \
2420-
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* cluster revision */ \
2429+
{ 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* OnOff */ \
2430+
{ 0x4000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(1) }, /* GlobalSceneControl */ \
2431+
{ 0x4001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OnTime */ \
2432+
{ 0x4002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OffWaitTime */ \
2433+
{ 0x4003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \
2434+
{ 0xFFFC, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(10418) }, /* feature map */ \
2435+
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* cluster revision */ \
24212436
\
24222437
/* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \
24232438
{ 0x0000, ZAP_TYPE(BITMAP8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* occupancy */ \
@@ -2667,12 +2682,12 @@
26672682
}, /* Endpoint: 1, Cluster: Binding (server) */ \
26682683
{ 0x0006, \
26692684
ZAP_ATTRIBUTE_INDEX(363), \
2670-
2, \
2671-
3, \
2685+
7, \
2686+
13, \
26722687
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
26732688
chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/off (server) */ \
26742689
{ 0x0406, \
2675-
ZAP_ATTRIBUTE_INDEX(365), \
2690+
ZAP_ATTRIBUTE_INDEX(370), \
26762691
4, \
26772692
5, \
26782693
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
@@ -2684,7 +2699,7 @@
26842699
// This is an array of EmberAfEndpointType structures.
26852700
#define GENERATED_ENDPOINT_TYPES \
26862701
{ \
2687-
{ ZAP_CLUSTER_INDEX(0), 15, 3560 }, { ZAP_CLUSTER_INDEX(15), 37, 7252 }, { ZAP_CLUSTER_INDEX(52), 2, 8 }, \
2702+
{ ZAP_CLUSTER_INDEX(0), 15, 3560 }, { ZAP_CLUSTER_INDEX(15), 37, 7252 }, { ZAP_CLUSTER_INDEX(52), 2, 18 }, \
26882703
}
26892704

26902705
// Largest attribute size is needed for various buffers
@@ -2694,7 +2709,7 @@
26942709
#define ATTRIBUTE_SINGLETONS_SIZE (1497)
26952710

26962711
// Total size of attribute storage
2697-
#define ATTRIBUTE_MAX_SIZE (10820)
2712+
#define ATTRIBUTE_MAX_SIZE (10830)
26982713

26992714
// Number of fixed endpoints
27002715
#define FIXED_ENDPOINT_COUNT (3)
@@ -3068,7 +3083,7 @@
30683083
/* Endpoint: 1, Cluster: On/off (server) */ \
30693084
{ \
30703085
ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0006, 0x0000, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \
3071-
}, /* on/off */ \
3086+
}, /* OnOff */ \
30723087
\
30733088
/* Endpoint: 1, Cluster: Level Control (server) */ \
30743089
{ \
@@ -3208,7 +3223,7 @@
32083223
/* Endpoint: 2, Cluster: On/off (server) */ \
32093224
{ \
32103225
ZAP_REPORT_DIRECTION(REPORTED), 0x0002, 0x0006, 0x0000, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \
3211-
}, /* on/off */ \
3226+
}, /* OnOff */ \
32123227
\
32133228
/* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \
32143229
{ \

examples/bridge-app/bridge-common/gen/endpoint_config.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@
881881
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \
882882
\
883883
/* Endpoint: 1, Cluster: On/off (server) */ \
884-
{ 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* on/off */ \
884+
{ 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* OnOff */ \
885885
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* cluster revision */ \
886886
\
887887
/* Endpoint: 1, Cluster: Level Control (server) */ \
@@ -1140,7 +1140,7 @@
11401140
/* Endpoint: 1, Cluster: On/off (server) */ \
11411141
{ \
11421142
ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0006, 0x0000, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \
1143-
}, /* on/off */ \
1143+
}, /* OnOff */ \
11441144
\
11451145
/* Endpoint: 1, Cluster: Level Control (server) */ \
11461146
{ \

0 commit comments

Comments
 (0)