Skip to content

Commit a979184

Browse files
Add some bits to exercise global structs/enums to Unit Testing cluster.
* Adds things to the Unit Testing cluster XML. * This requires those things to be enabled in all-clusters-app to pass CI. * That requires an implementation in test-cluster-server * At which point might as well add a YAML test to exercise it all.
1 parent 2ccd653 commit a979184

File tree

58 files changed

+4836
-272
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+4836
-272
lines changed

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

+25
Original file line numberDiff line numberDiff line change
@@ -6927,6 +6927,7 @@ internal cluster UnitTesting = 4294048773 {
69276927
SimpleBitmap f = 5;
69286928
single g = 6;
69296929
double h = 7;
6930+
optional TestGlobalEnum i = 8;
69306931
}
69316932

69326933
fabric_scoped struct TestFabricScoped {
@@ -6959,6 +6960,7 @@ internal cluster UnitTesting = 4294048773 {
69596960
int8u a = 0;
69606961
boolean b = 1;
69616962
SimpleStruct c = 2;
6963+
optional TestGlobalStruct d = 3;
69626964
}
69636965

69646966
struct NestedStructList {
@@ -7044,6 +7046,8 @@ internal cluster UnitTesting = 4294048773 {
70447046
timedwrite attribute boolean timedWriteBoolean = 48;
70457047
attribute boolean generalErrorBoolean = 49;
70467048
attribute boolean clusterErrorBoolean = 50;
7049+
attribute TestGlobalEnum globalEnum = 51;
7050+
attribute TestGlobalStruct globalStruct = 52;
70477051
attribute optional boolean unsupported = 255;
70487052
attribute nullable boolean nullableBoolean = 16384;
70497053
attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385;
@@ -7079,6 +7083,8 @@ internal cluster UnitTesting = 4294048773 {
70797083
attribute nullable int16u nullableRangeRestrictedInt16u = 16424;
70807084
attribute nullable int16s nullableRangeRestrictedInt16s = 16425;
70817085
attribute optional int8u writeOnlyInt8u = 16426;
7086+
attribute nullable TestGlobalEnum nullableGlobalEnum = 16435;
7087+
attribute nullable TestGlobalStruct nullableGlobalStruct = 16436;
70827088
attribute int8u meiInt8u = 4294070017;
70837089
readonly attribute command_id generatedCommandList[] = 65528;
70847090
readonly attribute command_id acceptedCommandList[] = 65529;
@@ -7230,6 +7236,11 @@ internal cluster UnitTesting = 4294048773 {
72307236
SimpleEnum arg2 = 1;
72317237
}
72327238

7239+
response struct GlobalEchoResponse = 14 {
7240+
TestGlobalStruct field1 = 0;
7241+
TestGlobalEnum field2 = 1;
7242+
}
7243+
72337244
request struct TestNullableOptionalRequestRequest {
72347245
optional nullable int8u arg1 = 0;
72357246
}
@@ -7283,6 +7294,11 @@ internal cluster UnitTesting = 4294048773 {
72837294
octet_string payload = 0;
72847295
}
72857296

7297+
request struct GlobalEchoRequestRequest {
7298+
TestGlobalStruct field1 = 0;
7299+
TestGlobalEnum field2 = 1;
7300+
}
7301+
72867302
request struct TestDifferentVendorMeiRequestRequest {
72877303
int8u arg1 = 0;
72887304
}
@@ -7366,6 +7382,9 @@ internal cluster UnitTesting = 4294048773 {
73667382
the string back. If the string is large then it would require a session that
73677383
supports large payloads. */
73687384
command StringEchoRequest(StringEchoRequestRequest): StringEchoResponse = 24;
7385+
/** Command that takes arguments that are global structs/enums and the
7386+
response just echoes them back. */
7387+
command GlobalEchoRequest(GlobalEchoRequestRequest): GlobalEchoResponse = 25;
73697388
/** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */
73707389
command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962;
73717390
}
@@ -9252,6 +9271,8 @@ endpoint 1 {
92529271
ram attribute timedWriteBoolean;
92539272
callback attribute generalErrorBoolean;
92549273
callback attribute clusterErrorBoolean;
9274+
ram attribute globalEnum;
9275+
callback attribute globalStruct;
92559276
ram attribute nullableBoolean default = false;
92569277
ram attribute nullableBitmap8 default = 0;
92579278
ram attribute nullableBitmap16 default = 0;
@@ -9286,6 +9307,8 @@ endpoint 1 {
92869307
ram attribute nullableRangeRestrictedInt16u default = 200;
92879308
ram attribute nullableRangeRestrictedInt16s default = -100;
92889309
callback attribute writeOnlyInt8u default = 0;
9310+
ram attribute nullableGlobalEnum;
9311+
callback attribute nullableGlobalStruct;
92899312
ram attribute featureMap default = 0;
92909313
ram attribute clusterRevision default = 1;
92919314
ram attribute meiInt8u default = 0;
@@ -9311,6 +9334,7 @@ endpoint 1 {
93119334
handle command TestListInt8UReverseRequest;
93129335
handle command StringEchoResponse;
93139336
handle command TestEnumsRequest;
9337+
handle command GlobalEchoResponse;
93149338
handle command TestNullableOptionalRequest;
93159339
handle command SimpleStructEchoRequest;
93169340
handle command TimedInvokeRequest;
@@ -9320,6 +9344,7 @@ endpoint 1 {
93209344
handle command TestBatchHelperRequest;
93219345
handle command TestSecondBatchHelperRequest;
93229346
handle command StringEchoRequest;
9347+
handle command GlobalEchoRequest;
93239348
handle command TestDifferentVendorMeiRequest;
93249349
handle command TestDifferentVendorMeiResponse;
93259350
}

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

+80
Original file line numberDiff line numberDiff line change
@@ -22229,6 +22229,14 @@
2222922229
"isIncoming": 1,
2223022230
"isEnabled": 1
2223122231
},
22232+
{
22233+
"name": "GlobalEchoResponse",
22234+
"code": 14,
22235+
"mfgCode": null,
22236+
"source": "server",
22237+
"isIncoming": 0,
22238+
"isEnabled": 1
22239+
},
2223222240
{
2223322241
"name": "TestNullableOptionalRequest",
2223422242
"code": 15,
@@ -22301,6 +22309,14 @@
2230122309
"isIncoming": 1,
2230222310
"isEnabled": 1
2230322311
},
22312+
{
22313+
"name": "GlobalEchoRequest",
22314+
"code": 25,
22315+
"mfgCode": null,
22316+
"source": "client",
22317+
"isIncoming": 1,
22318+
"isEnabled": 1
22319+
},
2230422320
{
2230522321
"name": "TestDifferentVendorMeiRequest",
2230622322
"code": 4294049962,
@@ -23071,6 +23087,38 @@
2307123087
"maxInterval": 65534,
2307223088
"reportableChange": 0
2307323089
},
23090+
{
23091+
"name": "global_enum",
23092+
"code": 51,
23093+
"mfgCode": null,
23094+
"side": "server",
23095+
"type": "TestGlobalEnum",
23096+
"included": 1,
23097+
"storageOption": "RAM",
23098+
"singleton": 0,
23099+
"bounded": 0,
23100+
"defaultValue": "",
23101+
"reportable": 1,
23102+
"minInterval": 1,
23103+
"maxInterval": 65534,
23104+
"reportableChange": 0
23105+
},
23106+
{
23107+
"name": "global_struct",
23108+
"code": 52,
23109+
"mfgCode": null,
23110+
"side": "server",
23111+
"type": "TestGlobalStruct",
23112+
"included": 1,
23113+
"storageOption": "External",
23114+
"singleton": 0,
23115+
"bounded": 0,
23116+
"defaultValue": null,
23117+
"reportable": 1,
23118+
"minInterval": 1,
23119+
"maxInterval": 65534,
23120+
"reportableChange": 0
23121+
},
2307423122
{
2307523123
"name": "nullable_boolean",
2307623124
"code": 16384,
@@ -23615,6 +23663,38 @@
2361523663
"maxInterval": 65534,
2361623664
"reportableChange": 0
2361723665
},
23666+
{
23667+
"name": "nullable_global_enum",
23668+
"code": 16435,
23669+
"mfgCode": null,
23670+
"side": "server",
23671+
"type": "TestGlobalEnum",
23672+
"included": 1,
23673+
"storageOption": "RAM",
23674+
"singleton": 0,
23675+
"bounded": 0,
23676+
"defaultValue": "",
23677+
"reportable": 1,
23678+
"minInterval": 1,
23679+
"maxInterval": 65534,
23680+
"reportableChange": 0
23681+
},
23682+
{
23683+
"name": "nullable_global_struct",
23684+
"code": 16436,
23685+
"mfgCode": null,
23686+
"side": "server",
23687+
"type": "TestGlobalStruct",
23688+
"included": 1,
23689+
"storageOption": "External",
23690+
"singleton": 0,
23691+
"bounded": 0,
23692+
"defaultValue": null,
23693+
"reportable": 1,
23694+
"minInterval": 1,
23695+
"maxInterval": 65534,
23696+
"reportableChange": 0
23697+
},
2361823698
{
2361923699
"name": "FeatureMap",
2362023700
"code": 65532,

examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter

+19
Original file line numberDiff line numberDiff line change
@@ -5518,6 +5518,7 @@ internal cluster UnitTesting = 4294048773 {
55185518
SimpleBitmap f = 5;
55195519
single g = 6;
55205520
double h = 7;
5521+
optional TestGlobalEnum i = 8;
55215522
}
55225523

55235524
fabric_scoped struct TestFabricScoped {
@@ -5550,6 +5551,7 @@ internal cluster UnitTesting = 4294048773 {
55505551
int8u a = 0;
55515552
boolean b = 1;
55525553
SimpleStruct c = 2;
5554+
optional TestGlobalStruct d = 3;
55535555
}
55545556

55555557
struct NestedStructList {
@@ -5635,6 +5637,8 @@ internal cluster UnitTesting = 4294048773 {
56355637
timedwrite attribute boolean timedWriteBoolean = 48;
56365638
attribute boolean generalErrorBoolean = 49;
56375639
attribute boolean clusterErrorBoolean = 50;
5640+
attribute TestGlobalEnum globalEnum = 51;
5641+
attribute TestGlobalStruct globalStruct = 52;
56385642
attribute optional boolean unsupported = 255;
56395643
attribute nullable boolean nullableBoolean = 16384;
56405644
attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385;
@@ -5670,6 +5674,8 @@ internal cluster UnitTesting = 4294048773 {
56705674
attribute nullable int16u nullableRangeRestrictedInt16u = 16424;
56715675
attribute nullable int16s nullableRangeRestrictedInt16s = 16425;
56725676
attribute optional int8u writeOnlyInt8u = 16426;
5677+
attribute nullable TestGlobalEnum nullableGlobalEnum = 16435;
5678+
attribute nullable TestGlobalStruct nullableGlobalStruct = 16436;
56735679
attribute int8u meiInt8u = 4294070017;
56745680
readonly attribute command_id generatedCommandList[] = 65528;
56755681
readonly attribute command_id acceptedCommandList[] = 65529;
@@ -5821,6 +5827,11 @@ internal cluster UnitTesting = 4294048773 {
58215827
SimpleEnum arg2 = 1;
58225828
}
58235829

5830+
response struct GlobalEchoResponse = 14 {
5831+
TestGlobalStruct field1 = 0;
5832+
TestGlobalEnum field2 = 1;
5833+
}
5834+
58245835
request struct TestNullableOptionalRequestRequest {
58255836
optional nullable int8u arg1 = 0;
58265837
}
@@ -5874,6 +5885,11 @@ internal cluster UnitTesting = 4294048773 {
58745885
octet_string payload = 0;
58755886
}
58765887

5888+
request struct GlobalEchoRequestRequest {
5889+
TestGlobalStruct field1 = 0;
5890+
TestGlobalEnum field2 = 1;
5891+
}
5892+
58775893
request struct TestDifferentVendorMeiRequestRequest {
58785894
int8u arg1 = 0;
58795895
}
@@ -5957,6 +5973,9 @@ internal cluster UnitTesting = 4294048773 {
59575973
the string back. If the string is large then it would require a session that
59585974
supports large payloads. */
59595975
command StringEchoRequest(StringEchoRequestRequest): StringEchoResponse = 24;
5976+
/** Command that takes arguments that are global structs/enums and the
5977+
response just echoes them back. */
5978+
command GlobalEchoRequest(GlobalEchoRequestRequest): GlobalEchoResponse = 25;
59605979
/** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */
59615980
command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962;
59625981
}

examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter

+19
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,7 @@ internal cluster UnitTesting = 4294048773 {
15481548
SimpleBitmap f = 5;
15491549
single g = 6;
15501550
double h = 7;
1551+
optional TestGlobalEnum i = 8;
15511552
}
15521553

15531554
fabric_scoped struct TestFabricScoped {
@@ -1580,6 +1581,7 @@ internal cluster UnitTesting = 4294048773 {
15801581
int8u a = 0;
15811582
boolean b = 1;
15821583
SimpleStruct c = 2;
1584+
optional TestGlobalStruct d = 3;
15831585
}
15841586

15851587
struct NestedStructList {
@@ -1665,6 +1667,8 @@ internal cluster UnitTesting = 4294048773 {
16651667
timedwrite attribute boolean timedWriteBoolean = 48;
16661668
attribute boolean generalErrorBoolean = 49;
16671669
attribute boolean clusterErrorBoolean = 50;
1670+
attribute TestGlobalEnum globalEnum = 51;
1671+
attribute TestGlobalStruct globalStruct = 52;
16681672
attribute optional boolean unsupported = 255;
16691673
attribute nullable boolean nullableBoolean = 16384;
16701674
attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385;
@@ -1700,6 +1704,8 @@ internal cluster UnitTesting = 4294048773 {
17001704
attribute nullable int16u nullableRangeRestrictedInt16u = 16424;
17011705
attribute nullable int16s nullableRangeRestrictedInt16s = 16425;
17021706
attribute optional int8u writeOnlyInt8u = 16426;
1707+
attribute nullable TestGlobalEnum nullableGlobalEnum = 16435;
1708+
attribute nullable TestGlobalStruct nullableGlobalStruct = 16436;
17031709
attribute int8u meiInt8u = 4294070017;
17041710
readonly attribute command_id generatedCommandList[] = 65528;
17051711
readonly attribute command_id acceptedCommandList[] = 65529;
@@ -1851,6 +1857,11 @@ internal cluster UnitTesting = 4294048773 {
18511857
SimpleEnum arg2 = 1;
18521858
}
18531859

1860+
response struct GlobalEchoResponse = 14 {
1861+
TestGlobalStruct field1 = 0;
1862+
TestGlobalEnum field2 = 1;
1863+
}
1864+
18541865
request struct TestNullableOptionalRequestRequest {
18551866
optional nullable int8u arg1 = 0;
18561867
}
@@ -1904,6 +1915,11 @@ internal cluster UnitTesting = 4294048773 {
19041915
octet_string payload = 0;
19051916
}
19061917

1918+
request struct GlobalEchoRequestRequest {
1919+
TestGlobalStruct field1 = 0;
1920+
TestGlobalEnum field2 = 1;
1921+
}
1922+
19071923
request struct TestDifferentVendorMeiRequestRequest {
19081924
int8u arg1 = 0;
19091925
}
@@ -1987,6 +2003,9 @@ internal cluster UnitTesting = 4294048773 {
19872003
the string back. If the string is large then it would require a session that
19882004
supports large payloads. */
19892005
command StringEchoRequest(StringEchoRequestRequest): StringEchoResponse = 24;
2006+
/** Command that takes arguments that are global structs/enums and the
2007+
response just echoes them back. */
2008+
command GlobalEchoRequest(GlobalEchoRequestRequest): GlobalEchoResponse = 25;
19902009
/** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */
19912010
command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962;
19922011
}

0 commit comments

Comments
 (0)