Skip to content

Commit a7c59e2

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, all-clusters-minimal-app, and one of the chef contact sensors 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 9032548 commit a7c59e2

File tree

61 files changed

+5155
-282
lines changed

Some content is hidden

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

61 files changed

+5155
-282
lines changed

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

+25
Original file line numberDiff line numberDiff line change
@@ -6949,6 +6949,7 @@ internal cluster UnitTesting = 4294048773 {
69496949
SimpleBitmap f = 5;
69506950
single g = 6;
69516951
double h = 7;
6952+
optional TestGlobalEnum i = 8;
69526953
}
69536954

69546955
fabric_scoped struct TestFabricScoped {
@@ -6981,6 +6982,7 @@ internal cluster UnitTesting = 4294048773 {
69816982
int8u a = 0;
69826983
boolean b = 1;
69836984
SimpleStruct c = 2;
6985+
optional TestGlobalStruct d = 3;
69846986
}
69856987

69866988
struct NestedStructList {
@@ -7066,6 +7068,8 @@ internal cluster UnitTesting = 4294048773 {
70667068
timedwrite attribute boolean timedWriteBoolean = 48;
70677069
attribute boolean generalErrorBoolean = 49;
70687070
attribute boolean clusterErrorBoolean = 50;
7071+
attribute TestGlobalEnum globalEnum = 51;
7072+
attribute TestGlobalStruct globalStruct = 52;
70697073
attribute optional boolean unsupported = 255;
70707074
attribute nullable boolean nullableBoolean = 16384;
70717075
attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385;
@@ -7101,6 +7105,8 @@ internal cluster UnitTesting = 4294048773 {
71017105
attribute nullable int16u nullableRangeRestrictedInt16u = 16424;
71027106
attribute nullable int16s nullableRangeRestrictedInt16s = 16425;
71037107
attribute optional int8u writeOnlyInt8u = 16426;
7108+
attribute nullable TestGlobalEnum nullableGlobalEnum = 16435;
7109+
attribute nullable TestGlobalStruct nullableGlobalStruct = 16436;
71047110
attribute int8u meiInt8u = 4294070017;
71057111
readonly attribute command_id generatedCommandList[] = 65528;
71067112
readonly attribute command_id acceptedCommandList[] = 65529;
@@ -7252,6 +7258,11 @@ internal cluster UnitTesting = 4294048773 {
72527258
SimpleEnum arg2 = 1;
72537259
}
72547260

7261+
response struct GlobalEchoResponse = 14 {
7262+
TestGlobalStruct field1 = 0;
7263+
TestGlobalEnum field2 = 1;
7264+
}
7265+
72557266
request struct TestNullableOptionalRequestRequest {
72567267
optional nullable int8u arg1 = 0;
72577268
}
@@ -7305,6 +7316,11 @@ internal cluster UnitTesting = 4294048773 {
73057316
octet_string payload = 0;
73067317
}
73077318

7319+
request struct GlobalEchoRequestRequest {
7320+
TestGlobalStruct field1 = 0;
7321+
TestGlobalEnum field2 = 1;
7322+
}
7323+
73087324
request struct TestDifferentVendorMeiRequestRequest {
73097325
int8u arg1 = 0;
73107326
}
@@ -7388,6 +7404,9 @@ internal cluster UnitTesting = 4294048773 {
73887404
the string back. If the string is large then it would require a session that
73897405
supports large payloads. */
73907406
command StringEchoRequest(StringEchoRequestRequest): StringEchoResponse = 24;
7407+
/** Command that takes arguments that are global structs/enums and the
7408+
response just echoes them back. */
7409+
command GlobalEchoRequest(GlobalEchoRequestRequest): GlobalEchoResponse = 25;
73917410
/** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */
73927411
command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962;
73937412
}
@@ -9274,6 +9293,8 @@ endpoint 1 {
92749293
ram attribute timedWriteBoolean;
92759294
callback attribute generalErrorBoolean;
92769295
callback attribute clusterErrorBoolean;
9296+
ram attribute globalEnum;
9297+
callback attribute globalStruct;
92779298
ram attribute nullableBoolean default = false;
92789299
ram attribute nullableBitmap8 default = 0;
92799300
ram attribute nullableBitmap16 default = 0;
@@ -9308,6 +9329,8 @@ endpoint 1 {
93089329
ram attribute nullableRangeRestrictedInt16u default = 200;
93099330
ram attribute nullableRangeRestrictedInt16s default = -100;
93109331
callback attribute writeOnlyInt8u default = 0;
9332+
ram attribute nullableGlobalEnum;
9333+
callback attribute nullableGlobalStruct;
93119334
ram attribute featureMap default = 0;
93129335
ram attribute clusterRevision default = 1;
93139336
ram attribute meiInt8u default = 0;
@@ -9333,6 +9356,7 @@ endpoint 1 {
93339356
handle command TestListInt8UReverseRequest;
93349357
handle command StringEchoResponse;
93359358
handle command TestEnumsRequest;
9359+
handle command GlobalEchoResponse;
93369360
handle command TestNullableOptionalRequest;
93379361
handle command SimpleStructEchoRequest;
93389362
handle command TimedInvokeRequest;
@@ -9342,6 +9366,7 @@ endpoint 1 {
93429366
handle command TestBatchHelperRequest;
93439367
handle command TestSecondBatchHelperRequest;
93449368
handle command StringEchoRequest;
9369+
handle command GlobalEchoRequest;
93459370
handle command TestDifferentVendorMeiRequest;
93469371
handle command TestDifferentVendorMeiResponse;
93479372
}

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

+25
Original file line numberDiff line numberDiff line change
@@ -5540,6 +5540,7 @@ internal cluster UnitTesting = 4294048773 {
55405540
SimpleBitmap f = 5;
55415541
single g = 6;
55425542
double h = 7;
5543+
optional TestGlobalEnum i = 8;
55435544
}
55445545

55455546
fabric_scoped struct TestFabricScoped {
@@ -5572,6 +5573,7 @@ internal cluster UnitTesting = 4294048773 {
55725573
int8u a = 0;
55735574
boolean b = 1;
55745575
SimpleStruct c = 2;
5576+
optional TestGlobalStruct d = 3;
55755577
}
55765578

55775579
struct NestedStructList {
@@ -5657,6 +5659,8 @@ internal cluster UnitTesting = 4294048773 {
56575659
timedwrite attribute boolean timedWriteBoolean = 48;
56585660
attribute boolean generalErrorBoolean = 49;
56595661
attribute boolean clusterErrorBoolean = 50;
5662+
attribute TestGlobalEnum globalEnum = 51;
5663+
attribute TestGlobalStruct globalStruct = 52;
56605664
attribute optional boolean unsupported = 255;
56615665
attribute nullable boolean nullableBoolean = 16384;
56625666
attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385;
@@ -5692,6 +5696,8 @@ internal cluster UnitTesting = 4294048773 {
56925696
attribute nullable int16u nullableRangeRestrictedInt16u = 16424;
56935697
attribute nullable int16s nullableRangeRestrictedInt16s = 16425;
56945698
attribute optional int8u writeOnlyInt8u = 16426;
5699+
attribute nullable TestGlobalEnum nullableGlobalEnum = 16435;
5700+
attribute nullable TestGlobalStruct nullableGlobalStruct = 16436;
56955701
attribute int8u meiInt8u = 4294070017;
56965702
readonly attribute command_id generatedCommandList[] = 65528;
56975703
readonly attribute command_id acceptedCommandList[] = 65529;
@@ -5843,6 +5849,11 @@ internal cluster UnitTesting = 4294048773 {
58435849
SimpleEnum arg2 = 1;
58445850
}
58455851

5852+
response struct GlobalEchoResponse = 14 {
5853+
TestGlobalStruct field1 = 0;
5854+
TestGlobalEnum field2 = 1;
5855+
}
5856+
58465857
request struct TestNullableOptionalRequestRequest {
58475858
optional nullable int8u arg1 = 0;
58485859
}
@@ -5896,6 +5907,11 @@ internal cluster UnitTesting = 4294048773 {
58965907
octet_string payload = 0;
58975908
}
58985909

5910+
request struct GlobalEchoRequestRequest {
5911+
TestGlobalStruct field1 = 0;
5912+
TestGlobalEnum field2 = 1;
5913+
}
5914+
58995915
request struct TestDifferentVendorMeiRequestRequest {
59005916
int8u arg1 = 0;
59015917
}
@@ -5979,6 +5995,9 @@ internal cluster UnitTesting = 4294048773 {
59795995
the string back. If the string is large then it would require a session that
59805996
supports large payloads. */
59815997
command StringEchoRequest(StringEchoRequestRequest): StringEchoResponse = 24;
5998+
/** Command that takes arguments that are global structs/enums and the
5999+
response just echoes them back. */
6000+
command GlobalEchoRequest(GlobalEchoRequestRequest): GlobalEchoResponse = 25;
59826001
/** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */
59836002
command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962;
59846003
}
@@ -6840,6 +6859,8 @@ endpoint 1 {
68406859
ram attribute timedWriteBoolean;
68416860
callback attribute generalErrorBoolean;
68426861
callback attribute clusterErrorBoolean;
6862+
ram attribute globalEnum;
6863+
callback attribute globalStruct;
68436864
ram attribute nullableBoolean default = false;
68446865
ram attribute nullableBitmap8 default = 0;
68456866
ram attribute nullableBitmap16 default = 0;
@@ -6874,6 +6895,8 @@ endpoint 1 {
68746895
ram attribute nullableRangeRestrictedInt16u default = 200;
68756896
ram attribute nullableRangeRestrictedInt16s default = -100;
68766897
callback attribute writeOnlyInt8u default = 0;
6898+
ram attribute nullableGlobalEnum;
6899+
callback attribute nullableGlobalStruct;
68776900
ram attribute featureMap default = 0;
68786901
ram attribute clusterRevision default = 1;
68796902
ram attribute meiInt8u default = 0;
@@ -6899,6 +6922,7 @@ endpoint 1 {
68996922
handle command TestListInt8UReverseRequest;
69006923
handle command StringEchoResponse;
69016924
handle command TestEnumsRequest;
6925+
handle command GlobalEchoResponse;
69026926
handle command TestNullableOptionalRequest;
69036927
handle command SimpleStructEchoRequest;
69046928
handle command TimedInvokeRequest;
@@ -6908,6 +6932,7 @@ endpoint 1 {
69086932
handle command TestBatchHelperRequest;
69096933
handle command TestSecondBatchHelperRequest;
69106934
handle command StringEchoRequest;
6935+
handle command GlobalEchoRequest;
69116936
handle command TestDifferentVendorMeiRequest;
69126937
handle command TestDifferentVendorMeiResponse;
69136938
}

0 commit comments

Comments
 (0)