Add some bits to exercise global structs/enums to Unit Testing cluster. (#34540)
* 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.
diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
index 3dd2b0f..f69ed20 100644
--- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
+++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
@@ -6949,6 +6949,7 @@
SimpleBitmap f = 5;
single g = 6;
double h = 7;
+ optional TestGlobalEnum i = 8;
}
fabric_scoped struct TestFabricScoped {
@@ -6981,6 +6982,7 @@
int8u a = 0;
boolean b = 1;
SimpleStruct c = 2;
+ optional TestGlobalStruct d = 3;
}
struct NestedStructList {
@@ -7066,6 +7068,8 @@
timedwrite attribute boolean timedWriteBoolean = 48;
attribute boolean generalErrorBoolean = 49;
attribute boolean clusterErrorBoolean = 50;
+ attribute TestGlobalEnum globalEnum = 51;
+ attribute TestGlobalStruct globalStruct = 52;
attribute optional boolean unsupported = 255;
attribute nullable boolean nullableBoolean = 16384;
attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385;
@@ -7101,6 +7105,8 @@
attribute nullable int16u nullableRangeRestrictedInt16u = 16424;
attribute nullable int16s nullableRangeRestrictedInt16s = 16425;
attribute optional int8u writeOnlyInt8u = 16426;
+ attribute nullable TestGlobalEnum nullableGlobalEnum = 16435;
+ attribute nullable TestGlobalStruct nullableGlobalStruct = 16436;
attribute int8u meiInt8u = 4294070017;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
@@ -7252,6 +7258,11 @@
SimpleEnum arg2 = 1;
}
+ response struct GlobalEchoResponse = 14 {
+ TestGlobalStruct field1 = 0;
+ TestGlobalEnum field2 = 1;
+ }
+
request struct TestNullableOptionalRequestRequest {
optional nullable int8u arg1 = 0;
}
@@ -7305,6 +7316,11 @@
octet_string payload = 0;
}
+ request struct GlobalEchoRequestRequest {
+ TestGlobalStruct field1 = 0;
+ TestGlobalEnum field2 = 1;
+ }
+
request struct TestDifferentVendorMeiRequestRequest {
int8u arg1 = 0;
}
@@ -7388,6 +7404,9 @@
the string back. If the string is large then it would require a session that
supports large payloads. */
command StringEchoRequest(StringEchoRequestRequest): StringEchoResponse = 24;
+ /** Command that takes arguments that are global structs/enums and the
+ response just echoes them back. */
+ command GlobalEchoRequest(GlobalEchoRequestRequest): GlobalEchoResponse = 25;
/** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */
command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962;
}
@@ -9283,6 +9302,8 @@
ram attribute timedWriteBoolean;
callback attribute generalErrorBoolean;
callback attribute clusterErrorBoolean;
+ ram attribute globalEnum;
+ callback attribute globalStruct;
ram attribute nullableBoolean default = false;
ram attribute nullableBitmap8 default = 0;
ram attribute nullableBitmap16 default = 0;
@@ -9317,6 +9338,8 @@
ram attribute nullableRangeRestrictedInt16u default = 200;
ram attribute nullableRangeRestrictedInt16s default = -100;
callback attribute writeOnlyInt8u default = 0;
+ ram attribute nullableGlobalEnum;
+ callback attribute nullableGlobalStruct;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
ram attribute meiInt8u default = 0;
@@ -9342,6 +9365,7 @@
handle command TestListInt8UReverseRequest;
handle command StringEchoResponse;
handle command TestEnumsRequest;
+ handle command GlobalEchoResponse;
handle command TestNullableOptionalRequest;
handle command SimpleStructEchoRequest;
handle command TimedInvokeRequest;
@@ -9351,6 +9375,7 @@
handle command TestBatchHelperRequest;
handle command TestSecondBatchHelperRequest;
handle command StringEchoRequest;
+ handle command GlobalEchoRequest;
handle command TestDifferentVendorMeiRequest;
handle command TestDifferentVendorMeiResponse;
}
diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
index a052433..7b3ccf9 100644
--- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
+++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
@@ -22342,6 +22342,14 @@
"isEnabled": 1
},
{
+ "name": "GlobalEchoResponse",
+ "code": 14,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
"name": "TestNullableOptionalRequest",
"code": 15,
"mfgCode": null,
@@ -22414,6 +22422,14 @@
"isEnabled": 1
},
{
+ "name": "GlobalEchoRequest",
+ "code": 25,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
"name": "TestDifferentVendorMeiRequest",
"code": 4294049962,
"mfgCode": null,
@@ -23184,6 +23200,38 @@
"reportableChange": 0
},
{
+ "name": "global_enum",
+ "code": 51,
+ "mfgCode": null,
+ "side": "server",
+ "type": "TestGlobalEnum",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "global_struct",
+ "code": 52,
+ "mfgCode": null,
+ "side": "server",
+ "type": "TestGlobalStruct",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
"name": "nullable_boolean",
"code": 16384,
"mfgCode": null,
@@ -23728,6 +23776,38 @@
"reportableChange": 0
},
{
+ "name": "nullable_global_enum",
+ "code": 16435,
+ "mfgCode": null,
+ "side": "server",
+ "type": "TestGlobalEnum",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "nullable_global_struct",
+ "code": 16436,
+ "mfgCode": null,
+ "side": "server",
+ "type": "TestGlobalStruct",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
"name": "FeatureMap",
"code": 65532,
"mfgCode": null,
diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
index 4bf0d15..7db7a1c 100644
--- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
+++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
@@ -5540,6 +5540,7 @@
SimpleBitmap f = 5;
single g = 6;
double h = 7;
+ optional TestGlobalEnum i = 8;
}
fabric_scoped struct TestFabricScoped {
@@ -5572,6 +5573,7 @@
int8u a = 0;
boolean b = 1;
SimpleStruct c = 2;
+ optional TestGlobalStruct d = 3;
}
struct NestedStructList {
@@ -5657,6 +5659,8 @@
timedwrite attribute boolean timedWriteBoolean = 48;
attribute boolean generalErrorBoolean = 49;
attribute boolean clusterErrorBoolean = 50;
+ attribute TestGlobalEnum globalEnum = 51;
+ attribute TestGlobalStruct globalStruct = 52;
attribute optional boolean unsupported = 255;
attribute nullable boolean nullableBoolean = 16384;
attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385;
@@ -5692,6 +5696,8 @@
attribute nullable int16u nullableRangeRestrictedInt16u = 16424;
attribute nullable int16s nullableRangeRestrictedInt16s = 16425;
attribute optional int8u writeOnlyInt8u = 16426;
+ attribute nullable TestGlobalEnum nullableGlobalEnum = 16435;
+ attribute nullable TestGlobalStruct nullableGlobalStruct = 16436;
attribute int8u meiInt8u = 4294070017;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
@@ -5843,6 +5849,11 @@
SimpleEnum arg2 = 1;
}
+ response struct GlobalEchoResponse = 14 {
+ TestGlobalStruct field1 = 0;
+ TestGlobalEnum field2 = 1;
+ }
+
request struct TestNullableOptionalRequestRequest {
optional nullable int8u arg1 = 0;
}
@@ -5896,6 +5907,11 @@
octet_string payload = 0;
}
+ request struct GlobalEchoRequestRequest {
+ TestGlobalStruct field1 = 0;
+ TestGlobalEnum field2 = 1;
+ }
+
request struct TestDifferentVendorMeiRequestRequest {
int8u arg1 = 0;
}
@@ -5979,6 +5995,9 @@
the string back. If the string is large then it would require a session that
supports large payloads. */
command StringEchoRequest(StringEchoRequestRequest): StringEchoResponse = 24;
+ /** Command that takes arguments that are global structs/enums and the
+ response just echoes them back. */
+ command GlobalEchoRequest(GlobalEchoRequestRequest): GlobalEchoResponse = 25;
/** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */
command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962;
}
@@ -6840,6 +6859,8 @@
ram attribute timedWriteBoolean;
callback attribute generalErrorBoolean;
callback attribute clusterErrorBoolean;
+ ram attribute globalEnum;
+ callback attribute globalStruct;
ram attribute nullableBoolean default = false;
ram attribute nullableBitmap8 default = 0;
ram attribute nullableBitmap16 default = 0;
@@ -6874,6 +6895,8 @@
ram attribute nullableRangeRestrictedInt16u default = 200;
ram attribute nullableRangeRestrictedInt16s default = -100;
callback attribute writeOnlyInt8u default = 0;
+ ram attribute nullableGlobalEnum;
+ callback attribute nullableGlobalStruct;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
ram attribute meiInt8u default = 0;
@@ -6899,6 +6922,7 @@
handle command TestListInt8UReverseRequest;
handle command StringEchoResponse;
handle command TestEnumsRequest;
+ handle command GlobalEchoResponse;
handle command TestNullableOptionalRequest;
handle command SimpleStructEchoRequest;
handle command TimedInvokeRequest;
@@ -6908,6 +6932,7 @@
handle command TestBatchHelperRequest;
handle command TestSecondBatchHelperRequest;
handle command StringEchoRequest;
+ handle command GlobalEchoRequest;
handle command TestDifferentVendorMeiRequest;
handle command TestDifferentVendorMeiResponse;
}
diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap
index 57f2c04..560e95a 100644
--- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap
+++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap
@@ -9082,6 +9082,14 @@
"isEnabled": 1
},
{
+ "name": "GlobalEchoResponse",
+ "code": 14,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
"name": "TestNullableOptionalRequest",
"code": 15,
"mfgCode": null,
@@ -9154,6 +9162,14 @@
"isEnabled": 1
},
{
+ "name": "GlobalEchoRequest",
+ "code": 25,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
"name": "TestDifferentVendorMeiRequest",
"code": 4294049962,
"mfgCode": null,
@@ -9924,6 +9940,38 @@
"reportableChange": 0
},
{
+ "name": "global_enum",
+ "code": 51,
+ "mfgCode": null,
+ "side": "server",
+ "type": "TestGlobalEnum",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "global_struct",
+ "code": 52,
+ "mfgCode": null,
+ "side": "server",
+ "type": "TestGlobalStruct",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
"name": "nullable_boolean",
"code": 16384,
"mfgCode": null,
@@ -10468,6 +10516,38 @@
"reportableChange": 0
},
{
+ "name": "nullable_global_enum",
+ "code": 16435,
+ "mfgCode": null,
+ "side": "server",
+ "type": "TestGlobalEnum",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "nullable_global_struct",
+ "code": 16436,
+ "mfgCode": null,
+ "side": "server",
+ "type": "TestGlobalStruct",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
"name": "FeatureMap",
"code": 65532,
"mfgCode": null,
diff --git a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter
index 5735b2c..6e7ce6b 100644
--- a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter
+++ b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter
@@ -1570,6 +1570,7 @@
SimpleBitmap f = 5;
single g = 6;
double h = 7;
+ optional TestGlobalEnum i = 8;
}
fabric_scoped struct TestFabricScoped {
@@ -1602,6 +1603,7 @@
int8u a = 0;
boolean b = 1;
SimpleStruct c = 2;
+ optional TestGlobalStruct d = 3;
}
struct NestedStructList {
@@ -1687,6 +1689,8 @@
timedwrite attribute boolean timedWriteBoolean = 48;
attribute boolean generalErrorBoolean = 49;
attribute boolean clusterErrorBoolean = 50;
+ attribute TestGlobalEnum globalEnum = 51;
+ attribute TestGlobalStruct globalStruct = 52;
attribute optional boolean unsupported = 255;
attribute nullable boolean nullableBoolean = 16384;
attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385;
@@ -1722,6 +1726,8 @@
attribute nullable int16u nullableRangeRestrictedInt16u = 16424;
attribute nullable int16s nullableRangeRestrictedInt16s = 16425;
attribute optional int8u writeOnlyInt8u = 16426;
+ attribute nullable TestGlobalEnum nullableGlobalEnum = 16435;
+ attribute nullable TestGlobalStruct nullableGlobalStruct = 16436;
attribute int8u meiInt8u = 4294070017;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
@@ -1873,6 +1879,11 @@
SimpleEnum arg2 = 1;
}
+ response struct GlobalEchoResponse = 14 {
+ TestGlobalStruct field1 = 0;
+ TestGlobalEnum field2 = 1;
+ }
+
request struct TestNullableOptionalRequestRequest {
optional nullable int8u arg1 = 0;
}
@@ -1926,6 +1937,11 @@
octet_string payload = 0;
}
+ request struct GlobalEchoRequestRequest {
+ TestGlobalStruct field1 = 0;
+ TestGlobalEnum field2 = 1;
+ }
+
request struct TestDifferentVendorMeiRequestRequest {
int8u arg1 = 0;
}
@@ -2009,6 +2025,9 @@
the string back. If the string is large then it would require a session that
supports large payloads. */
command StringEchoRequest(StringEchoRequestRequest): StringEchoResponse = 24;
+ /** Command that takes arguments that are global structs/enums and the
+ response just echoes them back. */
+ command GlobalEchoRequest(GlobalEchoRequestRequest): GlobalEchoResponse = 25;
/** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */
command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962;
}
@@ -2332,6 +2351,8 @@
ram attribute timedWriteBoolean;
callback attribute generalErrorBoolean;
callback attribute clusterErrorBoolean;
+ ram attribute globalEnum;
+ callback attribute globalStruct;
ram attribute nullableBoolean default = false;
ram attribute nullableBitmap8 default = 0;
ram attribute nullableBitmap16 default = 0;
@@ -2366,6 +2387,8 @@
ram attribute nullableRangeRestrictedInt16u default = 200;
ram attribute nullableRangeRestrictedInt16s default = -100;
callback attribute writeOnlyInt8u default = 0;
+ ram attribute nullableGlobalEnum;
+ callback attribute nullableGlobalStruct;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
ram attribute meiInt8u default = 0;
@@ -2390,6 +2413,7 @@
handle command TestListNestedStructListArgumentRequest;
handle command TestListInt8UReverseRequest;
handle command TestEnumsRequest;
+ handle command GlobalEchoResponse;
handle command TestNullableOptionalRequest;
handle command SimpleStructEchoRequest;
handle command TimedInvokeRequest;
@@ -2398,6 +2422,7 @@
handle command TestEmitTestFabricScopedEventRequest;
handle command TestBatchHelperRequest;
handle command TestSecondBatchHelperRequest;
+ handle command GlobalEchoRequest;
handle command TestDifferentVendorMeiRequest;
handle command TestDifferentVendorMeiResponse;
}
diff --git a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap
index 590dea9..02a553e 100644
--- a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap
+++ b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap
@@ -3253,6 +3253,14 @@
"isEnabled": 1
},
{
+ "name": "GlobalEchoResponse",
+ "code": 14,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
"name": "TestNullableOptionalRequest",
"code": 15,
"mfgCode": null,
@@ -3317,6 +3325,14 @@
"isEnabled": 1
},
{
+ "name": "GlobalEchoRequest",
+ "code": 25,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
"name": "TestDifferentVendorMeiRequest",
"code": 4294049962,
"mfgCode": null,
@@ -4087,6 +4103,38 @@
"reportableChange": 0
},
{
+ "name": "global_enum",
+ "code": 51,
+ "mfgCode": null,
+ "side": "server",
+ "type": "TestGlobalEnum",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "global_struct",
+ "code": 52,
+ "mfgCode": null,
+ "side": "server",
+ "type": "TestGlobalStruct",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
"name": "nullable_boolean",
"code": 16384,
"mfgCode": null,
@@ -4631,6 +4679,38 @@
"reportableChange": 0
},
{
+ "name": "nullable_global_enum",
+ "code": 16435,
+ "mfgCode": null,
+ "side": "server",
+ "type": "TestGlobalEnum",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "nullable_global_struct",
+ "code": 16436,
+ "mfgCode": null,
+ "side": "server",
+ "type": "TestGlobalStruct",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
"name": "FeatureMap",
"code": 65532,
"mfgCode": null,
diff --git a/src/app/clusters/test-cluster-server/test-cluster-server.cpp b/src/app/clusters/test-cluster-server/test-cluster-server.cpp
index 4b6fc97..9bd9257 100644
--- a/src/app/clusters/test-cluster-server/test-cluster-server.cpp
+++ b/src/app/clusters/test-cluster-server/test-cluster-server.cpp
@@ -101,8 +101,12 @@
AttributeValueDecoder & aDecoder);
CHIP_ERROR ReadStructAttribute(AttributeValueEncoder & aEncoder);
CHIP_ERROR WriteStructAttribute(AttributeValueDecoder & aDecoder);
+ CHIP_ERROR ReadGlobalStruct(AttributeValueEncoder & aEncoder);
+ CHIP_ERROR WriteGlobalStruct(AttributeValueDecoder & aDecoder);
CHIP_ERROR ReadNullableStruct(AttributeValueEncoder & aEncoder);
CHIP_ERROR WriteNullableStruct(AttributeValueDecoder & aDecoder);
+ CHIP_ERROR ReadNullableGlobalStruct(AttributeValueEncoder & aEncoder);
+ CHIP_ERROR WriteNullableGlobalStruct(AttributeValueDecoder & aDecoder);
CHIP_ERROR ReadListFabricScopedAttribute(AttributeValueEncoder & aEncoder);
CHIP_ERROR WriteListFabricScopedAttribute(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder);
};
@@ -126,7 +130,9 @@
Structs::TestListStructOctet::Type listStructOctetStringData[kAttributeListLength];
OctetStringData gStructAttributeByteSpanData;
Structs::SimpleStruct::Type gStructAttributeValue;
+Globals::Structs::TestGlobalStruct::Type gGlobalStructAttributeValue;
NullableStruct::TypeInfo::Type gNullableStructAttributeValue;
+DataModel::Nullable<Globals::Structs::TestGlobalStruct::Type> gNullableGlobalStructAttributeValue;
chip::app::Clusters::UnitTesting::Structs::TestFabricScoped::Type gListFabricScopedAttributeValue[kAttributeListLength];
uint8_t gListFabricScoped_fabricSensitiveInt8uList[kAttributeListLength][kFabricSensitiveIntListLength];
@@ -198,6 +204,9 @@
case StructAttr::Id: {
return ReadStructAttribute(aEncoder);
}
+ case GlobalStruct::Id: {
+ return ReadGlobalStruct(aEncoder);
+ }
case ListLongOctetString::Id: {
return ReadListLongOctetStringAttribute(aEncoder);
}
@@ -207,6 +216,9 @@
case NullableStruct::Id: {
return ReadNullableStruct(aEncoder);
}
+ case NullableGlobalStruct::Id: {
+ return ReadNullableGlobalStruct(aEncoder);
+ }
case GeneralErrorBoolean::Id: {
return StatusIB(Protocols::InteractionModel::Status::InvalidDataType).ToChipError();
}
@@ -249,9 +261,15 @@
case StructAttr::Id: {
return WriteStructAttribute(aDecoder);
}
+ case GlobalStruct::Id: {
+ return WriteGlobalStruct(aDecoder);
+ }
case NullableStruct::Id: {
return WriteNullableStruct(aDecoder);
}
+ case NullableGlobalStruct::Id: {
+ return WriteNullableGlobalStruct(aDecoder);
+ }
case GeneralErrorBoolean::Id: {
return StatusIB(Protocols::InteractionModel::Status::InvalidDataType).ToChipError();
}
@@ -276,6 +294,26 @@
return aDecoder.Decode(gNullableStructAttributeValue);
}
+CHIP_ERROR TestAttrAccess::ReadNullableGlobalStruct(AttributeValueEncoder & aEncoder)
+{
+ return aEncoder.Encode(gNullableGlobalStructAttributeValue);
+}
+
+CHIP_ERROR TestAttrAccess::WriteNullableGlobalStruct(AttributeValueDecoder & aDecoder)
+{
+ Attributes::NullableGlobalStruct::TypeInfo::DecodableType temp;
+ ReturnErrorOnFailure(aDecoder.Decode(temp));
+
+ if (!temp.IsNull())
+ {
+ // We don't support a nonempty charspan here for now.
+ VerifyOrReturnError(temp.Value().name.empty(), CHIP_ERROR_BUFFER_TOO_SMALL);
+ }
+
+ gNullableGlobalStructAttributeValue = temp;
+ return CHIP_NO_ERROR;
+}
+
CHIP_ERROR TestAttrAccess::ReadListInt8uAttribute(AttributeValueEncoder & aEncoder)
{
return aEncoder.EncodeList([](const auto & encoder) -> CHIP_ERROR {
@@ -588,6 +626,23 @@
return CHIP_NO_ERROR;
}
+CHIP_ERROR TestAttrAccess::ReadGlobalStruct(AttributeValueEncoder & aEncoder)
+{
+ return aEncoder.Encode(gGlobalStructAttributeValue);
+}
+
+CHIP_ERROR TestAttrAccess::WriteGlobalStruct(AttributeValueDecoder & aDecoder)
+{
+ // We don't support a nonempty charspan here for now.
+ Attributes::GlobalStruct::TypeInfo::DecodableType temp;
+ ReturnErrorOnFailure(aDecoder.Decode(temp));
+
+ VerifyOrReturnError(temp.name.empty(), CHIP_ERROR_BUFFER_TOO_SMALL);
+
+ gGlobalStructAttributeValue = temp;
+ return CHIP_NO_ERROR;
+}
+
CHIP_ERROR TestAttrAccess::ReadListFabricScopedAttribute(AttributeValueEncoder & aEncoder)
{
return aEncoder.EncodeList([](const auto & encoder) -> CHIP_ERROR {
@@ -1114,6 +1169,17 @@
commandData.fillCharacter);
}
+bool emberAfUnitTestingClusterGlobalEchoRequestCallback(CommandHandler * commandObj, const ConcreteCommandPath & commandPath,
+ const Commands::GlobalEchoRequest::DecodableType & commandData)
+{
+ Commands::GlobalEchoResponse::Type response;
+ response.field1 = commandData.field1;
+ response.field2 = commandData.field2;
+
+ commandObj->AddResponse(commandPath, response);
+ return true;
+}
+
// -----------------------------------------------------------------------------
// Plugin initialization
diff --git a/src/app/tests/suites/TestCluster.yaml b/src/app/tests/suites/TestCluster.yaml
index 308240a..d2ff0cb 100644
--- a/src/app/tests/suites/TestCluster.yaml
+++ b/src/app/tests/suites/TestCluster.yaml
@@ -3912,6 +3912,7 @@
22,
23,
24,
+ 25,
4294049962,
]
@@ -3919,7 +3920,7 @@
command: "readAttribute"
attribute: "GeneratedCommandList"
response:
- value: [0, 1, 4, 5, 6, 8, 9, 10, 11, 12, 13, 4294049979]
+ value: [0, 1, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 4294049979]
- label: "Validate presence of MEI attribute"
command: "readAttribute"
@@ -3960,3 +3961,75 @@
g: 1.5,
h: 3.14159265358979,
}
+
+ # Globals testing
+ - label: "Write global-struct-typed attribute"
+ command: "writeAttribute"
+ attribute: "global_struct"
+ arguments:
+ value:
+ {
+ Name: "",
+ MyBitmap: 0x02,
+ MyEnum: TestGlobalEnum.SomeOtherValue,
+ }
+
+ - label: "Read global-struct-typed attribute"
+ command: "readAttribute"
+ attribute: "global_struct"
+ response:
+ value: {
+ # Purposefully using non-symbolic values to make sure things work right.
+ Name: "",
+ MyBitmap: 0x02,
+ MyEnum: 1,
+ }
+
+ - label: "Write nullable global-struct-typed attribute"
+ command: "writeAttribute"
+ attribute: "nullable_global_struct"
+ arguments:
+ value: { Name: "", MyBitmap: 0x01, MyEnum: TestGlobalEnum.SomeValue }
+
+ - label: "Read nullable global-struct-typed attribute"
+ command: "readAttribute"
+ attribute: "nullable_global_struct"
+ response:
+ value: { Name: "", MyBitmap: 0x01, MyEnum: 0 }
+
+ - label: "Write nullable global-struct-typed attribute as null"
+ command: "writeAttribute"
+ attribute: "nullable_global_struct"
+ arguments:
+ value: null
+
+ - label: "Read nullable global-struct-typed attribute a second time"
+ command: "readAttribute"
+ attribute: "nullable_global_struct"
+ response:
+ value: null
+
+ - label: "Send a command with global types"
+ command: "GlobalEchoRequest"
+ arguments:
+ values:
+ - name: "field1"
+ value:
+ {
+ Name: "",
+ MyBitmap: 0x02,
+ MyEnum: TestGlobalEnum.FinalValue,
+ }
+ - name: "field2"
+ value: TestGlobalEnum.SomeOtherValue
+ response:
+ values:
+ - name: "field1"
+ value:
+ {
+ Name: "",
+ MyBitmap: 0x02,
+ MyEnum: TestGlobalEnum.FinalValue,
+ }
+ - name: "field2"
+ value: TestGlobalEnum.SomeOtherValue
diff --git a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml
index f010838..c289ee9 100644
--- a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml
+++ b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml
@@ -58,6 +58,7 @@
<item name="f" type="SimpleBitmap" optional="false"/>
<item name="g" type="single" optional="false"/>
<item name="h" type="double" optional="false"/>
+ <item name="i" type="TestGlobalEnum" optional="true"/>
</struct>
<struct name="NestedStruct">
@@ -65,6 +66,7 @@
<item name="a" type="int8u" optional="false"/>
<item name="b" type="boolean" optional="false"/>
<item name="c" type="SimpleStruct" optional="false"/>
+ <item name="d" type="TestGlobalStruct" optional="true"/>
</struct>
<struct name="NestedStructList">
@@ -198,6 +200,9 @@
<attribute side="server" code="0x0032" define="CLUSTER_ERROR_BOOLEAN"
type="boolean" writable="true" optional="false">cluster_error_boolean</attribute>
+ <attribute side="server" code="0x0033" define="GLOBAL_ENUM" type="TestGlobalEnum" writable="true">global_enum</attribute>
+ <attribute side="server" code="0x0034" define="GLOBAL_STRUCT" type="TestGlobalStruct" writable="true">global_struct</attribute>
+
<attribute side="server" code="0x4000" define="NULLABLE_BOOLEAN" type="boolean" writable="true" default="false" isNullable="true" optional="false">nullable_boolean</attribute>
<attribute side="server" code="0x4001" define="NULLABLE_BITMAP8" type="Bitmap8MaskMap" writable="true" default="0" isNullable="true" optional="false">nullable_bitmap8</attribute>
<attribute side="server" code="0x4002" define="NULLABLE_BITMAP16" type="Bitmap16MaskMap" writable="true" default="0" isNullable="true" optional="false">nullable_bitmap16</attribute>
@@ -232,8 +237,14 @@
<attribute side="server" code="0x4028" define="NULLABLE_RANGE_RESTRICTED_INT16U" type="int16u" min="100" max="1000" writable="true" isNullable="true" optional="false" default="200">nullable_range_restricted_int16u</attribute>
<attribute side="server" code="0x4029" define="NULLABLE_RANGE_RESTRICTED_INT16S" type="int16s" min="-150" max="200" writable="true" isNullable="true" optional="false" default="-5">nullable_range_restricted_int16s</attribute>
+ <!-- NOTE: write_only_int8u should not have been added in the 0x4... range
+ where the nullable versions of attributes go, but now we have to be a
+ bit careful about our attribute IDs as a result. -->
<attribute side="server" code="0x402A" define="WRITE_ONLY_INT8U" type="int8u" writable="true" default="0" optional="true">write_only_int8u</attribute>
+ <attribute side="server" code="0x4033" define="NULLABLE_GLOBAL_ENUM" type="TestGlobalEnum" isNullable="true" writable="true">nullable_global_enum</attribute>
+ <attribute side="server" code="0x4034" define="NULLABLE_GLOBAL_STRUCT" type="TestGlobalStruct" isNullable="true" writable="true">nullable_global_struct</attribute>
+
<!-- Attribute MEI sample having a different vendor ID than the cluster. -->
<attribute side="server" code="0xFFF24F01" define="MEI_INT8U" type="int8u" writable="true" default="0" optional="false">mei_int8u</attribute>
@@ -474,6 +485,16 @@
<arg name="payload" type="octet_string"/>
</command>
+ <command source="client" code="0x19" name="GlobalEchoRequest"
+ response="GlobalEchoResponse" optional="true">
+ <description>
+ Command that takes arguments that are global structs/enums and the
+ response just echoes them back.
+ </description>
+ <arg name="field1" type="TestGlobalStruct"/>
+ <arg name="field2" type="TestGlobalEnum"/>
+ </command>
+
<command source="client" code="0xFFF200AA" name="TestDifferentVendorMeiRequest"
optional="true" response="TestDifferentVendorMeiResponse">
<description>
@@ -622,6 +643,14 @@
<arg name="payload" type="octet_string"/>
</command>
+ <command source="server" code="0x0E" name="GlobalEchoResponse" optional="true" disableDefaultResponse="true">
+ <description>
+ Response to GlobalEchoRequest.
+ </description>
+ <arg name="field1" type="TestGlobalStruct"/>
+ <arg name="field2" type="TestGlobalEnum"/>
+ </command>
+
<command source="server" code="0xFFF200BB" name="TestDifferentVendorMeiResponse" optional="true" disableDefaultResponse="true">
<description>
Response to TestDifferentVendorMeiRequest, which is a command having a different MEI vendor ID than the cluster.
diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json
index 4c5a592..44de496 100644
--- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json
+++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json
@@ -299,7 +299,9 @@
"struct_attr",
"nullable_struct",
"general_error_boolean",
- "cluster_error_boolean"
+ "cluster_error_boolean",
+ "global_struct",
+ "nullable_global_struct"
],
"Thread Border Router Management": [
"BorderRouterName",
diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json
index 777847f..a72b44e 100644
--- a/src/app/zap-templates/zcl/zcl.json
+++ b/src/app/zap-templates/zcl/zcl.json
@@ -297,7 +297,9 @@
"struct_attr",
"nullable_struct",
"general_error_boolean",
- "cluster_error_boolean"
+ "cluster_error_boolean",
+ "global_struct",
+ "nullable_global_struct"
],
"Thread Border Router Management": [
"BorderRouterName",
diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter
index 24a9e2f..c0e1f7c 100644
--- a/src/controller/data_model/controller-clusters.matter
+++ b/src/controller/data_model/controller-clusters.matter
@@ -9747,6 +9747,7 @@
SimpleBitmap f = 5;
single g = 6;
double h = 7;
+ optional TestGlobalEnum i = 8;
}
fabric_scoped struct TestFabricScoped {
@@ -9779,6 +9780,7 @@
int8u a = 0;
boolean b = 1;
SimpleStruct c = 2;
+ optional TestGlobalStruct d = 3;
}
struct NestedStructList {
@@ -9864,6 +9866,8 @@
timedwrite attribute boolean timedWriteBoolean = 48;
attribute boolean generalErrorBoolean = 49;
attribute boolean clusterErrorBoolean = 50;
+ attribute TestGlobalEnum globalEnum = 51;
+ attribute TestGlobalStruct globalStruct = 52;
attribute optional boolean unsupported = 255;
attribute nullable boolean nullableBoolean = 16384;
attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385;
@@ -9899,6 +9903,8 @@
attribute nullable int16u nullableRangeRestrictedInt16u = 16424;
attribute nullable int16s nullableRangeRestrictedInt16s = 16425;
attribute optional int8u writeOnlyInt8u = 16426;
+ attribute nullable TestGlobalEnum nullableGlobalEnum = 16435;
+ attribute nullable TestGlobalStruct nullableGlobalStruct = 16436;
attribute int8u meiInt8u = 4294070017;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
@@ -10050,6 +10056,11 @@
SimpleEnum arg2 = 1;
}
+ response struct GlobalEchoResponse = 14 {
+ TestGlobalStruct field1 = 0;
+ TestGlobalEnum field2 = 1;
+ }
+
request struct TestNullableOptionalRequestRequest {
optional nullable int8u arg1 = 0;
}
@@ -10103,6 +10114,11 @@
octet_string payload = 0;
}
+ request struct GlobalEchoRequestRequest {
+ TestGlobalStruct field1 = 0;
+ TestGlobalEnum field2 = 1;
+ }
+
request struct TestDifferentVendorMeiRequestRequest {
int8u arg1 = 0;
}
@@ -10186,6 +10202,9 @@
the string back. If the string is large then it would require a session that
supports large payloads. */
command StringEchoRequest(StringEchoRequestRequest): StringEchoResponse = 24;
+ /** Command that takes arguments that are global structs/enums and the
+ response just echoes them back. */
+ command GlobalEchoRequest(GlobalEchoRequestRequest): GlobalEchoResponse = 25;
/** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */
command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962;
}
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java
index f7fc1ea..e8ba5ba 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java
@@ -65210,6 +65210,8 @@
private static final long TIMED_WRITE_BOOLEAN_ATTRIBUTE_ID = 48L;
private static final long GENERAL_ERROR_BOOLEAN_ATTRIBUTE_ID = 49L;
private static final long CLUSTER_ERROR_BOOLEAN_ATTRIBUTE_ID = 50L;
+ private static final long GLOBAL_ENUM_ATTRIBUTE_ID = 51L;
+ private static final long GLOBAL_STRUCT_ATTRIBUTE_ID = 52L;
private static final long UNSUPPORTED_ATTRIBUTE_ID = 255L;
private static final long NULLABLE_BOOLEAN_ATTRIBUTE_ID = 16384L;
private static final long NULLABLE_BITMAP8_ATTRIBUTE_ID = 16385L;
@@ -65245,6 +65247,8 @@
private static final long NULLABLE_RANGE_RESTRICTED_INT16U_ATTRIBUTE_ID = 16424L;
private static final long NULLABLE_RANGE_RESTRICTED_INT16S_ATTRIBUTE_ID = 16425L;
private static final long WRITE_ONLY_INT8U_ATTRIBUTE_ID = 16426L;
+ private static final long NULLABLE_GLOBAL_ENUM_ATTRIBUTE_ID = 16435L;
+ private static final long NULLABLE_GLOBAL_STRUCT_ATTRIBUTE_ID = 16436L;
private static final long MEI_INT8U_ATTRIBUTE_ID = 4294070017L;
private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L;
private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L;
@@ -66288,6 +66292,47 @@
}}, commandId, commandArgs, timedInvokeTimeoutMs);
}
+ public void globalEchoRequest(GlobalEchoResponseCallback callback, ChipStructs.UnitTestingClusterTestGlobalStruct field1, Integer field2) {
+ globalEchoRequest(callback, field1, field2, 0);
+ }
+
+ public void globalEchoRequest(GlobalEchoResponseCallback callback, ChipStructs.UnitTestingClusterTestGlobalStruct field1, Integer field2, int timedInvokeTimeoutMs) {
+ final long commandId = 25L;
+
+ ArrayList<StructElement> elements = new ArrayList<>();
+ final long field1FieldID = 0L;
+ BaseTLVType field1tlvValue = field1.encodeTlv();
+ elements.add(new StructElement(field1FieldID, field1tlvValue));
+
+ final long field2FieldID = 1L;
+ BaseTLVType field2tlvValue = new UIntType(field2);
+ elements.add(new StructElement(field2FieldID, field2tlvValue));
+
+ StructType commandArgs = new StructType(elements);
+ invoke(new InvokeCallbackImpl(callback) {
+ @Override
+ public void onResponse(StructType invokeStructValue) {
+ final long field1FieldID = 0L;
+ ChipStructs.UnitTestingClusterTestGlobalStruct field1 = null;
+ final long field2FieldID = 1L;
+ Integer field2 = null;
+ for (StructElement element: invokeStructValue.value()) {
+ if (element.contextTagNum() == field1FieldID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.Struct) {
+ StructType castingValue = element.value(StructType.class);
+ field1 = ChipStructs.UnitTestingClusterTestGlobalStruct.decodeTlv(castingValue);
+ }
+ } else if (element.contextTagNum() == field2FieldID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
+ UIntType castingValue = element.value(UIntType.class);
+ field2 = castingValue.value(Integer.class);
+ }
+ }
+ }
+ callback.onSuccess(field1, field2);
+ }}, commandId, commandArgs, timedInvokeTimeoutMs);
+ }
+
public void testDifferentVendorMeiRequest(TestDifferentVendorMeiResponseCallback callback, Integer arg1) {
testDifferentVendorMeiRequest(callback, arg1, 0);
}
@@ -66381,6 +66426,10 @@
void onSuccess(byte[] payload);
}
+ public interface GlobalEchoResponseCallback extends BaseClusterCallback {
+ void onSuccess(ChipStructs.UnitTestingClusterTestGlobalStruct field1, Integer field2);
+ }
+
public interface TestDifferentVendorMeiResponseCallback extends BaseClusterCallback {
void onSuccess(Integer arg1, Long eventNumber);
}
@@ -66413,6 +66462,10 @@
void onSuccess(List<ChipStructs.UnitTestingClusterTestFabricScoped> value);
}
+ public interface GlobalStructAttributeCallback extends BaseAttributeCallback {
+ void onSuccess(ChipStructs.UnitTestingClusterTestGlobalStruct value);
+ }
+
public interface NullableBooleanAttributeCallback extends BaseAttributeCallback {
void onSuccess(@Nullable Boolean value);
}
@@ -66545,6 +66598,14 @@
void onSuccess(@Nullable Integer value);
}
+ public interface NullableGlobalEnumAttributeCallback extends BaseAttributeCallback {
+ void onSuccess(@Nullable Integer value);
+ }
+
+ public interface NullableGlobalStructAttributeCallback extends BaseAttributeCallback {
+ void onSuccess(@Nullable ChipStructs.UnitTestingClusterTestGlobalStruct value);
+ }
+
public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback {
void onSuccess(List<Long> value);
}
@@ -68207,6 +68268,76 @@
}, CLUSTER_ERROR_BOOLEAN_ATTRIBUTE_ID, minInterval, maxInterval);
}
+ public void readGlobalEnumAttribute(
+ IntegerAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GLOBAL_ENUM_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, GLOBAL_ENUM_ATTRIBUTE_ID, true);
+ }
+
+ public void writeGlobalEnumAttribute(DefaultClusterCallback callback, Integer value) {
+ writeGlobalEnumAttribute(callback, value, 0);
+ }
+
+ public void writeGlobalEnumAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) {
+ BaseTLVType tlvValue = new UIntType(value);
+ writeAttribute(new WriteAttributesCallbackImpl(callback), GLOBAL_ENUM_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs);
+ }
+
+ public void subscribeGlobalEnumAttribute(
+ IntegerAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GLOBAL_ENUM_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, GLOBAL_ENUM_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+
+ public void readGlobalStructAttribute(
+ GlobalStructAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GLOBAL_STRUCT_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ ChipStructs.UnitTestingClusterTestGlobalStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, GLOBAL_STRUCT_ATTRIBUTE_ID, true);
+ }
+
+ public void writeGlobalStructAttribute(DefaultClusterCallback callback, ChipStructs.UnitTestingClusterTestGlobalStruct value) {
+ writeGlobalStructAttribute(callback, value, 0);
+ }
+
+ public void writeGlobalStructAttribute(DefaultClusterCallback callback, ChipStructs.UnitTestingClusterTestGlobalStruct value, int timedWriteTimeoutMs) {
+ BaseTLVType tlvValue = value.encodeTlv();
+ writeAttribute(new WriteAttributesCallbackImpl(callback), GLOBAL_STRUCT_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs);
+ }
+
+ public void subscribeGlobalStructAttribute(
+ GlobalStructAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GLOBAL_STRUCT_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ ChipStructs.UnitTestingClusterTestGlobalStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, GLOBAL_STRUCT_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+
public void readUnsupportedAttribute(
BooleanAttributeCallback callback) {
ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, UNSUPPORTED_ATTRIBUTE_ID);
@@ -69432,6 +69563,76 @@
}, WRITE_ONLY_INT8U_ATTRIBUTE_ID, minInterval, maxInterval);
}
+ public void readNullableGlobalEnumAttribute(
+ NullableGlobalEnumAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NULLABLE_GLOBAL_ENUM_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, NULLABLE_GLOBAL_ENUM_ATTRIBUTE_ID, true);
+ }
+
+ public void writeNullableGlobalEnumAttribute(DefaultClusterCallback callback, Integer value) {
+ writeNullableGlobalEnumAttribute(callback, value, 0);
+ }
+
+ public void writeNullableGlobalEnumAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) {
+ BaseTLVType tlvValue = value != null ? new UIntType(value) : new NullType();
+ writeAttribute(new WriteAttributesCallbackImpl(callback), NULLABLE_GLOBAL_ENUM_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs);
+ }
+
+ public void subscribeNullableGlobalEnumAttribute(
+ NullableGlobalEnumAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NULLABLE_GLOBAL_ENUM_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, NULLABLE_GLOBAL_ENUM_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+
+ public void readNullableGlobalStructAttribute(
+ NullableGlobalStructAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NULLABLE_GLOBAL_STRUCT_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ @Nullable ChipStructs.UnitTestingClusterTestGlobalStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, NULLABLE_GLOBAL_STRUCT_ATTRIBUTE_ID, true);
+ }
+
+ public void writeNullableGlobalStructAttribute(DefaultClusterCallback callback, ChipStructs.UnitTestingClusterTestGlobalStruct value) {
+ writeNullableGlobalStructAttribute(callback, value, 0);
+ }
+
+ public void writeNullableGlobalStructAttribute(DefaultClusterCallback callback, ChipStructs.UnitTestingClusterTestGlobalStruct value, int timedWriteTimeoutMs) {
+ BaseTLVType tlvValue = value != null ? value.encodeTlv() : new NullType();
+ writeAttribute(new WriteAttributesCallbackImpl(callback), NULLABLE_GLOBAL_STRUCT_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs);
+ }
+
+ public void subscribeNullableGlobalStructAttribute(
+ NullableGlobalStructAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NULLABLE_GLOBAL_STRUCT_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ @Nullable ChipStructs.UnitTestingClusterTestGlobalStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, NULLABLE_GLOBAL_STRUCT_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+
public void readMeiInt8uAttribute(
IntegerAttributeCallback callback) {
ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEI_INT8U_ATTRIBUTE_ID);
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java
index df78372..5ab4c29 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java
@@ -12899,6 +12899,7 @@
public Integer f;
public Float g;
public Double h;
+ public Optional<Integer> i;
private static final long A_ID = 0L;
private static final long B_ID = 1L;
private static final long C_ID = 2L;
@@ -12907,6 +12908,7 @@
private static final long F_ID = 5L;
private static final long G_ID = 6L;
private static final long H_ID = 7L;
+ private static final long I_ID = 8L;
public UnitTestingClusterSimpleStruct(
Integer a,
@@ -12916,7 +12918,8 @@
String e,
Integer f,
Float g,
- Double h
+ Double h,
+ Optional<Integer> i
) {
this.a = a;
this.b = b;
@@ -12926,6 +12929,7 @@
this.f = f;
this.g = g;
this.h = h;
+ this.i = i;
}
public StructType encodeTlv() {
@@ -12938,6 +12942,7 @@
values.add(new StructElement(F_ID, new UIntType(f)));
values.add(new StructElement(G_ID, new FloatType(g)));
values.add(new StructElement(H_ID, new DoubleType(h)));
+ values.add(new StructElement(I_ID, i.<BaseTLVType>map((nonOptionali) -> new UIntType(nonOptionali)).orElse(new EmptyType())));
return new StructType(values);
}
@@ -12954,6 +12959,7 @@
Integer f = null;
Float g = null;
Double h = null;
+ Optional<Integer> i = Optional.empty();
for (StructElement element: ((StructType)tlvValue).value()) {
if (element.contextTagNum() == A_ID) {
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
@@ -12995,6 +13001,11 @@
DoubleType castingValue = element.value(DoubleType.class);
h = castingValue.value(Double.class);
}
+ } else if (element.contextTagNum() == I_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
+ UIntType castingValue = element.value(UIntType.class);
+ i = Optional.of(castingValue.value(Integer.class));
+ }
}
}
return new UnitTestingClusterSimpleStruct(
@@ -13005,7 +13016,8 @@
e,
f,
g,
- h
+ h,
+ i
);
}
@@ -13037,6 +13049,9 @@
output.append("\th: ");
output.append(h);
output.append("\n");
+ output.append("\ti: ");
+ output.append(i);
+ output.append("\n");
output.append("}\n");
return output.toString();
}
@@ -13407,18 +13422,22 @@
public Integer a;
public Boolean b;
public ChipStructs.UnitTestingClusterSimpleStruct c;
+ public Optional<ChipStructs.UnitTestingClusterTestGlobalStruct> d;
private static final long A_ID = 0L;
private static final long B_ID = 1L;
private static final long C_ID = 2L;
+ private static final long D_ID = 3L;
public UnitTestingClusterNestedStruct(
Integer a,
Boolean b,
- ChipStructs.UnitTestingClusterSimpleStruct c
+ ChipStructs.UnitTestingClusterSimpleStruct c,
+ Optional<ChipStructs.UnitTestingClusterTestGlobalStruct> d
) {
this.a = a;
this.b = b;
this.c = c;
+ this.d = d;
}
public StructType encodeTlv() {
@@ -13426,6 +13445,7 @@
values.add(new StructElement(A_ID, new UIntType(a)));
values.add(new StructElement(B_ID, new BooleanType(b)));
values.add(new StructElement(C_ID, c.encodeTlv()));
+ values.add(new StructElement(D_ID, d.<BaseTLVType>map((nonOptionald) -> nonOptionald.encodeTlv()).orElse(new EmptyType())));
return new StructType(values);
}
@@ -13437,6 +13457,7 @@
Integer a = null;
Boolean b = null;
ChipStructs.UnitTestingClusterSimpleStruct c = null;
+ Optional<ChipStructs.UnitTestingClusterTestGlobalStruct> d = Optional.empty();
for (StructElement element: ((StructType)tlvValue).value()) {
if (element.contextTagNum() == A_ID) {
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
@@ -13453,12 +13474,18 @@
StructType castingValue = element.value(StructType.class);
c = ChipStructs.UnitTestingClusterSimpleStruct.decodeTlv(castingValue);
}
+ } else if (element.contextTagNum() == D_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.Struct) {
+ StructType castingValue = element.value(StructType.class);
+ d = Optional.of(ChipStructs.UnitTestingClusterTestGlobalStruct.decodeTlv(castingValue));
+ }
}
}
return new UnitTestingClusterNestedStruct(
a,
b,
- c
+ c,
+ d
);
}
@@ -13475,6 +13502,9 @@
output.append("\tc: ");
output.append(c);
output.append("\n");
+ output.append("\td: ");
+ output.append(d);
+ output.append("\n");
output.append("}\n");
return output.toString();
}
@@ -13722,4 +13752,80 @@
return output.toString();
}
}
+public static class UnitTestingClusterTestGlobalStruct {
+ public String name;
+ public @Nullable Long myBitmap;
+ public @Nullable Optional<Integer> myEnum;
+ private static final long NAME_ID = 0L;
+ private static final long MY_BITMAP_ID = 1L;
+ private static final long MY_ENUM_ID = 2L;
+
+ public UnitTestingClusterTestGlobalStruct(
+ String name,
+ @Nullable Long myBitmap,
+ @Nullable Optional<Integer> myEnum
+ ) {
+ this.name = name;
+ this.myBitmap = myBitmap;
+ this.myEnum = myEnum;
+ }
+
+ public StructType encodeTlv() {
+ ArrayList<StructElement> values = new ArrayList<>();
+ values.add(new StructElement(NAME_ID, new StringType(name)));
+ values.add(new StructElement(MY_BITMAP_ID, myBitmap != null ? new UIntType(myBitmap) : new NullType()));
+ values.add(new StructElement(MY_ENUM_ID, myEnum != null ? myEnum.<BaseTLVType>map((nonOptionalmyEnum) -> new UIntType(nonOptionalmyEnum)).orElse(new EmptyType()) : new NullType()));
+
+ return new StructType(values);
+ }
+
+ public static UnitTestingClusterTestGlobalStruct decodeTlv(BaseTLVType tlvValue) {
+ if (tlvValue == null || tlvValue.type() != TLVType.Struct) {
+ return null;
+ }
+ String name = null;
+ @Nullable Long myBitmap = null;
+ @Nullable Optional<Integer> myEnum = null;
+ for (StructElement element: ((StructType)tlvValue).value()) {
+ if (element.contextTagNum() == NAME_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.String) {
+ StringType castingValue = element.value(StringType.class);
+ name = castingValue.value(String.class);
+ }
+ } else if (element.contextTagNum() == MY_BITMAP_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
+ UIntType castingValue = element.value(UIntType.class);
+ myBitmap = castingValue.value(Long.class);
+ }
+ } else if (element.contextTagNum() == MY_ENUM_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
+ UIntType castingValue = element.value(UIntType.class);
+ myEnum = Optional.of(castingValue.value(Integer.class));
+ }
+ }
+ }
+ return new UnitTestingClusterTestGlobalStruct(
+ name,
+ myBitmap,
+ myEnum
+ );
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder output = new StringBuilder();
+ output.append("UnitTestingClusterTestGlobalStruct {\n");
+ output.append("\tname: ");
+ output.append(name);
+ output.append("\n");
+ output.append("\tmyBitmap: ");
+ output.append(myBitmap);
+ output.append("\n");
+ output.append("\tmyEnum: ");
+ output.append(myEnum);
+ output.append("\n");
+ output.append("}\n");
+ return output.toString();
+ }
+}
}
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java
index 37936a5..bad7120 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java
@@ -17755,6 +17755,8 @@
TimedWriteBoolean(48L),
GeneralErrorBoolean(49L),
ClusterErrorBoolean(50L),
+ GlobalEnum(51L),
+ GlobalStruct(52L),
Unsupported(255L),
NullableBoolean(16384L),
NullableBitmap8(16385L),
@@ -17790,6 +17792,8 @@
NullableRangeRestrictedInt16u(16424L),
NullableRangeRestrictedInt16s(16425L),
WriteOnlyInt8u(16426L),
+ NullableGlobalEnum(16435L),
+ NullableGlobalStruct(16436L),
MeiInt8u(4294070017L),
GeneratedCommandList(65528L),
AcceptedCommandList(65529L),
@@ -17865,6 +17869,7 @@
TestBatchHelperRequest(22L),
TestSecondBatchHelperRequest(23L),
StringEchoRequest(24L),
+ GlobalEchoRequest(25L),
TestDifferentVendorMeiRequest(4294049962L),;
private final long id;
Command(long id) {
@@ -18223,6 +18228,23 @@
}
throw new NoSuchFieldError();
}
+ }public enum GlobalEchoRequestCommandField {Field1(0),Field2(1),;
+ private final int id;
+ GlobalEchoRequestCommandField(int id) {
+ this.id = id;
+ }
+
+ public int getID() {
+ return id;
+ }
+ public static GlobalEchoRequestCommandField value(int id) throws NoSuchFieldError {
+ for (GlobalEchoRequestCommandField field : GlobalEchoRequestCommandField.values()) {
+ if (field.getID() == id) {
+ return field;
+ }
+ }
+ throw new NoSuchFieldError();
+ }
}public enum TestDifferentVendorMeiRequestCommandField {Arg1(0),;
private final int id;
TestDifferentVendorMeiRequestCommandField(int id) {
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java
index 2ba2e50..1d398ff 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java
@@ -20908,6 +20908,30 @@
}
}
+ public static class DelegatedUnitTestingClusterGlobalEchoResponseCallback implements ChipClusters.UnitTestingCluster.GlobalEchoResponseCallback, DelegatedClusterCallback {
+ private ClusterCommandCallback callback;
+ @Override
+ public void setCallbackDelegate(ClusterCommandCallback callback) {
+ this.callback = callback;
+ }
+
+ @Override
+ public void onSuccess(ChipStructs.UnitTestingClusterTestGlobalStruct field1, Integer field2) {
+ Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>();
+
+ // field1: Struct TestGlobalStruct
+ // Conversion from this type to Java is not properly implemented yet
+ CommandResponseInfo field2ResponseValue = new CommandResponseInfo("field2", "Integer");
+ responseValues.put(field2ResponseValue, field2);
+ callback.onSuccess(responseValues);
+ }
+
+ @Override
+ public void onError(Exception error) {
+ callback.onFailure(error);
+ }
+ }
+
public static class DelegatedUnitTestingClusterTestDifferentVendorMeiResponseCallback implements ChipClusters.UnitTestingCluster.TestDifferentVendorMeiResponseCallback, DelegatedClusterCallback {
private ClusterCommandCallback callback;
@Override
@@ -21078,6 +21102,27 @@
}
}
+ public static class DelegatedUnitTestingClusterGlobalStructAttributeCallback implements ChipClusters.UnitTestingCluster.GlobalStructAttributeCallback, DelegatedClusterCallback {
+ private ClusterCommandCallback callback;
+ @Override
+ public void setCallbackDelegate(ClusterCommandCallback callback) {
+ this.callback = callback;
+ }
+
+ @Override
+ public void onSuccess(ChipStructs.UnitTestingClusterTestGlobalStruct value) {
+ Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>();
+ CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.UnitTestingClusterTestGlobalStruct");
+ responseValues.put(commandResponseInfo, value);
+ callback.onSuccess(responseValues);
+ }
+
+ @Override
+ public void onError(Exception ex) {
+ callback.onFailure(ex);
+ }
+ }
+
public static class DelegatedUnitTestingClusterNullableBooleanAttributeCallback implements ChipClusters.UnitTestingCluster.NullableBooleanAttributeCallback, DelegatedClusterCallback {
private ClusterCommandCallback callback;
@Override
@@ -21771,6 +21816,48 @@
}
}
+ public static class DelegatedUnitTestingClusterNullableGlobalEnumAttributeCallback implements ChipClusters.UnitTestingCluster.NullableGlobalEnumAttributeCallback, DelegatedClusterCallback {
+ private ClusterCommandCallback callback;
+ @Override
+ public void setCallbackDelegate(ClusterCommandCallback callback) {
+ this.callback = callback;
+ }
+
+ @Override
+ public void onSuccess(@Nullable Integer value) {
+ Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>();
+ CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer");
+ responseValues.put(commandResponseInfo, value);
+ callback.onSuccess(responseValues);
+ }
+
+ @Override
+ public void onError(Exception ex) {
+ callback.onFailure(ex);
+ }
+ }
+
+ public static class DelegatedUnitTestingClusterNullableGlobalStructAttributeCallback implements ChipClusters.UnitTestingCluster.NullableGlobalStructAttributeCallback, DelegatedClusterCallback {
+ private ClusterCommandCallback callback;
+ @Override
+ public void setCallbackDelegate(ClusterCommandCallback callback) {
+ this.callback = callback;
+ }
+
+ @Override
+ public void onSuccess(@Nullable ChipStructs.UnitTestingClusterTestGlobalStruct value) {
+ Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>();
+ CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.UnitTestingClusterTestGlobalStruct");
+ responseValues.put(commandResponseInfo, value);
+ callback.onSuccess(responseValues);
+ }
+
+ @Override
+ public void onError(Exception ex) {
+ callback.onFailure(ex);
+ }
+ }
+
public static class DelegatedUnitTestingClusterGeneratedCommandListAttributeCallback implements ChipClusters.UnitTestingCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback {
private ClusterCommandCallback callback;
@Override
@@ -29576,6 +29663,28 @@
);
unitTestingClusterInteractionInfoMap.put("stringEchoRequest", unitTestingstringEchoRequestInteractionInfo);
+ Map<String, CommandParameterInfo> unitTestingglobalEchoRequestCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
+
+
+ CommandParameterInfo unitTestingglobalEchoRequestfield2CommandParameterInfo = new CommandParameterInfo("field2", Integer.class, Integer.class);
+ unitTestingglobalEchoRequestCommandParams.put("field2",unitTestingglobalEchoRequestfield2CommandParameterInfo);
+ InteractionInfo unitTestingglobalEchoRequestInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.UnitTestingCluster) cluster)
+ .globalEchoRequest((ChipClusters.UnitTestingCluster.GlobalEchoResponseCallback) callback
+ , (ChipStructs.UnitTestingClusterTestGlobalStruct)
+ commandArguments.get("field1")
+
+ , (Integer)
+ commandArguments.get("field2")
+
+ );
+ },
+ () -> new DelegatedUnitTestingClusterGlobalEchoResponseCallback(),
+ unitTestingglobalEchoRequestCommandParams
+ );
+ unitTestingClusterInteractionInfoMap.put("globalEchoRequest", unitTestingglobalEchoRequestInteractionInfo);
+
Map<String, CommandParameterInfo> unitTestingtestDifferentVendorMeiRequestCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
CommandParameterInfo unitTestingtestDifferentVendorMeiRequestarg1CommandParameterInfo = new CommandParameterInfo("arg1", Integer.class, Integer.class);
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java
index 417ecce..32d3d4f 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java
@@ -20846,6 +20846,17 @@
readUnitTestingClusterErrorBooleanCommandParams
);
result.put("readClusterErrorBooleanAttribute", readUnitTestingClusterErrorBooleanAttributeInteractionInfo);
+ Map<String, CommandParameterInfo> readUnitTestingGlobalEnumCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
+ InteractionInfo readUnitTestingGlobalEnumAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.UnitTestingCluster) cluster).readGlobalEnumAttribute(
+ (ChipClusters.IntegerAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(),
+ readUnitTestingGlobalEnumCommandParams
+ );
+ result.put("readGlobalEnumAttribute", readUnitTestingGlobalEnumAttributeInteractionInfo);
Map<String, CommandParameterInfo> readUnitTestingUnsupportedCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readUnitTestingUnsupportedAttributeInteractionInfo = new InteractionInfo(
(cluster, callback, commandArguments) -> {
@@ -21220,6 +21231,17 @@
readUnitTestingWriteOnlyInt8uCommandParams
);
result.put("readWriteOnlyInt8uAttribute", readUnitTestingWriteOnlyInt8uAttributeInteractionInfo);
+ Map<String, CommandParameterInfo> readUnitTestingNullableGlobalEnumCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
+ InteractionInfo readUnitTestingNullableGlobalEnumAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.UnitTestingCluster) cluster).readNullableGlobalEnumAttribute(
+ (ChipClusters.UnitTestingCluster.NullableGlobalEnumAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedUnitTestingClusterNullableGlobalEnumAttributeCallback(),
+ readUnitTestingNullableGlobalEnumCommandParams
+ );
+ result.put("readNullableGlobalEnumAttribute", readUnitTestingNullableGlobalEnumAttributeInteractionInfo);
Map<String, CommandParameterInfo> readUnitTestingMeiInt8uCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readUnitTestingMeiInt8uAttributeInteractionInfo = new InteractionInfo(
(cluster, callback, commandArguments) -> {
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java
index 32759bb..93a48d7 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java
@@ -4827,6 +4827,28 @@
writeUnitTestingClusterErrorBooleanCommandParams
);
writeUnitTestingInteractionInfo.put("writeClusterErrorBooleanAttribute", writeUnitTestingClusterErrorBooleanAttributeInteractionInfo);
+ Map<String, CommandParameterInfo> writeUnitTestingGlobalEnumCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
+ CommandParameterInfo unitTestingglobalEnumCommandParameterInfo =
+ new CommandParameterInfo(
+ "value",
+ Integer.class,
+ Integer.class
+ );
+ writeUnitTestingGlobalEnumCommandParams.put(
+ "value",
+ unitTestingglobalEnumCommandParameterInfo
+ );
+ InteractionInfo writeUnitTestingGlobalEnumAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.UnitTestingCluster) cluster).writeGlobalEnumAttribute(
+ (DefaultClusterCallback) callback,
+ (Integer) commandArguments.get("value")
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(),
+ writeUnitTestingGlobalEnumCommandParams
+ );
+ writeUnitTestingInteractionInfo.put("writeGlobalEnumAttribute", writeUnitTestingGlobalEnumAttributeInteractionInfo);
Map<String, CommandParameterInfo> writeUnitTestingUnsupportedCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
CommandParameterInfo unitTestingunsupportedCommandParameterInfo =
new CommandParameterInfo(
@@ -5575,6 +5597,28 @@
writeUnitTestingWriteOnlyInt8uCommandParams
);
writeUnitTestingInteractionInfo.put("writeWriteOnlyInt8uAttribute", writeUnitTestingWriteOnlyInt8uAttributeInteractionInfo);
+ Map<String, CommandParameterInfo> writeUnitTestingNullableGlobalEnumCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
+ CommandParameterInfo unitTestingnullableGlobalEnumCommandParameterInfo =
+ new CommandParameterInfo(
+ "value",
+ Integer.class,
+ Integer.class
+ );
+ writeUnitTestingNullableGlobalEnumCommandParams.put(
+ "value",
+ unitTestingnullableGlobalEnumCommandParameterInfo
+ );
+ InteractionInfo writeUnitTestingNullableGlobalEnumAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.UnitTestingCluster) cluster).writeNullableGlobalEnumAttribute(
+ (DefaultClusterCallback) callback,
+ (Integer) commandArguments.get("value")
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(),
+ writeUnitTestingNullableGlobalEnumCommandParams
+ );
+ writeUnitTestingInteractionInfo.put("writeNullableGlobalEnumAttribute", writeUnitTestingNullableGlobalEnumAttributeInteractionInfo);
Map<String, CommandParameterInfo> writeUnitTestingMeiInt8uCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
CommandParameterInfo unitTestingmeiInt8uCommandParameterInfo =
new CommandParameterInfo(
diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni
index e101562..3cbd5cb 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni
+++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni
@@ -151,6 +151,7 @@
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNullablesAndOptionalsStruct.kt",
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterSimpleStruct.kt",
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestFabricScoped.kt",
+ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestGlobalStruct.kt",
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestListStructOctet.kt",
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UserLabelClusterLabelStruct.kt",
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WaterHeaterModeClusterModeOptionStruct.kt",
diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStruct.kt
index 6ec856c..74cfa88 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStruct.kt
+++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStruct.kt
@@ -17,6 +17,7 @@
package chip.devicecontroller.cluster.structs
import chip.devicecontroller.cluster.*
+import java.util.Optional
import matter.tlv.ContextSpecificTag
import matter.tlv.Tag
import matter.tlv.TlvReader
@@ -26,12 +27,14 @@
val a: UInt,
val b: Boolean,
val c: UnitTestingClusterSimpleStruct,
+ val d: Optional<UnitTestingClusterTestGlobalStruct>,
) {
override fun toString(): String = buildString {
append("UnitTestingClusterNestedStruct {\n")
append("\ta : $a\n")
append("\tb : $b\n")
append("\tc : $c\n")
+ append("\td : $d\n")
append("}\n")
}
@@ -41,6 +44,10 @@
put(ContextSpecificTag(TAG_A), a)
put(ContextSpecificTag(TAG_B), b)
c.toTlv(ContextSpecificTag(TAG_C), this)
+ if (d.isPresent) {
+ val optd = d.get()
+ optd.toTlv(ContextSpecificTag(TAG_D), this)
+ }
endStructure()
}
}
@@ -49,16 +56,25 @@
private const val TAG_A = 0
private const val TAG_B = 1
private const val TAG_C = 2
+ private const val TAG_D = 3
fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): UnitTestingClusterNestedStruct {
tlvReader.enterStructure(tlvTag)
val a = tlvReader.getUInt(ContextSpecificTag(TAG_A))
val b = tlvReader.getBoolean(ContextSpecificTag(TAG_B))
val c = UnitTestingClusterSimpleStruct.fromTlv(ContextSpecificTag(TAG_C), tlvReader)
+ val d =
+ if (tlvReader.isNextTag(ContextSpecificTag(TAG_D))) {
+ Optional.of(
+ UnitTestingClusterTestGlobalStruct.fromTlv(ContextSpecificTag(TAG_D), tlvReader)
+ )
+ } else {
+ Optional.empty()
+ }
tlvReader.exitContainer()
- return UnitTestingClusterNestedStruct(a, b, c)
+ return UnitTestingClusterNestedStruct(a, b, c, d)
}
}
}
diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterSimpleStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterSimpleStruct.kt
index 24f06fb..8a6d89c 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterSimpleStruct.kt
+++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterSimpleStruct.kt
@@ -17,6 +17,7 @@
package chip.devicecontroller.cluster.structs
import chip.devicecontroller.cluster.*
+import java.util.Optional
import matter.tlv.ContextSpecificTag
import matter.tlv.Tag
import matter.tlv.TlvReader
@@ -31,6 +32,7 @@
val f: UInt,
val g: Float,
val h: Double,
+ val i: Optional<UInt>,
) {
override fun toString(): String = buildString {
append("UnitTestingClusterSimpleStruct {\n")
@@ -42,6 +44,7 @@
append("\tf : $f\n")
append("\tg : $g\n")
append("\th : $h\n")
+ append("\ti : $i\n")
append("}\n")
}
@@ -56,6 +59,10 @@
put(ContextSpecificTag(TAG_F), f)
put(ContextSpecificTag(TAG_G), g)
put(ContextSpecificTag(TAG_H), h)
+ if (i.isPresent) {
+ val opti = i.get()
+ put(ContextSpecificTag(TAG_I), opti)
+ }
endStructure()
}
}
@@ -69,6 +76,7 @@
private const val TAG_F = 5
private const val TAG_G = 6
private const val TAG_H = 7
+ private const val TAG_I = 8
fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): UnitTestingClusterSimpleStruct {
tlvReader.enterStructure(tlvTag)
@@ -80,10 +88,16 @@
val f = tlvReader.getUInt(ContextSpecificTag(TAG_F))
val g = tlvReader.getFloat(ContextSpecificTag(TAG_G))
val h = tlvReader.getDouble(ContextSpecificTag(TAG_H))
+ val i =
+ if (tlvReader.isNextTag(ContextSpecificTag(TAG_I))) {
+ Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_I)))
+ } else {
+ Optional.empty()
+ }
tlvReader.exitContainer()
- return UnitTestingClusterSimpleStruct(a, b, c, d, e, f, g, h)
+ return UnitTestingClusterSimpleStruct(a, b, c, d, e, f, g, h, i)
}
}
}
diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestGlobalStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestGlobalStruct.kt
new file mode 100644
index 0000000..aa66049
--- /dev/null
+++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestGlobalStruct.kt
@@ -0,0 +1,92 @@
+/*
+ *
+ * Copyright (c) 2023 Project CHIP Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package chip.devicecontroller.cluster.structs
+
+import chip.devicecontroller.cluster.*
+import java.util.Optional
+import matter.tlv.ContextSpecificTag
+import matter.tlv.Tag
+import matter.tlv.TlvReader
+import matter.tlv.TlvWriter
+
+class UnitTestingClusterTestGlobalStruct(
+ val name: String,
+ val myBitmap: ULong?,
+ val myEnum: Optional<UInt>?,
+) {
+ override fun toString(): String = buildString {
+ append("UnitTestingClusterTestGlobalStruct {\n")
+ append("\tname : $name\n")
+ append("\tmyBitmap : $myBitmap\n")
+ append("\tmyEnum : $myEnum\n")
+ append("}\n")
+ }
+
+ fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
+ tlvWriter.apply {
+ startStructure(tlvTag)
+ put(ContextSpecificTag(TAG_NAME), name)
+ if (myBitmap != null) {
+ put(ContextSpecificTag(TAG_MY_BITMAP), myBitmap)
+ } else {
+ putNull(ContextSpecificTag(TAG_MY_BITMAP))
+ }
+ if (myEnum != null) {
+ if (myEnum.isPresent) {
+ val optmyEnum = myEnum.get()
+ put(ContextSpecificTag(TAG_MY_ENUM), optmyEnum)
+ }
+ } else {
+ putNull(ContextSpecificTag(TAG_MY_ENUM))
+ }
+ endStructure()
+ }
+ }
+
+ companion object {
+ private const val TAG_NAME = 0
+ private const val TAG_MY_BITMAP = 1
+ private const val TAG_MY_ENUM = 2
+
+ fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): UnitTestingClusterTestGlobalStruct {
+ tlvReader.enterStructure(tlvTag)
+ val name = tlvReader.getString(ContextSpecificTag(TAG_NAME))
+ val myBitmap =
+ if (!tlvReader.isNull()) {
+ tlvReader.getULong(ContextSpecificTag(TAG_MY_BITMAP))
+ } else {
+ tlvReader.getNull(ContextSpecificTag(TAG_MY_BITMAP))
+ null
+ }
+ val myEnum =
+ if (!tlvReader.isNull()) {
+ if (tlvReader.isNextTag(ContextSpecificTag(TAG_MY_ENUM))) {
+ Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_MY_ENUM)))
+ } else {
+ Optional.empty()
+ }
+ } else {
+ tlvReader.getNull(ContextSpecificTag(TAG_MY_ENUM))
+ null
+ }
+
+ tlvReader.exitContainer()
+
+ return UnitTestingClusterTestGlobalStruct(name, myBitmap, myEnum)
+ }
+ }
+}
diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/UnitTestingCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/UnitTestingCluster.kt
index b50ab44..74402b1 100644
--- a/src/controller/java/generated/java/matter/controller/cluster/clusters/UnitTestingCluster.kt
+++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/UnitTestingCluster.kt
@@ -123,6 +123,8 @@
class StringEchoResponse(val payload: ByteArray)
+ class GlobalEchoResponse(val field1: UnitTestingClusterTestGlobalStruct, val field2: UByte)
+
class TestDifferentVendorMeiResponse(val arg1: UByte, val eventNumber: ULong)
class ListInt8uAttribute(val value: List<UByte>)
@@ -203,6 +205,17 @@
object SubscriptionEstablished : ListFabricScopedAttributeSubscriptionState()
}
+ class GlobalStructAttribute(val value: UnitTestingClusterTestGlobalStruct)
+
+ sealed class GlobalStructAttributeSubscriptionState {
+ data class Success(val value: UnitTestingClusterTestGlobalStruct) :
+ GlobalStructAttributeSubscriptionState()
+
+ data class Error(val exception: Exception) : GlobalStructAttributeSubscriptionState()
+
+ object SubscriptionEstablished : GlobalStructAttributeSubscriptionState()
+ }
+
class NullableBooleanAttribute(val value: Boolean?)
sealed class NullableBooleanAttributeSubscriptionState {
@@ -541,6 +554,27 @@
object SubscriptionEstablished : NullableRangeRestrictedInt16sAttributeSubscriptionState()
}
+ class NullableGlobalEnumAttribute(val value: UByte?)
+
+ sealed class NullableGlobalEnumAttributeSubscriptionState {
+ data class Success(val value: UByte?) : NullableGlobalEnumAttributeSubscriptionState()
+
+ data class Error(val exception: Exception) : NullableGlobalEnumAttributeSubscriptionState()
+
+ object SubscriptionEstablished : NullableGlobalEnumAttributeSubscriptionState()
+ }
+
+ class NullableGlobalStructAttribute(val value: UnitTestingClusterTestGlobalStruct?)
+
+ sealed class NullableGlobalStructAttributeSubscriptionState {
+ data class Success(val value: UnitTestingClusterTestGlobalStruct?) :
+ NullableGlobalStructAttributeSubscriptionState()
+
+ data class Error(val exception: Exception) : NullableGlobalStructAttributeSubscriptionState()
+
+ object SubscriptionEstablished : NullableGlobalStructAttributeSubscriptionState()
+ }
+
class GeneratedCommandListAttribute(val value: List<UInt>)
sealed class GeneratedCommandListAttributeSubscriptionState {
@@ -2386,6 +2420,68 @@
return StringEchoResponse(payload_decoded)
}
+ suspend fun globalEchoRequest(
+ field1: UnitTestingClusterTestGlobalStruct,
+ field2: UByte,
+ timedInvokeTimeout: Duration? = null,
+ ): GlobalEchoResponse {
+ val commandId: UInt = 25u
+
+ val tlvWriter = TlvWriter()
+ tlvWriter.startStructure(AnonymousTag)
+
+ val TAG_FIELD1_REQ: Int = 0
+ field1.toTlv(ContextSpecificTag(TAG_FIELD1_REQ), tlvWriter)
+
+ val TAG_FIELD2_REQ: Int = 1
+ tlvWriter.put(ContextSpecificTag(TAG_FIELD2_REQ), field2)
+ tlvWriter.endStructure()
+
+ val request: InvokeRequest =
+ InvokeRequest(
+ CommandPath(endpointId, clusterId = CLUSTER_ID, commandId),
+ tlvPayload = tlvWriter.getEncoded(),
+ timedRequest = timedInvokeTimeout,
+ )
+
+ val response: InvokeResponse = controller.invoke(request)
+ logger.log(Level.FINE, "Invoke command succeeded: ${response}")
+
+ val tlvReader = TlvReader(response.payload)
+ tlvReader.enterStructure(AnonymousTag)
+ val TAG_FIELD1: Int = 0
+ var field1_decoded: UnitTestingClusterTestGlobalStruct? = null
+
+ val TAG_FIELD2: Int = 1
+ var field2_decoded: UByte? = null
+
+ while (!tlvReader.isEndOfContainer()) {
+ val tag = tlvReader.peekElement().tag
+
+ if (tag == ContextSpecificTag(TAG_FIELD1)) {
+ field1_decoded = UnitTestingClusterTestGlobalStruct.fromTlv(tag, tlvReader)
+ }
+
+ if (tag == ContextSpecificTag(TAG_FIELD2)) {
+ field2_decoded = tlvReader.getUByte(tag)
+ } else {
+ tlvReader.skipElement()
+ }
+ }
+
+ if (field1_decoded == null) {
+ throw IllegalStateException("field1 not found in TLV")
+ }
+
+ if (field2_decoded == null) {
+ throw IllegalStateException("field2 not found in TLV")
+ }
+
+ tlvReader.exitContainer()
+
+ return GlobalEchoResponse(field1_decoded, field2_decoded)
+ }
+
suspend fun testDifferentVendorMeiRequest(
arg1: UByte,
timedInvokeTimeout: Duration? = null,
@@ -8305,6 +8401,253 @@
}
}
+ suspend fun readGlobalEnumAttribute(): UByte {
+ val ATTRIBUTE_ID: UInt = 51u
+
+ val attributePath =
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+
+ val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath))
+
+ val response = controller.read(readRequest)
+
+ if (response.successes.isEmpty()) {
+ logger.log(Level.WARNING, "Read command failed")
+ throw IllegalStateException("Read command failed with failures: ${response.failures}")
+ }
+
+ logger.log(Level.FINE, "Read command succeeded")
+
+ val attributeData =
+ response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull {
+ it.path.attributeId == ATTRIBUTE_ID
+ }
+
+ requireNotNull(attributeData) { "Globalenum attribute not found in response" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: UByte = tlvReader.getUByte(AnonymousTag)
+
+ return decodedValue
+ }
+
+ suspend fun writeGlobalEnumAttribute(value: UByte, timedWriteTimeout: Duration? = null) {
+ val ATTRIBUTE_ID: UInt = 51u
+
+ val tlvWriter = TlvWriter()
+ tlvWriter.put(AnonymousTag, value)
+
+ val writeRequests: WriteRequests =
+ WriteRequests(
+ requests =
+ listOf(
+ WriteRequest(
+ attributePath =
+ AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID),
+ tlvPayload = tlvWriter.getEncoded(),
+ )
+ ),
+ timedRequest = timedWriteTimeout,
+ )
+
+ val response: WriteResponse = controller.write(writeRequests)
+
+ when (response) {
+ is WriteResponse.Success -> {
+ logger.log(Level.FINE, "Write command succeeded")
+ }
+ is WriteResponse.PartialWriteFailure -> {
+ val aggregatedErrorMessage =
+ response.failures.joinToString("\n") { failure ->
+ "Error at ${failure.attributePath}: ${failure.ex.message}"
+ }
+
+ response.failures.forEach { failure ->
+ logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}")
+ }
+
+ throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage")
+ }
+ }
+ }
+
+ suspend fun subscribeGlobalEnumAttribute(
+ minInterval: Int,
+ maxInterval: Int,
+ ): Flow<UByteSubscriptionState> {
+ val ATTRIBUTE_ID: UInt = 51u
+ val attributePaths =
+ listOf(
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+ )
+
+ val subscribeRequest: SubscribeRequest =
+ SubscribeRequest(
+ eventPaths = emptyList(),
+ attributePaths = attributePaths,
+ minInterval = Duration.ofSeconds(minInterval.toLong()),
+ maxInterval = Duration.ofSeconds(maxInterval.toLong()),
+ )
+
+ return controller.subscribe(subscribeRequest).transform { subscriptionState ->
+ when (subscriptionState) {
+ is SubscriptionState.SubscriptionErrorNotification -> {
+ emit(
+ UByteSubscriptionState.Error(
+ Exception(
+ "Subscription terminated with error code: ${subscriptionState.terminationCause}"
+ )
+ )
+ )
+ }
+ is SubscriptionState.NodeStateUpdate -> {
+ val attributeData =
+ subscriptionState.updateState.successes
+ .filterIsInstance<ReadData.Attribute>()
+ .firstOrNull { it.path.attributeId == ATTRIBUTE_ID }
+
+ requireNotNull(attributeData) { "Globalenum attribute not found in Node State update" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: UByte = tlvReader.getUByte(AnonymousTag)
+
+ emit(UByteSubscriptionState.Success(decodedValue))
+ }
+ SubscriptionState.SubscriptionEstablished -> {
+ emit(UByteSubscriptionState.SubscriptionEstablished)
+ }
+ }
+ }
+ }
+
+ suspend fun readGlobalStructAttribute(): GlobalStructAttribute {
+ val ATTRIBUTE_ID: UInt = 52u
+
+ val attributePath =
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+
+ val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath))
+
+ val response = controller.read(readRequest)
+
+ if (response.successes.isEmpty()) {
+ logger.log(Level.WARNING, "Read command failed")
+ throw IllegalStateException("Read command failed with failures: ${response.failures}")
+ }
+
+ logger.log(Level.FINE, "Read command succeeded")
+
+ val attributeData =
+ response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull {
+ it.path.attributeId == ATTRIBUTE_ID
+ }
+
+ requireNotNull(attributeData) { "Globalstruct attribute not found in response" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: UnitTestingClusterTestGlobalStruct =
+ UnitTestingClusterTestGlobalStruct.fromTlv(AnonymousTag, tlvReader)
+
+ return GlobalStructAttribute(decodedValue)
+ }
+
+ suspend fun writeGlobalStructAttribute(
+ value: UnitTestingClusterTestGlobalStruct,
+ timedWriteTimeout: Duration? = null,
+ ) {
+ val ATTRIBUTE_ID: UInt = 52u
+
+ val tlvWriter = TlvWriter()
+ value.toTlv(AnonymousTag, tlvWriter)
+
+ val writeRequests: WriteRequests =
+ WriteRequests(
+ requests =
+ listOf(
+ WriteRequest(
+ attributePath =
+ AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID),
+ tlvPayload = tlvWriter.getEncoded(),
+ )
+ ),
+ timedRequest = timedWriteTimeout,
+ )
+
+ val response: WriteResponse = controller.write(writeRequests)
+
+ when (response) {
+ is WriteResponse.Success -> {
+ logger.log(Level.FINE, "Write command succeeded")
+ }
+ is WriteResponse.PartialWriteFailure -> {
+ val aggregatedErrorMessage =
+ response.failures.joinToString("\n") { failure ->
+ "Error at ${failure.attributePath}: ${failure.ex.message}"
+ }
+
+ response.failures.forEach { failure ->
+ logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}")
+ }
+
+ throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage")
+ }
+ }
+ }
+
+ suspend fun subscribeGlobalStructAttribute(
+ minInterval: Int,
+ maxInterval: Int,
+ ): Flow<GlobalStructAttributeSubscriptionState> {
+ val ATTRIBUTE_ID: UInt = 52u
+ val attributePaths =
+ listOf(
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+ )
+
+ val subscribeRequest: SubscribeRequest =
+ SubscribeRequest(
+ eventPaths = emptyList(),
+ attributePaths = attributePaths,
+ minInterval = Duration.ofSeconds(minInterval.toLong()),
+ maxInterval = Duration.ofSeconds(maxInterval.toLong()),
+ )
+
+ return controller.subscribe(subscribeRequest).transform { subscriptionState ->
+ when (subscriptionState) {
+ is SubscriptionState.SubscriptionErrorNotification -> {
+ emit(
+ GlobalStructAttributeSubscriptionState.Error(
+ Exception(
+ "Subscription terminated with error code: ${subscriptionState.terminationCause}"
+ )
+ )
+ )
+ }
+ is SubscriptionState.NodeStateUpdate -> {
+ val attributeData =
+ subscriptionState.updateState.successes
+ .filterIsInstance<ReadData.Attribute>()
+ .firstOrNull { it.path.attributeId == ATTRIBUTE_ID }
+
+ requireNotNull(attributeData) { "Globalstruct attribute not found in Node State update" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: UnitTestingClusterTestGlobalStruct =
+ UnitTestingClusterTestGlobalStruct.fromTlv(AnonymousTag, tlvReader)
+
+ emit(GlobalStructAttributeSubscriptionState.Success(decodedValue))
+ }
+ SubscriptionState.SubscriptionEstablished -> {
+ emit(GlobalStructAttributeSubscriptionState.SubscriptionEstablished)
+ }
+ }
+ }
+ }
+
suspend fun readUnsupportedAttribute(): Boolean? {
val ATTRIBUTE_ID: UInt = 255u
@@ -13051,6 +13394,279 @@
}
}
+ suspend fun readNullableGlobalEnumAttribute(): NullableGlobalEnumAttribute {
+ val ATTRIBUTE_ID: UInt = 16435u
+
+ val attributePath =
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+
+ val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath))
+
+ val response = controller.read(readRequest)
+
+ if (response.successes.isEmpty()) {
+ logger.log(Level.WARNING, "Read command failed")
+ throw IllegalStateException("Read command failed with failures: ${response.failures}")
+ }
+
+ logger.log(Level.FINE, "Read command succeeded")
+
+ val attributeData =
+ response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull {
+ it.path.attributeId == ATTRIBUTE_ID
+ }
+
+ requireNotNull(attributeData) { "Nullableglobalenum attribute not found in response" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: UByte? =
+ if (!tlvReader.isNull()) {
+ tlvReader.getUByte(AnonymousTag)
+ } else {
+ tlvReader.getNull(AnonymousTag)
+ null
+ }
+
+ return NullableGlobalEnumAttribute(decodedValue)
+ }
+
+ suspend fun writeNullableGlobalEnumAttribute(value: UByte, timedWriteTimeout: Duration? = null) {
+ val ATTRIBUTE_ID: UInt = 16435u
+
+ val tlvWriter = TlvWriter()
+ tlvWriter.put(AnonymousTag, value)
+
+ val writeRequests: WriteRequests =
+ WriteRequests(
+ requests =
+ listOf(
+ WriteRequest(
+ attributePath =
+ AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID),
+ tlvPayload = tlvWriter.getEncoded(),
+ )
+ ),
+ timedRequest = timedWriteTimeout,
+ )
+
+ val response: WriteResponse = controller.write(writeRequests)
+
+ when (response) {
+ is WriteResponse.Success -> {
+ logger.log(Level.FINE, "Write command succeeded")
+ }
+ is WriteResponse.PartialWriteFailure -> {
+ val aggregatedErrorMessage =
+ response.failures.joinToString("\n") { failure ->
+ "Error at ${failure.attributePath}: ${failure.ex.message}"
+ }
+
+ response.failures.forEach { failure ->
+ logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}")
+ }
+
+ throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage")
+ }
+ }
+ }
+
+ suspend fun subscribeNullableGlobalEnumAttribute(
+ minInterval: Int,
+ maxInterval: Int,
+ ): Flow<NullableGlobalEnumAttributeSubscriptionState> {
+ val ATTRIBUTE_ID: UInt = 16435u
+ val attributePaths =
+ listOf(
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+ )
+
+ val subscribeRequest: SubscribeRequest =
+ SubscribeRequest(
+ eventPaths = emptyList(),
+ attributePaths = attributePaths,
+ minInterval = Duration.ofSeconds(minInterval.toLong()),
+ maxInterval = Duration.ofSeconds(maxInterval.toLong()),
+ )
+
+ return controller.subscribe(subscribeRequest).transform { subscriptionState ->
+ when (subscriptionState) {
+ is SubscriptionState.SubscriptionErrorNotification -> {
+ emit(
+ NullableGlobalEnumAttributeSubscriptionState.Error(
+ Exception(
+ "Subscription terminated with error code: ${subscriptionState.terminationCause}"
+ )
+ )
+ )
+ }
+ is SubscriptionState.NodeStateUpdate -> {
+ val attributeData =
+ subscriptionState.updateState.successes
+ .filterIsInstance<ReadData.Attribute>()
+ .firstOrNull { it.path.attributeId == ATTRIBUTE_ID }
+
+ requireNotNull(attributeData) {
+ "Nullableglobalenum attribute not found in Node State update"
+ }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: UByte? =
+ if (!tlvReader.isNull()) {
+ tlvReader.getUByte(AnonymousTag)
+ } else {
+ tlvReader.getNull(AnonymousTag)
+ null
+ }
+
+ decodedValue?.let { emit(NullableGlobalEnumAttributeSubscriptionState.Success(it)) }
+ }
+ SubscriptionState.SubscriptionEstablished -> {
+ emit(NullableGlobalEnumAttributeSubscriptionState.SubscriptionEstablished)
+ }
+ }
+ }
+ }
+
+ suspend fun readNullableGlobalStructAttribute(): NullableGlobalStructAttribute {
+ val ATTRIBUTE_ID: UInt = 16436u
+
+ val attributePath =
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+
+ val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath))
+
+ val response = controller.read(readRequest)
+
+ if (response.successes.isEmpty()) {
+ logger.log(Level.WARNING, "Read command failed")
+ throw IllegalStateException("Read command failed with failures: ${response.failures}")
+ }
+
+ logger.log(Level.FINE, "Read command succeeded")
+
+ val attributeData =
+ response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull {
+ it.path.attributeId == ATTRIBUTE_ID
+ }
+
+ requireNotNull(attributeData) { "Nullableglobalstruct attribute not found in response" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: UnitTestingClusterTestGlobalStruct? =
+ if (!tlvReader.isNull()) {
+ UnitTestingClusterTestGlobalStruct.fromTlv(AnonymousTag, tlvReader)
+ } else {
+ tlvReader.getNull(AnonymousTag)
+ null
+ }
+
+ return NullableGlobalStructAttribute(decodedValue)
+ }
+
+ suspend fun writeNullableGlobalStructAttribute(
+ value: UnitTestingClusterTestGlobalStruct,
+ timedWriteTimeout: Duration? = null,
+ ) {
+ val ATTRIBUTE_ID: UInt = 16436u
+
+ val tlvWriter = TlvWriter()
+ value.toTlv(AnonymousTag, tlvWriter)
+
+ val writeRequests: WriteRequests =
+ WriteRequests(
+ requests =
+ listOf(
+ WriteRequest(
+ attributePath =
+ AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID),
+ tlvPayload = tlvWriter.getEncoded(),
+ )
+ ),
+ timedRequest = timedWriteTimeout,
+ )
+
+ val response: WriteResponse = controller.write(writeRequests)
+
+ when (response) {
+ is WriteResponse.Success -> {
+ logger.log(Level.FINE, "Write command succeeded")
+ }
+ is WriteResponse.PartialWriteFailure -> {
+ val aggregatedErrorMessage =
+ response.failures.joinToString("\n") { failure ->
+ "Error at ${failure.attributePath}: ${failure.ex.message}"
+ }
+
+ response.failures.forEach { failure ->
+ logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}")
+ }
+
+ throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage")
+ }
+ }
+ }
+
+ suspend fun subscribeNullableGlobalStructAttribute(
+ minInterval: Int,
+ maxInterval: Int,
+ ): Flow<NullableGlobalStructAttributeSubscriptionState> {
+ val ATTRIBUTE_ID: UInt = 16436u
+ val attributePaths =
+ listOf(
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+ )
+
+ val subscribeRequest: SubscribeRequest =
+ SubscribeRequest(
+ eventPaths = emptyList(),
+ attributePaths = attributePaths,
+ minInterval = Duration.ofSeconds(minInterval.toLong()),
+ maxInterval = Duration.ofSeconds(maxInterval.toLong()),
+ )
+
+ return controller.subscribe(subscribeRequest).transform { subscriptionState ->
+ when (subscriptionState) {
+ is SubscriptionState.SubscriptionErrorNotification -> {
+ emit(
+ NullableGlobalStructAttributeSubscriptionState.Error(
+ Exception(
+ "Subscription terminated with error code: ${subscriptionState.terminationCause}"
+ )
+ )
+ )
+ }
+ is SubscriptionState.NodeStateUpdate -> {
+ val attributeData =
+ subscriptionState.updateState.successes
+ .filterIsInstance<ReadData.Attribute>()
+ .firstOrNull { it.path.attributeId == ATTRIBUTE_ID }
+
+ requireNotNull(attributeData) {
+ "Nullableglobalstruct attribute not found in Node State update"
+ }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: UnitTestingClusterTestGlobalStruct? =
+ if (!tlvReader.isNull()) {
+ UnitTestingClusterTestGlobalStruct.fromTlv(AnonymousTag, tlvReader)
+ } else {
+ tlvReader.getNull(AnonymousTag)
+ null
+ }
+
+ decodedValue?.let { emit(NullableGlobalStructAttributeSubscriptionState.Success(it)) }
+ }
+ SubscriptionState.SubscriptionEstablished -> {
+ emit(NullableGlobalStructAttributeSubscriptionState.SubscriptionEstablished)
+ }
+ }
+ }
+ }
+
suspend fun readMeiInt8uAttribute(): UByte {
val ATTRIBUTE_ID: UInt = 4294070017u
diff --git a/src/controller/java/generated/java/matter/controller/cluster/files.gni b/src/controller/java/generated/java/matter/controller/cluster/files.gni
index dc0b4b0..021d82d 100644
--- a/src/controller/java/generated/java/matter/controller/cluster/files.gni
+++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni
@@ -151,6 +151,7 @@
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterNullablesAndOptionalsStruct.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterSimpleStruct.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterTestFabricScoped.kt",
+ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterTestGlobalStruct.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterTestListStructOctet.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/UserLabelClusterLabelStruct.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WaterHeaterModeClusterModeOptionStruct.kt",
diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterNestedStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterNestedStruct.kt
index 3552ec2..d57a043 100644
--- a/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterNestedStruct.kt
+++ b/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterNestedStruct.kt
@@ -16,6 +16,7 @@
*/
package matter.controller.cluster.structs
+import java.util.Optional
import matter.controller.cluster.*
import matter.tlv.ContextSpecificTag
import matter.tlv.Tag
@@ -26,12 +27,14 @@
val a: UByte,
val b: Boolean,
val c: UnitTestingClusterSimpleStruct,
+ val d: Optional<UnitTestingClusterTestGlobalStruct>,
) {
override fun toString(): String = buildString {
append("UnitTestingClusterNestedStruct {\n")
append("\ta : $a\n")
append("\tb : $b\n")
append("\tc : $c\n")
+ append("\td : $d\n")
append("}\n")
}
@@ -41,6 +44,10 @@
put(ContextSpecificTag(TAG_A), a)
put(ContextSpecificTag(TAG_B), b)
c.toTlv(ContextSpecificTag(TAG_C), this)
+ if (d.isPresent) {
+ val optd = d.get()
+ optd.toTlv(ContextSpecificTag(TAG_D), this)
+ }
endStructure()
}
}
@@ -49,16 +56,25 @@
private const val TAG_A = 0
private const val TAG_B = 1
private const val TAG_C = 2
+ private const val TAG_D = 3
fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): UnitTestingClusterNestedStruct {
tlvReader.enterStructure(tlvTag)
val a = tlvReader.getUByte(ContextSpecificTag(TAG_A))
val b = tlvReader.getBoolean(ContextSpecificTag(TAG_B))
val c = UnitTestingClusterSimpleStruct.fromTlv(ContextSpecificTag(TAG_C), tlvReader)
+ val d =
+ if (tlvReader.isNextTag(ContextSpecificTag(TAG_D))) {
+ Optional.of(
+ UnitTestingClusterTestGlobalStruct.fromTlv(ContextSpecificTag(TAG_D), tlvReader)
+ )
+ } else {
+ Optional.empty()
+ }
tlvReader.exitContainer()
- return UnitTestingClusterNestedStruct(a, b, c)
+ return UnitTestingClusterNestedStruct(a, b, c, d)
}
}
}
diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterSimpleStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterSimpleStruct.kt
index 864a28f..722445e 100644
--- a/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterSimpleStruct.kt
+++ b/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterSimpleStruct.kt
@@ -16,6 +16,7 @@
*/
package matter.controller.cluster.structs
+import java.util.Optional
import matter.controller.cluster.*
import matter.tlv.ContextSpecificTag
import matter.tlv.Tag
@@ -31,6 +32,7 @@
val f: UByte,
val g: Float,
val h: Double,
+ val i: Optional<UByte>,
) {
override fun toString(): String = buildString {
append("UnitTestingClusterSimpleStruct {\n")
@@ -42,6 +44,7 @@
append("\tf : $f\n")
append("\tg : $g\n")
append("\th : $h\n")
+ append("\ti : $i\n")
append("}\n")
}
@@ -56,6 +59,10 @@
put(ContextSpecificTag(TAG_F), f)
put(ContextSpecificTag(TAG_G), g)
put(ContextSpecificTag(TAG_H), h)
+ if (i.isPresent) {
+ val opti = i.get()
+ put(ContextSpecificTag(TAG_I), opti)
+ }
endStructure()
}
}
@@ -69,6 +76,7 @@
private const val TAG_F = 5
private const val TAG_G = 6
private const val TAG_H = 7
+ private const val TAG_I = 8
fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): UnitTestingClusterSimpleStruct {
tlvReader.enterStructure(tlvTag)
@@ -80,10 +88,16 @@
val f = tlvReader.getUByte(ContextSpecificTag(TAG_F))
val g = tlvReader.getFloat(ContextSpecificTag(TAG_G))
val h = tlvReader.getDouble(ContextSpecificTag(TAG_H))
+ val i =
+ if (tlvReader.isNextTag(ContextSpecificTag(TAG_I))) {
+ Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_I)))
+ } else {
+ Optional.empty()
+ }
tlvReader.exitContainer()
- return UnitTestingClusterSimpleStruct(a, b, c, d, e, f, g, h)
+ return UnitTestingClusterSimpleStruct(a, b, c, d, e, f, g, h, i)
}
}
}
diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterTestGlobalStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterTestGlobalStruct.kt
new file mode 100644
index 0000000..66caded
--- /dev/null
+++ b/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterTestGlobalStruct.kt
@@ -0,0 +1,92 @@
+/*
+ *
+ * Copyright (c) 2023 Project CHIP Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package matter.controller.cluster.structs
+
+import java.util.Optional
+import matter.controller.cluster.*
+import matter.tlv.ContextSpecificTag
+import matter.tlv.Tag
+import matter.tlv.TlvReader
+import matter.tlv.TlvWriter
+
+class UnitTestingClusterTestGlobalStruct(
+ val name: String,
+ val myBitmap: UInt?,
+ val myEnum: Optional<UByte>?,
+) {
+ override fun toString(): String = buildString {
+ append("UnitTestingClusterTestGlobalStruct {\n")
+ append("\tname : $name\n")
+ append("\tmyBitmap : $myBitmap\n")
+ append("\tmyEnum : $myEnum\n")
+ append("}\n")
+ }
+
+ fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
+ tlvWriter.apply {
+ startStructure(tlvTag)
+ put(ContextSpecificTag(TAG_NAME), name)
+ if (myBitmap != null) {
+ put(ContextSpecificTag(TAG_MY_BITMAP), myBitmap)
+ } else {
+ putNull(ContextSpecificTag(TAG_MY_BITMAP))
+ }
+ if (myEnum != null) {
+ if (myEnum.isPresent) {
+ val optmyEnum = myEnum.get()
+ put(ContextSpecificTag(TAG_MY_ENUM), optmyEnum)
+ }
+ } else {
+ putNull(ContextSpecificTag(TAG_MY_ENUM))
+ }
+ endStructure()
+ }
+ }
+
+ companion object {
+ private const val TAG_NAME = 0
+ private const val TAG_MY_BITMAP = 1
+ private const val TAG_MY_ENUM = 2
+
+ fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): UnitTestingClusterTestGlobalStruct {
+ tlvReader.enterStructure(tlvTag)
+ val name = tlvReader.getString(ContextSpecificTag(TAG_NAME))
+ val myBitmap =
+ if (!tlvReader.isNull()) {
+ tlvReader.getUInt(ContextSpecificTag(TAG_MY_BITMAP))
+ } else {
+ tlvReader.getNull(ContextSpecificTag(TAG_MY_BITMAP))
+ null
+ }
+ val myEnum =
+ if (!tlvReader.isNull()) {
+ if (tlvReader.isNextTag(ContextSpecificTag(TAG_MY_ENUM))) {
+ Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_MY_ENUM)))
+ } else {
+ Optional.empty()
+ }
+ } else {
+ tlvReader.getNull(ContextSpecificTag(TAG_MY_ENUM))
+ null
+ }
+
+ tlvReader.exitContainer()
+
+ return UnitTestingClusterTestGlobalStruct(name, myBitmap, myEnum)
+ }
+ }
+}
diff --git a/src/controller/java/tests/chip/devicecontroller/cluster/ChipClusterEventStructTest.kt b/src/controller/java/tests/chip/devicecontroller/cluster/ChipClusterEventStructTest.kt
index 55c880e..bfee37f 100644
--- a/src/controller/java/tests/chip/devicecontroller/cluster/ChipClusterEventStructTest.kt
+++ b/src/controller/java/tests/chip/devicecontroller/cluster/ChipClusterEventStructTest.kt
@@ -19,6 +19,7 @@
import chip.devicecontroller.cluster.eventstructs.UnitTestingClusterTestEventEvent
import chip.devicecontroller.cluster.eventstructs.UnitTestingClusterTestFabricScopedEventEvent
import chip.devicecontroller.cluster.structs.UnitTestingClusterSimpleStruct
+import java.util.Optional
import matter.tlv.AnonymousTag
import matter.tlv.TlvReader
import matter.tlv.TlvWriter
@@ -28,9 +29,29 @@
@Test
fun testEventEventTlvTest() {
val simpleStruct =
- UnitTestingClusterSimpleStruct(1U, true, 2U, byteArrayOf(0x00, 0x01), "test", 3U, 4.5f, 6.7)
+ UnitTestingClusterSimpleStruct(
+ 1U,
+ true,
+ 2U,
+ byteArrayOf(0x00, 0x01),
+ "test",
+ 3U,
+ 4.5f,
+ 6.7,
+ Optional.empty()
+ )
val simpleStruct2 =
- UnitTestingClusterSimpleStruct(8U, false, 9U, byteArrayOf(0x02, 0x03), "test2", 4U, 5.6f, 7.8)
+ UnitTestingClusterSimpleStruct(
+ 8U,
+ false,
+ 9U,
+ byteArrayOf(0x02, 0x03),
+ "test2",
+ 4U,
+ 5.6f,
+ 7.8,
+ Optional.empty()
+ )
val struct =
UnitTestingClusterTestEventEvent(
1U,
diff --git a/src/controller/java/tests/chip/devicecontroller/cluster/ChipClusterStructTest.kt b/src/controller/java/tests/chip/devicecontroller/cluster/ChipClusterStructTest.kt
index ffa0044..a38a71d 100644
--- a/src/controller/java/tests/chip/devicecontroller/cluster/ChipClusterStructTest.kt
+++ b/src/controller/java/tests/chip/devicecontroller/cluster/ChipClusterStructTest.kt
@@ -35,9 +35,29 @@
@Test
fun doubleNestedStructTlvTest() {
val simpleStruct =
- UnitTestingClusterSimpleStruct(1U, true, 2U, byteArrayOf(0x00, 0x01), "test", 3U, 4.5f, 6.7)
+ UnitTestingClusterSimpleStruct(
+ 1U,
+ true,
+ 2U,
+ byteArrayOf(0x00, 0x01),
+ "test",
+ 3U,
+ 4.5f,
+ 6.7,
+ Optional.empty()
+ )
val simpleStruct2 =
- UnitTestingClusterSimpleStruct(8U, false, 9U, byteArrayOf(0x02, 0x03), "test2", 4U, 5.6f, 7.8)
+ UnitTestingClusterSimpleStruct(
+ 8U,
+ false,
+ 9U,
+ byteArrayOf(0x02, 0x03),
+ "test2",
+ 4U,
+ 5.6f,
+ 7.8,
+ Optional.empty()
+ )
val nestedStructList =
UnitTestingClusterNestedStructList(
1U,
@@ -82,7 +102,17 @@
@Test
fun nullablesAndOptionalsStructTlvTest1() {
val simpleStruct =
- UnitTestingClusterSimpleStruct(1U, true, 2U, byteArrayOf(0x00, 0x01), "test", 3U, 4.5f, 6.7)
+ UnitTestingClusterSimpleStruct(
+ 1U,
+ true,
+ 2U,
+ byteArrayOf(0x00, 0x01),
+ "test",
+ 3U,
+ 4.5f,
+ 6.7,
+ Optional.empty()
+ )
val struct =
UnitTestingClusterNullablesAndOptionalsStruct(
1U,
@@ -121,7 +151,17 @@
// Optional Check - 1
fun nullablesAndOptionalsStructTlvTest2() {
val simpleStruct =
- UnitTestingClusterSimpleStruct(1U, true, 2U, byteArrayOf(0x00, 0x01), "test", 3U, 4.5f, 6.7)
+ UnitTestingClusterSimpleStruct(
+ 1U,
+ true,
+ 2U,
+ byteArrayOf(0x00, 0x01),
+ "test",
+ 3U,
+ 4.5f,
+ 6.7,
+ Optional.empty()
+ )
val struct =
UnitTestingClusterNullablesAndOptionalsStruct(
1U,
@@ -160,7 +200,17 @@
// Optional Check - 2
fun nullablesAndOptionalsStructTlvTest3() {
val simpleStruct =
- UnitTestingClusterSimpleStruct(1U, true, 2U, byteArrayOf(0x00, 0x01), "test", 3U, 4.5f, 6.7)
+ UnitTestingClusterSimpleStruct(
+ 1U,
+ true,
+ 2U,
+ byteArrayOf(0x00, 0x01),
+ "test",
+ 3U,
+ 4.5f,
+ 6.7,
+ Optional.empty()
+ )
val struct =
UnitTestingClusterNullablesAndOptionalsStruct(
1U,
@@ -199,7 +249,17 @@
// Nullable check - 1
fun nullablesAndOptionalsStructTlvTest4() {
val simpleStruct =
- UnitTestingClusterSimpleStruct(1U, true, 2U, byteArrayOf(0x00, 0x01), "test", 3U, 4.5f, 6.7)
+ UnitTestingClusterSimpleStruct(
+ 1U,
+ true,
+ 2U,
+ byteArrayOf(0x00, 0x01),
+ "test",
+ 3U,
+ 4.5f,
+ 6.7,
+ Optional.empty()
+ )
val struct =
UnitTestingClusterNullablesAndOptionalsStruct(
1U,
@@ -238,7 +298,17 @@
// Nullable check - 2
fun nullablesAndOptionalsStructTlvTest5() {
val simpleStruct =
- UnitTestingClusterSimpleStruct(1U, true, 2U, byteArrayOf(0x00, 0x01), "test", 3U, 4.5f, 6.7)
+ UnitTestingClusterSimpleStruct(
+ 1U,
+ true,
+ 2U,
+ byteArrayOf(0x00, 0x01),
+ "test",
+ 3U,
+ 4.5f,
+ 6.7,
+ Optional.empty()
+ )
val struct =
UnitTestingClusterNullablesAndOptionalsStruct(
null,
@@ -276,7 +346,17 @@
@Test
fun testFabricScopedTlvTest1() {
val simpleStruct =
- UnitTestingClusterSimpleStruct(1U, true, 2U, byteArrayOf(0x00, 0x01), "test", 3U, 4.5f, 6.7)
+ UnitTestingClusterSimpleStruct(
+ 1U,
+ true,
+ 2U,
+ byteArrayOf(0x00, 0x01),
+ "test",
+ 3U,
+ 4.5f,
+ 6.7,
+ Optional.empty()
+ )
val struct =
UnitTestingClusterTestFabricScoped(
1U,
@@ -309,7 +389,17 @@
@Test
fun testFabricScopedTlvTest2() {
val simpleStruct =
- UnitTestingClusterSimpleStruct(1U, true, 2U, byteArrayOf(0x00, 0x01), "test", 3U, 4.5f, 6.7)
+ UnitTestingClusterSimpleStruct(
+ 1U,
+ true,
+ 2U,
+ byteArrayOf(0x00, 0x01),
+ "test",
+ 3U,
+ 4.5f,
+ 6.7,
+ Optional.empty()
+ )
val struct =
UnitTestingClusterTestFabricScoped(
1U,
@@ -342,7 +432,17 @@
@Test
fun testFabricScopedTlvTest3() {
val simpleStruct =
- UnitTestingClusterSimpleStruct(1U, true, 2U, byteArrayOf(0x00, 0x01), "test", 3U, 4.5f, 6.7)
+ UnitTestingClusterSimpleStruct(
+ 1U,
+ true,
+ 2U,
+ byteArrayOf(0x00, 0x01),
+ "test",
+ 3U,
+ 4.5f,
+ 6.7,
+ Optional.empty()
+ )
val struct =
UnitTestingClusterTestFabricScoped(
1U,
diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp
index 33c041e..81e24a4 100644
--- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp
+++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp
@@ -46578,6 +46578,25 @@
chip::JniReferences::GetInstance().CreateBoxedObject<jdouble>(
newElement_0_nullableStruct_hClassName.c_str(), newElement_0_nullableStruct_hCtorSignature.c_str(),
jninewElement_0_nullableStruct_h, newElement_0_nullableStruct_h);
+ jobject newElement_0_nullableStruct_i;
+ if (!entry_0.nullableStruct.Value().i.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_nullableStruct_i);
+ }
+ else
+ {
+ jobject newElement_0_nullableStruct_iInsideOptional;
+ std::string newElement_0_nullableStruct_iInsideOptionalClassName = "java/lang/Integer";
+ std::string newElement_0_nullableStruct_iInsideOptionalCtorSignature = "(I)V";
+ jint jninewElement_0_nullableStruct_iInsideOptional =
+ static_cast<jint>(entry_0.nullableStruct.Value().i.Value());
+ chip::JniReferences::GetInstance().CreateBoxedObject<jint>(
+ newElement_0_nullableStruct_iInsideOptionalClassName.c_str(),
+ newElement_0_nullableStruct_iInsideOptionalCtorSignature.c_str(),
+ jninewElement_0_nullableStruct_iInsideOptional, newElement_0_nullableStruct_iInsideOptional);
+ chip::JniReferences::GetInstance().CreateOptional(newElement_0_nullableStruct_iInsideOptional,
+ newElement_0_nullableStruct_i);
+ }
jclass simpleStructStructClass_3;
err = chip::JniReferences::GetInstance().GetLocalClassRef(
@@ -46592,7 +46611,7 @@
err = chip::JniReferences::GetInstance().FindMethod(
env, simpleStructStructClass_3, "<init>",
"(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/"
- "lang/Float;Ljava/lang/Double;)V",
+ "lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V",
&simpleStructStructCtor_3);
if (err != CHIP_NO_ERROR || simpleStructStructCtor_3 == nullptr)
{
@@ -46604,7 +46623,7 @@
env->NewObject(simpleStructStructClass_3, simpleStructStructCtor_3, newElement_0_nullableStruct_a,
newElement_0_nullableStruct_b, newElement_0_nullableStruct_c, newElement_0_nullableStruct_d,
newElement_0_nullableStruct_e, newElement_0_nullableStruct_f, newElement_0_nullableStruct_g,
- newElement_0_nullableStruct_h);
+ newElement_0_nullableStruct_h, newElement_0_nullableStruct_i);
}
jobject newElement_0_optionalStruct;
if (!entry_0.optionalStruct.HasValue())
@@ -46673,6 +46692,26 @@
newElement_0_optionalStructInsideOptional_hClassName.c_str(),
newElement_0_optionalStructInsideOptional_hCtorSignature.c_str(),
jninewElement_0_optionalStructInsideOptional_h, newElement_0_optionalStructInsideOptional_h);
+ jobject newElement_0_optionalStructInsideOptional_i;
+ if (!entry_0.optionalStruct.Value().i.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_optionalStructInsideOptional_i);
+ }
+ else
+ {
+ jobject newElement_0_optionalStructInsideOptional_iInsideOptional;
+ std::string newElement_0_optionalStructInsideOptional_iInsideOptionalClassName = "java/lang/Integer";
+ std::string newElement_0_optionalStructInsideOptional_iInsideOptionalCtorSignature = "(I)V";
+ jint jninewElement_0_optionalStructInsideOptional_iInsideOptional =
+ static_cast<jint>(entry_0.optionalStruct.Value().i.Value());
+ chip::JniReferences::GetInstance().CreateBoxedObject<jint>(
+ newElement_0_optionalStructInsideOptional_iInsideOptionalClassName.c_str(),
+ newElement_0_optionalStructInsideOptional_iInsideOptionalCtorSignature.c_str(),
+ jninewElement_0_optionalStructInsideOptional_iInsideOptional,
+ newElement_0_optionalStructInsideOptional_iInsideOptional);
+ chip::JniReferences::GetInstance().CreateOptional(newElement_0_optionalStructInsideOptional_iInsideOptional,
+ newElement_0_optionalStructInsideOptional_i);
+ }
jclass simpleStructStructClass_3;
err = chip::JniReferences::GetInstance().GetLocalClassRef(
@@ -46687,7 +46726,7 @@
err = chip::JniReferences::GetInstance().FindMethod(
env, simpleStructStructClass_3, "<init>",
"(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/"
- "lang/Float;Ljava/lang/Double;)V",
+ "lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V",
&simpleStructStructCtor_3);
if (err != CHIP_NO_ERROR || simpleStructStructCtor_3 == nullptr)
{
@@ -46695,12 +46734,12 @@
return nullptr;
}
- newElement_0_optionalStructInsideOptional =
- env->NewObject(simpleStructStructClass_3, simpleStructStructCtor_3,
- newElement_0_optionalStructInsideOptional_a, newElement_0_optionalStructInsideOptional_b,
- newElement_0_optionalStructInsideOptional_c, newElement_0_optionalStructInsideOptional_d,
- newElement_0_optionalStructInsideOptional_e, newElement_0_optionalStructInsideOptional_f,
- newElement_0_optionalStructInsideOptional_g, newElement_0_optionalStructInsideOptional_h);
+ newElement_0_optionalStructInsideOptional = env->NewObject(
+ simpleStructStructClass_3, simpleStructStructCtor_3, newElement_0_optionalStructInsideOptional_a,
+ newElement_0_optionalStructInsideOptional_b, newElement_0_optionalStructInsideOptional_c,
+ newElement_0_optionalStructInsideOptional_d, newElement_0_optionalStructInsideOptional_e,
+ newElement_0_optionalStructInsideOptional_f, newElement_0_optionalStructInsideOptional_g,
+ newElement_0_optionalStructInsideOptional_h, newElement_0_optionalStructInsideOptional_i);
chip::JniReferences::GetInstance().CreateOptional(newElement_0_optionalStructInsideOptional,
newElement_0_optionalStruct);
}
@@ -46790,6 +46829,29 @@
newElement_0_nullableOptionalStructInsideOptional_hCtorSignature.c_str(),
jninewElement_0_nullableOptionalStructInsideOptional_h,
newElement_0_nullableOptionalStructInsideOptional_h);
+ jobject newElement_0_nullableOptionalStructInsideOptional_i;
+ if (!entry_0.nullableOptionalStruct.Value().Value().i.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr,
+ newElement_0_nullableOptionalStructInsideOptional_i);
+ }
+ else
+ {
+ jobject newElement_0_nullableOptionalStructInsideOptional_iInsideOptional;
+ std::string newElement_0_nullableOptionalStructInsideOptional_iInsideOptionalClassName =
+ "java/lang/Integer";
+ std::string newElement_0_nullableOptionalStructInsideOptional_iInsideOptionalCtorSignature = "(I)V";
+ jint jninewElement_0_nullableOptionalStructInsideOptional_iInsideOptional =
+ static_cast<jint>(entry_0.nullableOptionalStruct.Value().Value().i.Value());
+ chip::JniReferences::GetInstance().CreateBoxedObject<jint>(
+ newElement_0_nullableOptionalStructInsideOptional_iInsideOptionalClassName.c_str(),
+ newElement_0_nullableOptionalStructInsideOptional_iInsideOptionalCtorSignature.c_str(),
+ jninewElement_0_nullableOptionalStructInsideOptional_iInsideOptional,
+ newElement_0_nullableOptionalStructInsideOptional_iInsideOptional);
+ chip::JniReferences::GetInstance().CreateOptional(
+ newElement_0_nullableOptionalStructInsideOptional_iInsideOptional,
+ newElement_0_nullableOptionalStructInsideOptional_i);
+ }
jclass simpleStructStructClass_4;
err = chip::JniReferences::GetInstance().GetLocalClassRef(
@@ -46804,7 +46866,7 @@
err = chip::JniReferences::GetInstance().FindMethod(
env, simpleStructStructClass_4, "<init>",
"(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/"
- "Integer;Ljava/lang/Float;Ljava/lang/Double;)V",
+ "Integer;Ljava/lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V",
&simpleStructStructCtor_4);
if (err != CHIP_NO_ERROR || simpleStructStructCtor_4 == nullptr)
{
@@ -46821,7 +46883,8 @@
newElement_0_nullableOptionalStructInsideOptional_e,
newElement_0_nullableOptionalStructInsideOptional_f,
newElement_0_nullableOptionalStructInsideOptional_g,
- newElement_0_nullableOptionalStructInsideOptional_h);
+ newElement_0_nullableOptionalStructInsideOptional_h,
+ newElement_0_nullableOptionalStructInsideOptional_i);
}
chip::JniReferences::GetInstance().CreateOptional(newElement_0_nullableOptionalStructInsideOptional,
newElement_0_nullableOptionalStruct);
@@ -47009,6 +47072,22 @@
jdouble jnivalue_h = static_cast<jdouble>(cppValue.h);
chip::JniReferences::GetInstance().CreateBoxedObject<jdouble>(value_hClassName.c_str(), value_hCtorSignature.c_str(),
jnivalue_h, value_h);
+ jobject value_i;
+ if (!cppValue.i.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr, value_i);
+ }
+ else
+ {
+ jobject value_iInsideOptional;
+ std::string value_iInsideOptionalClassName = "java/lang/Integer";
+ std::string value_iInsideOptionalCtorSignature = "(I)V";
+ jint jnivalue_iInsideOptional = static_cast<jint>(cppValue.i.Value());
+ chip::JniReferences::GetInstance().CreateBoxedObject<jint>(value_iInsideOptionalClassName.c_str(),
+ value_iInsideOptionalCtorSignature.c_str(),
+ jnivalue_iInsideOptional, value_iInsideOptional);
+ chip::JniReferences::GetInstance().CreateOptional(value_iInsideOptional, value_i);
+ }
jclass simpleStructStructClass_0;
err = chip::JniReferences::GetInstance().GetLocalClassRef(
@@ -47023,7 +47102,7 @@
err = chip::JniReferences::GetInstance().FindMethod(
env, simpleStructStructClass_0, "<init>",
"(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/"
- "Float;Ljava/lang/Double;)V",
+ "Float;Ljava/lang/Double;Ljava/util/Optional;)V",
&simpleStructStructCtor_0);
if (err != CHIP_NO_ERROR || simpleStructStructCtor_0 == nullptr)
{
@@ -47032,7 +47111,7 @@
}
value = env->NewObject(simpleStructStructClass_0, simpleStructStructCtor_0, value_a, value_b, value_c, value_d, value_e,
- value_f, value_g, value_h);
+ value_f, value_g, value_h, value_i);
return value;
}
case Attributes::RangeRestrictedInt8u::Id: {
@@ -47272,6 +47351,25 @@
newElement_0_fabricSensitiveStruct_hClassName.c_str(),
newElement_0_fabricSensitiveStruct_hCtorSignature.c_str(), jninewElement_0_fabricSensitiveStruct_h,
newElement_0_fabricSensitiveStruct_h);
+ jobject newElement_0_fabricSensitiveStruct_i;
+ if (!entry_0.fabricSensitiveStruct.i.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_fabricSensitiveStruct_i);
+ }
+ else
+ {
+ jobject newElement_0_fabricSensitiveStruct_iInsideOptional;
+ std::string newElement_0_fabricSensitiveStruct_iInsideOptionalClassName = "java/lang/Integer";
+ std::string newElement_0_fabricSensitiveStruct_iInsideOptionalCtorSignature = "(I)V";
+ jint jninewElement_0_fabricSensitiveStruct_iInsideOptional =
+ static_cast<jint>(entry_0.fabricSensitiveStruct.i.Value());
+ chip::JniReferences::GetInstance().CreateBoxedObject<jint>(
+ newElement_0_fabricSensitiveStruct_iInsideOptionalClassName.c_str(),
+ newElement_0_fabricSensitiveStruct_iInsideOptionalCtorSignature.c_str(),
+ jninewElement_0_fabricSensitiveStruct_iInsideOptional, newElement_0_fabricSensitiveStruct_iInsideOptional);
+ chip::JniReferences::GetInstance().CreateOptional(newElement_0_fabricSensitiveStruct_iInsideOptional,
+ newElement_0_fabricSensitiveStruct_i);
+ }
jclass simpleStructStructClass_2;
err = chip::JniReferences::GetInstance().GetLocalClassRef(
@@ -47286,7 +47384,7 @@
err = chip::JniReferences::GetInstance().FindMethod(
env, simpleStructStructClass_2, "<init>",
"(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/"
- "Float;Ljava/lang/Double;)V",
+ "Float;Ljava/lang/Double;Ljava/util/Optional;)V",
&simpleStructStructCtor_2);
if (err != CHIP_NO_ERROR || simpleStructStructCtor_2 == nullptr)
{
@@ -47299,7 +47397,7 @@
newElement_0_fabricSensitiveStruct_b, newElement_0_fabricSensitiveStruct_c,
newElement_0_fabricSensitiveStruct_d, newElement_0_fabricSensitiveStruct_e,
newElement_0_fabricSensitiveStruct_f, newElement_0_fabricSensitiveStruct_g,
- newElement_0_fabricSensitiveStruct_h);
+ newElement_0_fabricSensitiveStruct_h, newElement_0_fabricSensitiveStruct_i);
jobject newElement_0_fabricSensitiveInt8uList;
chip::JniReferences::GetInstance().CreateArrayList(newElement_0_fabricSensitiveInt8uList);
@@ -47401,6 +47499,93 @@
jnivalue, value);
return value;
}
+ case Attributes::GlobalEnum::Id: {
+ using TypeInfo = Attributes::GlobalEnum::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ std::string valueClassName = "java/lang/Integer";
+ std::string valueCtorSignature = "(I)V";
+ jint jnivalue = static_cast<jint>(cppValue);
+ chip::JniReferences::GetInstance().CreateBoxedObject<jint>(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue,
+ value);
+ return value;
+ }
+ case Attributes::GlobalStruct::Id: {
+ using TypeInfo = Attributes::GlobalStruct::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ jobject value_name;
+ LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.name, value_name));
+ jobject value_myBitmap;
+ if (cppValue.myBitmap.IsNull())
+ {
+ value_myBitmap = nullptr;
+ }
+ else
+ {
+ std::string value_myBitmapClassName = "java/lang/Long";
+ std::string value_myBitmapCtorSignature = "(J)V";
+ jlong jnivalue_myBitmap = static_cast<jlong>(cppValue.myBitmap.Value().Raw());
+ chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(
+ value_myBitmapClassName.c_str(), value_myBitmapCtorSignature.c_str(), jnivalue_myBitmap, value_myBitmap);
+ }
+ jobject value_myEnum;
+ if (!cppValue.myEnum.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr, value_myEnum);
+ }
+ else
+ {
+ jobject value_myEnumInsideOptional;
+ if (cppValue.myEnum.Value().IsNull())
+ {
+ value_myEnumInsideOptional = nullptr;
+ }
+ else
+ {
+ std::string value_myEnumInsideOptionalClassName = "java/lang/Integer";
+ std::string value_myEnumInsideOptionalCtorSignature = "(I)V";
+ jint jnivalue_myEnumInsideOptional = static_cast<jint>(cppValue.myEnum.Value().Value());
+ chip::JniReferences::GetInstance().CreateBoxedObject<jint>(
+ value_myEnumInsideOptionalClassName.c_str(), value_myEnumInsideOptionalCtorSignature.c_str(),
+ jnivalue_myEnumInsideOptional, value_myEnumInsideOptional);
+ }
+ chip::JniReferences::GetInstance().CreateOptional(value_myEnumInsideOptional, value_myEnum);
+ }
+
+ jclass testGlobalStructStructClass_0;
+ err = chip::JniReferences::GetInstance().GetLocalClassRef(
+ env, "chip/devicecontroller/ChipStructs$UnitTestingClusterTestGlobalStruct", testGlobalStructStructClass_0);
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterTestGlobalStruct");
+ return nullptr;
+ }
+
+ jmethodID testGlobalStructStructCtor_0;
+ err = chip::JniReferences::GetInstance().FindMethod(env, testGlobalStructStructClass_0, "<init>",
+ "(Ljava/lang/String;Ljava/lang/Long;Ljava/util/Optional;)V",
+ &testGlobalStructStructCtor_0);
+ if (err != CHIP_NO_ERROR || testGlobalStructStructCtor_0 == nullptr)
+ {
+ ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterTestGlobalStruct constructor");
+ return nullptr;
+ }
+
+ value = env->NewObject(testGlobalStructStructClass_0, testGlobalStructStructCtor_0, value_name, value_myBitmap,
+ value_myEnum);
+ return value;
+ }
case Attributes::Unsupported::Id: {
using TypeInfo = Attributes::Unsupported::TypeInfo;
TypeInfo::DecodableType cppValue;
@@ -48114,6 +48299,22 @@
jdouble jnivalue_h = static_cast<jdouble>(cppValue.Value().h);
chip::JniReferences::GetInstance().CreateBoxedObject<jdouble>(value_hClassName.c_str(),
value_hCtorSignature.c_str(), jnivalue_h, value_h);
+ jobject value_i;
+ if (!cppValue.Value().i.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr, value_i);
+ }
+ else
+ {
+ jobject value_iInsideOptional;
+ std::string value_iInsideOptionalClassName = "java/lang/Integer";
+ std::string value_iInsideOptionalCtorSignature = "(I)V";
+ jint jnivalue_iInsideOptional = static_cast<jint>(cppValue.Value().i.Value());
+ chip::JniReferences::GetInstance().CreateBoxedObject<jint>(value_iInsideOptionalClassName.c_str(),
+ value_iInsideOptionalCtorSignature.c_str(),
+ jnivalue_iInsideOptional, value_iInsideOptional);
+ chip::JniReferences::GetInstance().CreateOptional(value_iInsideOptional, value_i);
+ }
jclass simpleStructStructClass_1;
err = chip::JniReferences::GetInstance().GetLocalClassRef(
@@ -48128,7 +48329,7 @@
err = chip::JniReferences::GetInstance().FindMethod(
env, simpleStructStructClass_1, "<init>",
"(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/"
- "Float;Ljava/lang/Double;)V",
+ "Float;Ljava/lang/Double;Ljava/util/Optional;)V",
&simpleStructStructCtor_1);
if (err != CHIP_NO_ERROR || simpleStructStructCtor_1 == nullptr)
{
@@ -48137,7 +48338,7 @@
}
value = env->NewObject(simpleStructStructClass_1, simpleStructStructCtor_1, value_a, value_b, value_c, value_d,
- value_e, value_f, value_g, value_h);
+ value_e, value_f, value_g, value_h, value_i);
}
return value;
}
@@ -48249,6 +48450,107 @@
value);
return value;
}
+ case Attributes::NullableGlobalEnum::Id: {
+ using TypeInfo = Attributes::NullableGlobalEnum::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ if (cppValue.IsNull())
+ {
+ value = nullptr;
+ }
+ else
+ {
+ std::string valueClassName = "java/lang/Integer";
+ std::string valueCtorSignature = "(I)V";
+ jint jnivalue = static_cast<jint>(cppValue.Value());
+ chip::JniReferences::GetInstance().CreateBoxedObject<jint>(valueClassName.c_str(), valueCtorSignature.c_str(),
+ jnivalue, value);
+ }
+ return value;
+ }
+ case Attributes::NullableGlobalStruct::Id: {
+ using TypeInfo = Attributes::NullableGlobalStruct::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ if (cppValue.IsNull())
+ {
+ value = nullptr;
+ }
+ else
+ {
+ jobject value_name;
+ LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value().name, value_name));
+ jobject value_myBitmap;
+ if (cppValue.Value().myBitmap.IsNull())
+ {
+ value_myBitmap = nullptr;
+ }
+ else
+ {
+ std::string value_myBitmapClassName = "java/lang/Long";
+ std::string value_myBitmapCtorSignature = "(J)V";
+ jlong jnivalue_myBitmap = static_cast<jlong>(cppValue.Value().myBitmap.Value().Raw());
+ chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(
+ value_myBitmapClassName.c_str(), value_myBitmapCtorSignature.c_str(), jnivalue_myBitmap, value_myBitmap);
+ }
+ jobject value_myEnum;
+ if (!cppValue.Value().myEnum.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr, value_myEnum);
+ }
+ else
+ {
+ jobject value_myEnumInsideOptional;
+ if (cppValue.Value().myEnum.Value().IsNull())
+ {
+ value_myEnumInsideOptional = nullptr;
+ }
+ else
+ {
+ std::string value_myEnumInsideOptionalClassName = "java/lang/Integer";
+ std::string value_myEnumInsideOptionalCtorSignature = "(I)V";
+ jint jnivalue_myEnumInsideOptional = static_cast<jint>(cppValue.Value().myEnum.Value().Value());
+ chip::JniReferences::GetInstance().CreateBoxedObject<jint>(
+ value_myEnumInsideOptionalClassName.c_str(), value_myEnumInsideOptionalCtorSignature.c_str(),
+ jnivalue_myEnumInsideOptional, value_myEnumInsideOptional);
+ }
+ chip::JniReferences::GetInstance().CreateOptional(value_myEnumInsideOptional, value_myEnum);
+ }
+
+ jclass testGlobalStructStructClass_1;
+ err = chip::JniReferences::GetInstance().GetLocalClassRef(
+ env, "chip/devicecontroller/ChipStructs$UnitTestingClusterTestGlobalStruct", testGlobalStructStructClass_1);
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterTestGlobalStruct");
+ return nullptr;
+ }
+
+ jmethodID testGlobalStructStructCtor_1;
+ err = chip::JniReferences::GetInstance().FindMethod(env, testGlobalStructStructClass_1, "<init>",
+ "(Ljava/lang/String;Ljava/lang/Long;Ljava/util/Optional;)V",
+ &testGlobalStructStructCtor_1);
+ if (err != CHIP_NO_ERROR || testGlobalStructStructCtor_1 == nullptr)
+ {
+ ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterTestGlobalStruct constructor");
+ return nullptr;
+ }
+
+ value = env->NewObject(testGlobalStructStructClass_1, testGlobalStructStructCtor_1, value_name, value_myBitmap,
+ value_myEnum);
+ }
+ return value;
+ }
case Attributes::GeneratedCommandList::Id: {
using TypeInfo = Attributes::GeneratedCommandList::TypeInfo;
TypeInfo::DecodableType cppValue;
diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp
index 7f3c03f..89a4a25 100644
--- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp
+++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp
@@ -8260,6 +8260,22 @@
jdouble jnivalue_arg4_h = static_cast<jdouble>(cppValue.arg4.h);
chip::JniReferences::GetInstance().CreateBoxedObject<jdouble>(
value_arg4_hClassName.c_str(), value_arg4_hCtorSignature.c_str(), jnivalue_arg4_h, value_arg4_h);
+ jobject value_arg4_i;
+ if (!cppValue.arg4.i.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr, value_arg4_i);
+ }
+ else
+ {
+ jobject value_arg4_iInsideOptional;
+ std::string value_arg4_iInsideOptionalClassName = "java/lang/Integer";
+ std::string value_arg4_iInsideOptionalCtorSignature = "(I)V";
+ jint jnivalue_arg4_iInsideOptional = static_cast<jint>(cppValue.arg4.i.Value());
+ chip::JniReferences::GetInstance().CreateBoxedObject<jint>(
+ value_arg4_iInsideOptionalClassName.c_str(), value_arg4_iInsideOptionalCtorSignature.c_str(),
+ jnivalue_arg4_iInsideOptional, value_arg4_iInsideOptional);
+ chip::JniReferences::GetInstance().CreateOptional(value_arg4_iInsideOptional, value_arg4_i);
+ }
jclass simpleStructStructClass_0;
err = chip::JniReferences::GetInstance().GetLocalClassRef(
@@ -8274,7 +8290,7 @@
err = chip::JniReferences::GetInstance().FindMethod(
env, simpleStructStructClass_0, "<init>",
"(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/"
- "Float;Ljava/lang/Double;)V",
+ "Float;Ljava/lang/Double;Ljava/util/Optional;)V",
&simpleStructStructCtor_0);
if (err != CHIP_NO_ERROR || simpleStructStructCtor_0 == nullptr)
{
@@ -8282,8 +8298,9 @@
return nullptr;
}
- value_arg4 = env->NewObject(simpleStructStructClass_0, simpleStructStructCtor_0, value_arg4_a, value_arg4_b,
- value_arg4_c, value_arg4_d, value_arg4_e, value_arg4_f, value_arg4_g, value_arg4_h);
+ value_arg4 =
+ env->NewObject(simpleStructStructClass_0, simpleStructStructCtor_0, value_arg4_a, value_arg4_b, value_arg4_c,
+ value_arg4_d, value_arg4_e, value_arg4_f, value_arg4_g, value_arg4_h, value_arg4_i);
jobject value_arg5;
chip::JniReferences::GetInstance().CreateArrayList(value_arg5);
@@ -8336,6 +8353,22 @@
jdouble jninewElement_0_h = static_cast<jdouble>(entry_0.h);
chip::JniReferences::GetInstance().CreateBoxedObject<jdouble>(
newElement_0_hClassName.c_str(), newElement_0_hCtorSignature.c_str(), jninewElement_0_h, newElement_0_h);
+ jobject newElement_0_i;
+ if (!entry_0.i.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_i);
+ }
+ else
+ {
+ jobject newElement_0_iInsideOptional;
+ std::string newElement_0_iInsideOptionalClassName = "java/lang/Integer";
+ std::string newElement_0_iInsideOptionalCtorSignature = "(I)V";
+ jint jninewElement_0_iInsideOptional = static_cast<jint>(entry_0.i.Value());
+ chip::JniReferences::GetInstance().CreateBoxedObject<jint>(
+ newElement_0_iInsideOptionalClassName.c_str(), newElement_0_iInsideOptionalCtorSignature.c_str(),
+ jninewElement_0_iInsideOptional, newElement_0_iInsideOptional);
+ chip::JniReferences::GetInstance().CreateOptional(newElement_0_iInsideOptional, newElement_0_i);
+ }
jclass simpleStructStructClass_1;
err = chip::JniReferences::GetInstance().GetLocalClassRef(
@@ -8350,7 +8383,7 @@
err = chip::JniReferences::GetInstance().FindMethod(
env, simpleStructStructClass_1, "<init>",
"(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/"
- "Float;Ljava/lang/Double;)V",
+ "Float;Ljava/lang/Double;Ljava/util/Optional;)V",
&simpleStructStructCtor_1);
if (err != CHIP_NO_ERROR || simpleStructStructCtor_1 == nullptr)
{
@@ -8358,9 +8391,9 @@
return nullptr;
}
- newElement_0 =
- env->NewObject(simpleStructStructClass_1, simpleStructStructCtor_1, newElement_0_a, newElement_0_b,
- newElement_0_c, newElement_0_d, newElement_0_e, newElement_0_f, newElement_0_g, newElement_0_h);
+ newElement_0 = env->NewObject(simpleStructStructClass_1, simpleStructStructCtor_1, newElement_0_a, newElement_0_b,
+ newElement_0_c, newElement_0_d, newElement_0_e, newElement_0_f, newElement_0_g,
+ newElement_0_h, newElement_0_i);
chip::JniReferences::GetInstance().AddToList(value_arg5, newElement_0);
}
diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py
index 588c3da..cc0b5aa 100644
--- a/src/controller/python/chip/clusters/CHIPClusters.py
+++ b/src/controller/python/chip/clusters/CHIPClusters.py
@@ -14491,6 +14491,14 @@
"payload": "bytes",
},
},
+ 0x00000019: {
+ "commandId": 0x00000019,
+ "commandName": "GlobalEchoRequest",
+ "args": {
+ "field1": "TestGlobalStruct",
+ "field2": "int",
+ },
+ },
0xFFF200AA: {
"commandId": 0xFFF200AA,
"commandName": "TestDifferentVendorMeiRequest",
@@ -14829,6 +14837,20 @@
"reportable": True,
"writable": True,
},
+ 0x00000033: {
+ "attributeName": "GlobalEnum",
+ "attributeId": 0x00000033,
+ "type": "int",
+ "reportable": True,
+ "writable": True,
+ },
+ 0x00000034: {
+ "attributeName": "GlobalStruct",
+ "attributeId": 0x00000034,
+ "type": "",
+ "reportable": True,
+ "writable": True,
+ },
0x000000FF: {
"attributeName": "Unsupported",
"attributeId": 0x000000FF,
@@ -15074,6 +15096,20 @@
"reportable": True,
"writable": True,
},
+ 0x00004033: {
+ "attributeName": "NullableGlobalEnum",
+ "attributeId": 0x00004033,
+ "type": "int",
+ "reportable": True,
+ "writable": True,
+ },
+ 0x00004034: {
+ "attributeName": "NullableGlobalStruct",
+ "attributeId": 0x00004034,
+ "type": "",
+ "reportable": True,
+ "writable": True,
+ },
0x0000FFF8: {
"attributeName": "GeneratedCommandList",
"attributeId": 0x0000FFF8,
diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py
index b84ad31..3795b08 100644
--- a/src/controller/python/chip/clusters/Objects.py
+++ b/src/controller/python/chip/clusters/Objects.py
@@ -50101,6 +50101,8 @@
ClusterObjectFieldDescriptor(Label="timedWriteBoolean", Tag=0x00000030, Type=bool),
ClusterObjectFieldDescriptor(Label="generalErrorBoolean", Tag=0x00000031, Type=bool),
ClusterObjectFieldDescriptor(Label="clusterErrorBoolean", Tag=0x00000032, Type=bool),
+ ClusterObjectFieldDescriptor(Label="globalEnum", Tag=0x00000033, Type=Globals.Enums.TestGlobalEnum),
+ ClusterObjectFieldDescriptor(Label="globalStruct", Tag=0x00000034, Type=Globals.Structs.TestGlobalStruct),
ClusterObjectFieldDescriptor(Label="unsupported", Tag=0x000000FF, Type=typing.Optional[bool]),
ClusterObjectFieldDescriptor(Label="nullableBoolean", Tag=0x00004000, Type=typing.Union[Nullable, bool]),
ClusterObjectFieldDescriptor(Label="nullableBitmap8", Tag=0x00004001, Type=typing.Union[Nullable, uint]),
@@ -50136,6 +50138,8 @@
ClusterObjectFieldDescriptor(Label="nullableRangeRestrictedInt16u", Tag=0x00004028, Type=typing.Union[Nullable, uint]),
ClusterObjectFieldDescriptor(Label="nullableRangeRestrictedInt16s", Tag=0x00004029, Type=typing.Union[Nullable, int]),
ClusterObjectFieldDescriptor(Label="writeOnlyInt8u", Tag=0x0000402A, Type=typing.Optional[uint]),
+ ClusterObjectFieldDescriptor(Label="nullableGlobalEnum", Tag=0x00004033, Type=typing.Union[Nullable, Globals.Enums.TestGlobalEnum]),
+ ClusterObjectFieldDescriptor(Label="nullableGlobalStruct", Tag=0x00004034, Type=typing.Union[Nullable, Globals.Structs.TestGlobalStruct]),
ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]),
ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]),
ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]),
@@ -50192,6 +50196,8 @@
timedWriteBoolean: 'bool' = None
generalErrorBoolean: 'bool' = None
clusterErrorBoolean: 'bool' = None
+ globalEnum: 'Globals.Enums.TestGlobalEnum' = None
+ globalStruct: 'Globals.Structs.TestGlobalStruct' = None
unsupported: 'typing.Optional[bool]' = None
nullableBoolean: 'typing.Union[Nullable, bool]' = None
nullableBitmap8: 'typing.Union[Nullable, uint]' = None
@@ -50227,6 +50233,8 @@
nullableRangeRestrictedInt16u: 'typing.Union[Nullable, uint]' = None
nullableRangeRestrictedInt16s: 'typing.Union[Nullable, int]' = None
writeOnlyInt8u: 'typing.Optional[uint]' = None
+ nullableGlobalEnum: 'typing.Union[Nullable, Globals.Enums.TestGlobalEnum]' = None
+ nullableGlobalStruct: 'typing.Union[Nullable, Globals.Structs.TestGlobalStruct]' = None
generatedCommandList: 'typing.List[uint]' = None
acceptedCommandList: 'typing.List[uint]' = None
eventList: 'typing.List[uint]' = None
@@ -50292,6 +50300,7 @@
ClusterObjectFieldDescriptor(Label="f", Tag=5, Type=uint),
ClusterObjectFieldDescriptor(Label="g", Tag=6, Type=float32),
ClusterObjectFieldDescriptor(Label="h", Tag=7, Type=float),
+ ClusterObjectFieldDescriptor(Label="i", Tag=8, Type=typing.Optional[Globals.Enums.TestGlobalEnum]),
])
a: 'uint' = 0
@@ -50302,6 +50311,7 @@
f: 'uint' = 0
g: 'float32' = 0.0
h: 'float' = 0.0
+ i: 'typing.Optional[Globals.Enums.TestGlobalEnum]' = None
@dataclass
class TestFabricScoped(ClusterObject):
@@ -50370,11 +50380,13 @@
ClusterObjectFieldDescriptor(Label="a", Tag=0, Type=uint),
ClusterObjectFieldDescriptor(Label="b", Tag=1, Type=bool),
ClusterObjectFieldDescriptor(Label="c", Tag=2, Type=UnitTesting.Structs.SimpleStruct),
+ ClusterObjectFieldDescriptor(Label="d", Tag=3, Type=typing.Optional[Globals.Structs.TestGlobalStruct]),
])
a: 'uint' = 0
b: 'bool' = False
c: 'UnitTesting.Structs.SimpleStruct' = field(default_factory=lambda: UnitTesting.Structs.SimpleStruct())
+ d: 'typing.Optional[Globals.Structs.TestGlobalStruct]' = None
@dataclass
class NestedStructList(ClusterObject):
@@ -50963,6 +50975,24 @@
arg2: 'UnitTesting.Enums.SimpleEnum' = 0
@dataclass
+ class GlobalEchoResponse(ClusterCommand):
+ cluster_id: typing.ClassVar[int] = 0xFFF1FC05
+ command_id: typing.ClassVar[int] = 0x0000000E
+ is_client: typing.ClassVar[bool] = False
+ response_type: typing.ClassVar[str] = None
+
+ @ChipUtility.classproperty
+ def descriptor(cls) -> ClusterObjectDescriptor:
+ return ClusterObjectDescriptor(
+ Fields=[
+ ClusterObjectFieldDescriptor(Label="field1", Tag=0, Type=Globals.Structs.TestGlobalStruct),
+ ClusterObjectFieldDescriptor(Label="field2", Tag=1, Type=Globals.Enums.TestGlobalEnum),
+ ])
+
+ field1: 'Globals.Structs.TestGlobalStruct' = field(default_factory=lambda: UnitTesting.Structs.TestGlobalStruct())
+ field2: 'Globals.Enums.TestGlobalEnum' = 0
+
+ @dataclass
class TestNullableOptionalRequest(ClusterCommand):
cluster_id: typing.ClassVar[int] = 0xFFF1FC05
command_id: typing.ClassVar[int] = 0x0000000F
@@ -51158,6 +51188,24 @@
payload: 'bytes' = b""
@dataclass
+ class GlobalEchoRequest(ClusterCommand):
+ cluster_id: typing.ClassVar[int] = 0xFFF1FC05
+ command_id: typing.ClassVar[int] = 0x00000019
+ is_client: typing.ClassVar[bool] = True
+ response_type: typing.ClassVar[str] = 'GlobalEchoResponse'
+
+ @ChipUtility.classproperty
+ def descriptor(cls) -> ClusterObjectDescriptor:
+ return ClusterObjectDescriptor(
+ Fields=[
+ ClusterObjectFieldDescriptor(Label="field1", Tag=0, Type=Globals.Structs.TestGlobalStruct),
+ ClusterObjectFieldDescriptor(Label="field2", Tag=1, Type=Globals.Enums.TestGlobalEnum),
+ ])
+
+ field1: 'Globals.Structs.TestGlobalStruct' = field(default_factory=lambda: UnitTesting.Structs.TestGlobalStruct())
+ field2: 'Globals.Enums.TestGlobalEnum' = 0
+
+ @dataclass
class TestDifferentVendorMeiRequest(ClusterCommand):
cluster_id: typing.ClassVar[int] = 0xFFF1FC05
command_id: typing.ClassVar[int] = 0xFFF200AA
@@ -51949,6 +51997,38 @@
value: 'bool' = False
@dataclass
+ class GlobalEnum(ClusterAttributeDescriptor):
+ @ChipUtility.classproperty
+ def cluster_id(cls) -> int:
+ return 0xFFF1FC05
+
+ @ChipUtility.classproperty
+ def attribute_id(cls) -> int:
+ return 0x00000033
+
+ @ChipUtility.classproperty
+ def attribute_type(cls) -> ClusterObjectFieldDescriptor:
+ return ClusterObjectFieldDescriptor(Type=Globals.Enums.TestGlobalEnum)
+
+ value: 'Globals.Enums.TestGlobalEnum' = 0
+
+ @dataclass
+ class GlobalStruct(ClusterAttributeDescriptor):
+ @ChipUtility.classproperty
+ def cluster_id(cls) -> int:
+ return 0xFFF1FC05
+
+ @ChipUtility.classproperty
+ def attribute_id(cls) -> int:
+ return 0x00000034
+
+ @ChipUtility.classproperty
+ def attribute_type(cls) -> ClusterObjectFieldDescriptor:
+ return ClusterObjectFieldDescriptor(Type=Globals.Structs.TestGlobalStruct)
+
+ value: 'Globals.Structs.TestGlobalStruct' = field(default_factory=lambda: UnitTesting.Structs.TestGlobalStruct())
+
+ @dataclass
class Unsupported(ClusterAttributeDescriptor):
@ChipUtility.classproperty
def cluster_id(cls) -> int:
@@ -52509,6 +52589,38 @@
value: 'typing.Optional[uint]' = None
@dataclass
+ class NullableGlobalEnum(ClusterAttributeDescriptor):
+ @ChipUtility.classproperty
+ def cluster_id(cls) -> int:
+ return 0xFFF1FC05
+
+ @ChipUtility.classproperty
+ def attribute_id(cls) -> int:
+ return 0x00004033
+
+ @ChipUtility.classproperty
+ def attribute_type(cls) -> ClusterObjectFieldDescriptor:
+ return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, Globals.Enums.TestGlobalEnum])
+
+ value: 'typing.Union[Nullable, Globals.Enums.TestGlobalEnum]' = NullValue
+
+ @dataclass
+ class NullableGlobalStruct(ClusterAttributeDescriptor):
+ @ChipUtility.classproperty
+ def cluster_id(cls) -> int:
+ return 0xFFF1FC05
+
+ @ChipUtility.classproperty
+ def attribute_id(cls) -> int:
+ return 0x00004034
+
+ @ChipUtility.classproperty
+ def attribute_type(cls) -> ClusterObjectFieldDescriptor:
+ return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, Globals.Structs.TestGlobalStruct])
+
+ value: 'typing.Union[Nullable, Globals.Structs.TestGlobalStruct]' = NullValue
+
+ @dataclass
class GeneratedCommandList(ClusterAttributeDescriptor):
@ChipUtility.classproperty
def cluster_id(cls) -> int:
diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml
index aed4d52..ee6351b 100644
--- a/src/darwin/Framework/CHIP/templates/availability.yaml
+++ b/src/darwin/Framework/CHIP/templates/availability.yaml
@@ -9695,29 +9695,38 @@
- WaterHeaterMode
- WiFiNetworkManagement
attributes:
- OccupancySensing:
- # Targeting 1.4
- - HoldTime
- - HoldTimeLimits
GeneralCommissioning:
# Targeting 1.4
- TCAcceptedVersion
- TCMinRequiredVersion
- TCAcknowledgements
- TCAcknowledgementsRequired
+ OccupancySensing:
+ # Targeting 1.4
+ - HoldTime
+ - HoldTimeLimits
+ UnitTesting:
+ # Ideally none of UnitTesting would be exposed as public API, but
+ # for now just start doing that for new additions to it.
+ - GlobalEnum
+ - GlobalStruct
+ - NullableGlobalEnum
+ - NullableGlobalStruct
commands:
BridgedDeviceBasicInformation:
# Targeting 1.4
- KeepActive
- UnitTesting:
- # Ideally none of UnitTesting would be exposed as public API, but
- # for now just start doing that for new additions to it.
- - StringEchoRequest
- - StringEchoResponse
GeneralCommissioning:
# Targeting 1.4
- SetTCAcknowledgements
- SetTCAcknowledgementsResponse
+ UnitTesting:
+ # Ideally none of UnitTesting would be exposed as public API, but
+ # for now just start doing that for new additions to it.
+ - GlobalEchoRequest
+ - GlobalEchoResponse
+ - StringEchoRequest
+ - StringEchoResponse
structs:
Globals:
# Test-only value
@@ -9725,6 +9734,14 @@
OccupancySensing:
# Targeting 1.4
- HoldTimeLimitsStruct
+ struct fields:
+ UnitTesting:
+ # Ideally none of UnitTesting would be exposed as public API, but
+ # for now just start doing that for new additions to it.
+ SimpleStruct:
+ - i
+ NestedStruct:
+ - d
events:
BridgedDeviceBasicInformation:
# Targeting 1.4
@@ -9744,10 +9761,10 @@
BridgedDeviceBasicInformation:
# Targeting 1.4
- Feature
- OccupancySensing:
+ GeneralCommissioning:
# Targeting 1.4
- Feature
- GeneralCommissioning:
+ OccupancySensing:
# Targeting 1.4
- Feature
bitmap values:
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm
index d214e06..d0ea9a3 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm
@@ -6678,6 +6678,12 @@
case Attributes::ClusterErrorBoolean::Id: {
return YES;
}
+ case Attributes::GlobalEnum::Id: {
+ return YES;
+ }
+ case Attributes::GlobalStruct::Id: {
+ return YES;
+ }
case Attributes::Unsupported::Id: {
return YES;
}
@@ -6783,6 +6789,12 @@
case Attributes::WriteOnlyInt8u::Id: {
return YES;
}
+ case Attributes::NullableGlobalEnum::Id: {
+ return YES;
+ }
+ case Attributes::NullableGlobalStruct::Id: {
+ return YES;
+ }
case Attributes::GeneratedCommandList::Id: {
return YES;
}
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm
index 7920a04..c6d7431 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm
@@ -19333,6 +19333,11 @@
newElement_0.nullableStruct.f = [NSNumber numberWithUnsignedChar:entry_0.nullableStruct.Value().f.Raw()];
newElement_0.nullableStruct.g = [NSNumber numberWithFloat:entry_0.nullableStruct.Value().g];
newElement_0.nullableStruct.h = [NSNumber numberWithDouble:entry_0.nullableStruct.Value().h];
+ if (entry_0.nullableStruct.Value().i.HasValue()) {
+ newElement_0.nullableStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.nullableStruct.Value().i.Value())];
+ } else {
+ newElement_0.nullableStruct.i = nil;
+ }
}
if (entry_0.optionalStruct.HasValue()) {
newElement_0.optionalStruct = [MTRUnitTestingClusterSimpleStruct new];
@@ -19349,6 +19354,11 @@
newElement_0.optionalStruct.f = [NSNumber numberWithUnsignedChar:entry_0.optionalStruct.Value().f.Raw()];
newElement_0.optionalStruct.g = [NSNumber numberWithFloat:entry_0.optionalStruct.Value().g];
newElement_0.optionalStruct.h = [NSNumber numberWithDouble:entry_0.optionalStruct.Value().h];
+ if (entry_0.optionalStruct.Value().i.HasValue()) {
+ newElement_0.optionalStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.optionalStruct.Value().i.Value())];
+ } else {
+ newElement_0.optionalStruct.i = nil;
+ }
} else {
newElement_0.optionalStruct = nil;
}
@@ -19370,6 +19380,11 @@
newElement_0.nullableOptionalStruct.f = [NSNumber numberWithUnsignedChar:entry_0.nullableOptionalStruct.Value().Value().f.Raw()];
newElement_0.nullableOptionalStruct.g = [NSNumber numberWithFloat:entry_0.nullableOptionalStruct.Value().Value().g];
newElement_0.nullableOptionalStruct.h = [NSNumber numberWithDouble:entry_0.nullableOptionalStruct.Value().Value().h];
+ if (entry_0.nullableOptionalStruct.Value().Value().i.HasValue()) {
+ newElement_0.nullableOptionalStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.nullableOptionalStruct.Value().Value().i.Value())];
+ } else {
+ newElement_0.nullableOptionalStruct.i = nil;
+ }
}
} else {
newElement_0.nullableOptionalStruct = nil;
@@ -19482,6 +19497,11 @@
value.f = [NSNumber numberWithUnsignedChar:cppValue.f.Raw()];
value.g = [NSNumber numberWithFloat:cppValue.g];
value.h = [NSNumber numberWithDouble:cppValue.h];
+ if (cppValue.i.HasValue()) {
+ value.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.i.Value())];
+ } else {
+ value.i = nil;
+ }
return value;
}
case Attributes::RangeRestrictedInt8u::Id: {
@@ -19609,6 +19629,11 @@
newElement_0.fabricSensitiveStruct.f = [NSNumber numberWithUnsignedChar:entry_0.fabricSensitiveStruct.f.Raw()];
newElement_0.fabricSensitiveStruct.g = [NSNumber numberWithFloat:entry_0.fabricSensitiveStruct.g];
newElement_0.fabricSensitiveStruct.h = [NSNumber numberWithDouble:entry_0.fabricSensitiveStruct.h];
+ if (entry_0.fabricSensitiveStruct.i.HasValue()) {
+ newElement_0.fabricSensitiveStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.fabricSensitiveStruct.i.Value())];
+ } else {
+ newElement_0.fabricSensitiveStruct.i = nil;
+ }
{ // Scope for our temporary variables
auto * array_2 = [NSMutableArray new];
auto iter_2 = entry_0.fabricSensitiveInt8uList.begin();
@@ -19670,6 +19695,48 @@
value = [NSNumber numberWithBool:cppValue];
return value;
}
+ case Attributes::GlobalEnum::Id: {
+ using TypeInfo = Attributes::GlobalEnum::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR) {
+ return nil;
+ }
+ NSNumber * _Nonnull value;
+ value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)];
+ return value;
+ }
+ case Attributes::GlobalStruct::Id: {
+ using TypeInfo = Attributes::GlobalStruct::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR) {
+ return nil;
+ }
+ MTRDataTypeTestGlobalStruct * _Nonnull value;
+ value = [MTRDataTypeTestGlobalStruct new];
+ value.name = AsString(cppValue.name);
+ if (value.name == nil) {
+ CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT;
+ *aError = err;
+ return nil;
+ }
+ if (cppValue.myBitmap.IsNull()) {
+ value.myBitmap = nil;
+ } else {
+ value.myBitmap = [NSNumber numberWithUnsignedInt:cppValue.myBitmap.Value().Raw()];
+ }
+ if (cppValue.myEnum.HasValue()) {
+ if (cppValue.myEnum.Value().IsNull()) {
+ value.myEnum = nil;
+ } else {
+ value.myEnum = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.myEnum.Value().Value())];
+ }
+ } else {
+ value.myEnum = nil;
+ }
+ return value;
+ }
case Attributes::Unsupported::Id: {
using TypeInfo = Attributes::Unsupported::TypeInfo;
TypeInfo::DecodableType cppValue;
@@ -20131,6 +20198,11 @@
value.f = [NSNumber numberWithUnsignedChar:cppValue.Value().f.Raw()];
value.g = [NSNumber numberWithFloat:cppValue.Value().g];
value.h = [NSNumber numberWithDouble:cppValue.Value().h];
+ if (cppValue.Value().i.HasValue()) {
+ value.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value().i.Value())];
+ } else {
+ value.i = nil;
+ }
}
return value;
}
@@ -20205,6 +20277,56 @@
value = [NSNumber numberWithUnsignedChar:cppValue];
return value;
}
+ case Attributes::NullableGlobalEnum::Id: {
+ using TypeInfo = Attributes::NullableGlobalEnum::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR) {
+ return nil;
+ }
+ NSNumber * _Nullable value;
+ if (cppValue.IsNull()) {
+ value = nil;
+ } else {
+ value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())];
+ }
+ return value;
+ }
+ case Attributes::NullableGlobalStruct::Id: {
+ using TypeInfo = Attributes::NullableGlobalStruct::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR) {
+ return nil;
+ }
+ MTRDataTypeTestGlobalStruct * _Nullable value;
+ if (cppValue.IsNull()) {
+ value = nil;
+ } else {
+ value = [MTRDataTypeTestGlobalStruct new];
+ value.name = AsString(cppValue.Value().name);
+ if (value.name == nil) {
+ CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT;
+ *aError = err;
+ return nil;
+ }
+ if (cppValue.Value().myBitmap.IsNull()) {
+ value.myBitmap = nil;
+ } else {
+ value.myBitmap = [NSNumber numberWithUnsignedInt:cppValue.Value().myBitmap.Value().Raw()];
+ }
+ if (cppValue.Value().myEnum.HasValue()) {
+ if (cppValue.Value().myEnum.Value().IsNull()) {
+ value.myEnum = nil;
+ } else {
+ value.myEnum = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value().myEnum.Value().Value())];
+ }
+ } else {
+ value.myEnum = nil;
+ }
+ }
+ return value;
+ }
case Attributes::MeiInt8u::Id: {
using TypeInfo = Attributes::MeiInt8u::TypeInfo;
TypeInfo::DecodableType cppValue;
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
index bdd3bcf..0f17934 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
@@ -16340,6 +16340,13 @@
*/
- (void)stringEchoRequestWithParams:(MTRUnitTestingClusterStringEchoRequestParams *)params completion:(void (^)(MTRUnitTestingClusterStringEchoResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
/**
+ * Command GlobalEchoRequest
+ *
+ * Command that takes arguments that are global structs/enums and the
+ response just echoes them back.
+ */
+- (void)globalEchoRequestWithParams:(MTRUnitTestingClusterGlobalEchoRequestParams *)params completion:(void (^)(MTRUnitTestingClusterGlobalEchoResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+/**
* Command TestDifferentVendorMeiRequest
*
* Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent.
@@ -16722,6 +16729,22 @@
reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
+ (void)readAttributeClusterErrorBooleanWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
+- (void)readAttributeGlobalEnumWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeGlobalEnumWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeGlobalEnumWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)subscribeAttributeGlobalEnumWithParams:(MTRSubscribeParams *)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE;
++ (void)readAttributeGlobalEnumWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+
+- (void)readAttributeGlobalStructWithCompletion:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)subscribeAttributeGlobalStructWithParams:(MTRSubscribeParams *)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE;
++ (void)readAttributeGlobalStructWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+
- (void)readAttributeUnsupportedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
- (void)writeAttributeUnsupportedWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
- (void)writeAttributeUnsupportedWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
@@ -17002,6 +17025,22 @@
reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
+ (void)readAttributeWriteOnlyInt8uWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
+- (void)readAttributeNullableGlobalEnumWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeNullableGlobalEnumWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeNullableGlobalEnumWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)subscribeAttributeNullableGlobalEnumWithParams:(MTRSubscribeParams *)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE;
++ (void)readAttributeNullableGlobalEnumWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+
+- (void)readAttributeNullableGlobalStructWithCompletion:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeNullableGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nullable)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeNullableGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)subscribeAttributeNullableGlobalStructWithParams:(MTRSubscribeParams *)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE;
++ (void)readAttributeNullableGlobalStructWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+
- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params
subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm
index e2bb0e3..3ca3bfe 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm
@@ -116509,6 +116509,30 @@
queue:self.callbackQueue
completion:responseHandler];
}
+- (void)globalEchoRequestWithParams:(MTRUnitTestingClusterGlobalEchoRequestParams *)params completion:(void (^)(MTRUnitTestingClusterGlobalEchoResponseParams * _Nullable data, NSError * _Nullable error))completion
+{
+ if (params == nil) {
+ params = [[MTRUnitTestingClusterGlobalEchoRequestParams
+ alloc] init];
+ }
+
+ auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) {
+ completion(response, error);
+ };
+
+ auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs;
+
+ using RequestType = UnitTesting::Commands::GlobalEchoRequest::Type;
+ [self.device _invokeKnownCommandWithEndpointID:self.endpointID
+ clusterID:@(RequestType::GetClusterId())
+ commandID:@(RequestType::GetCommandId())
+ commandPayload:params
+ timedInvokeTimeout:timedInvokeTimeoutMs
+ serverSideProcessingTimeout:params.serverSideProcessingTimeout
+ responseClass:MTRUnitTestingClusterGlobalEchoResponseParams.class
+ queue:self.callbackQueue
+ completion:responseHandler];
+}
- (void)testDifferentVendorMeiRequestWithParams:(MTRUnitTestingClusterTestDifferentVendorMeiRequestParams *)params completion:(void (^)(MTRUnitTestingClusterTestDifferentVendorMeiResponseParams * _Nullable data, NSError * _Nullable error))completion
{
if (params == nil) {
@@ -118935,6 +118959,10 @@
nonNullValue_2.f = static_cast<std::remove_reference_t<decltype(nonNullValue_2.f)>>(element_0.nullableStruct.f.unsignedCharValue);
nonNullValue_2.g = element_0.nullableStruct.g.floatValue;
nonNullValue_2.h = element_0.nullableStruct.h.doubleValue;
+ if (element_0.nullableStruct.i != nil) {
+ auto & definedValue_4 = nonNullValue_2.i.Emplace();
+ definedValue_4 = static_cast<std::remove_reference_t<decltype(definedValue_4)>>(element_0.nullableStruct.i.unsignedCharValue);
+ }
}
if (element_0.optionalStruct != nil) {
auto & definedValue_2 = listHolder_0->mList[i_0].optionalStruct.Emplace();
@@ -118946,6 +118974,10 @@
definedValue_2.f = static_cast<std::remove_reference_t<decltype(definedValue_2.f)>>(element_0.optionalStruct.f.unsignedCharValue);
definedValue_2.g = element_0.optionalStruct.g.floatValue;
definedValue_2.h = element_0.optionalStruct.h.doubleValue;
+ if (element_0.optionalStruct.i != nil) {
+ auto & definedValue_4 = definedValue_2.i.Emplace();
+ definedValue_4 = static_cast<std::remove_reference_t<decltype(definedValue_4)>>(element_0.optionalStruct.i.unsignedCharValue);
+ }
}
if (element_0.nullableOptionalStruct != nil) {
auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalStruct.Emplace();
@@ -118961,6 +118993,10 @@
nonNullValue_3.f = static_cast<std::remove_reference_t<decltype(nonNullValue_3.f)>>(element_0.nullableOptionalStruct.f.unsignedCharValue);
nonNullValue_3.g = element_0.nullableOptionalStruct.g.floatValue;
nonNullValue_3.h = element_0.nullableOptionalStruct.h.doubleValue;
+ if (element_0.nullableOptionalStruct.i != nil) {
+ auto & definedValue_5 = nonNullValue_3.i.Emplace();
+ definedValue_5 = static_cast<std::remove_reference_t<decltype(definedValue_5)>>(element_0.nullableOptionalStruct.i.unsignedCharValue);
+ }
}
}
if (element_0.nullableList == nil) {
@@ -119186,6 +119222,10 @@
cppValue.f = static_cast<std::remove_reference_t<decltype(cppValue.f)>>(value.f.unsignedCharValue);
cppValue.g = value.g.floatValue;
cppValue.h = value.h.doubleValue;
+ if (value.i != nil) {
+ auto & definedValue_1 = cppValue.i.Emplace();
+ definedValue_1 = static_cast<std::remove_reference_t<decltype(definedValue_1)>>(value.i.unsignedCharValue);
+ }
chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue);
return cppCluster.WriteAttribute<TypeInfo>(cppValue, bridge, successCb, failureCb, timedWriteTimeout); });
@@ -119634,6 +119674,10 @@
listHolder_0->mList[i_0].fabricSensitiveStruct.f = static_cast<std::remove_reference_t<decltype(listHolder_0->mList[i_0].fabricSensitiveStruct.f)>>(element_0.fabricSensitiveStruct.f.unsignedCharValue);
listHolder_0->mList[i_0].fabricSensitiveStruct.g = element_0.fabricSensitiveStruct.g.floatValue;
listHolder_0->mList[i_0].fabricSensitiveStruct.h = element_0.fabricSensitiveStruct.h.doubleValue;
+ if (element_0.fabricSensitiveStruct.i != nil) {
+ auto & definedValue_3 = listHolder_0->mList[i_0].fabricSensitiveStruct.i.Emplace();
+ definedValue_3 = static_cast<std::remove_reference_t<decltype(definedValue_3)>>(element_0.fabricSensitiveStruct.i.unsignedCharValue);
+ }
{
using ListType_2 = std::remove_reference_t<decltype(listHolder_0->mList[i_0].fabricSensitiveInt8uList)>;
using ListMemberType_2 = ListMemberTypeGetter<ListType_2>::Type;
@@ -119889,6 +119933,149 @@
completion:completion];
}
+- (void)readAttributeGlobalEnumWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = UnitTesting::Attributes::GlobalEnum::TypeInfo;
+ [self.device _readKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:nil
+ queue:self.callbackQueue
+ completion:completion];
+}
+
+- (void)writeAttributeGlobalEnumWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion
+{
+ [self writeAttributeGlobalEnumWithValue:(NSNumber * _Nonnull) value params:nil completion:completion];
+}
+- (void)writeAttributeGlobalEnumWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion
+{
+ // Make a copy of params before we go async.
+ params = [params copy];
+ value = [value copy];
+
+ auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) {
+ chip::Optional<uint16_t> timedWriteTimeout;
+ if (params != nil) {
+ if (params.timedWriteTimeout != nil){
+ timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue);
+ }
+ }
+
+ ListFreer listFreer;
+ using TypeInfo = UnitTesting::Attributes::GlobalEnum::TypeInfo;
+ TypeInfo::Type cppValue;
+ cppValue = static_cast<std::remove_reference_t<decltype(cppValue)>>(value.unsignedCharValue);
+
+ chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue);
+ return cppCluster.WriteAttribute<TypeInfo>(cppValue, bridge, successCb, failureCb, timedWriteTimeout); });
+ std::move(*bridge).DispatchAction(self.device);
+}
+
+- (void)subscribeAttributeGlobalEnumWithParams:(MTRSubscribeParams * _Nonnull)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler
+{
+ using TypeInfo = UnitTesting::Attributes::GlobalEnum::TypeInfo;
+ [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:params
+ queue:self.callbackQueue
+ reportHandler:reportHandler
+ subscriptionEstablished:subscriptionEstablished];
+}
+
++ (void)readAttributeGlobalEnumWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = UnitTesting::Attributes::GlobalEnum::TypeInfo;
+ [clusterStateCacheContainer
+ _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue])
+ clusterID:TypeInfo::GetClusterId()
+ attributeID:TypeInfo::GetAttributeId()
+ queue:queue
+ completion:completion];
+}
+
+- (void)readAttributeGlobalStructWithCompletion:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = UnitTesting::Attributes::GlobalStruct::TypeInfo;
+ [self.device _readKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:nil
+ queue:self.callbackQueue
+ completion:completion];
+}
+
+- (void)writeAttributeGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nonnull)value completion:(MTRStatusCompletion)completion
+{
+ [self writeAttributeGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nonnull) value params:nil completion:completion];
+}
+- (void)writeAttributeGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion
+{
+ // Make a copy of params before we go async.
+ params = [params copy];
+ value = [value copy];
+
+ auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) {
+ chip::Optional<uint16_t> timedWriteTimeout;
+ if (params != nil) {
+ if (params.timedWriteTimeout != nil){
+ timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue);
+ }
+ }
+
+ ListFreer listFreer;
+ using TypeInfo = UnitTesting::Attributes::GlobalStruct::TypeInfo;
+ TypeInfo::Type cppValue;
+ cppValue.name = AsCharSpan(value.name);
+ if (value.myBitmap == nil) {
+ cppValue.myBitmap.SetNull();
+ } else {
+ auto & nonNullValue_1 = cppValue.myBitmap.SetNonNull();
+ nonNullValue_1 = static_cast<std::remove_reference_t<decltype(nonNullValue_1)>>(value.myBitmap.unsignedIntValue);
+ }
+ if (value.myEnum != nil) {
+ auto & definedValue_1 = cppValue.myEnum.Emplace();
+ if (value.myEnum == nil) {
+ definedValue_1.SetNull();
+ } else {
+ auto & nonNullValue_2 = definedValue_1.SetNonNull();
+ nonNullValue_2 = static_cast<std::remove_reference_t<decltype(nonNullValue_2)>>(value.myEnum.unsignedCharValue);
+ }
+ }
+
+ chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue);
+ return cppCluster.WriteAttribute<TypeInfo>(cppValue, bridge, successCb, failureCb, timedWriteTimeout); });
+ std::move(*bridge).DispatchAction(self.device);
+}
+
+- (void)subscribeAttributeGlobalStructWithParams:(MTRSubscribeParams * _Nonnull)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))reportHandler
+{
+ using TypeInfo = UnitTesting::Attributes::GlobalStruct::TypeInfo;
+ [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:params
+ queue:self.callbackQueue
+ reportHandler:reportHandler
+ subscriptionEstablished:subscriptionEstablished];
+}
+
++ (void)readAttributeGlobalStructWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = UnitTesting::Attributes::GlobalStruct::TypeInfo;
+ [clusterStateCacheContainer
+ _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue])
+ clusterID:TypeInfo::GetClusterId()
+ attributeID:TypeInfo::GetAttributeId()
+ queue:queue
+ completion:completion];
+}
+
- (void)readAttributeUnsupportedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion
{
using TypeInfo = UnitTesting::Attributes::Unsupported::TypeInfo;
@@ -121929,6 +122116,10 @@
nonNullValue_0.f = static_cast<std::remove_reference_t<decltype(nonNullValue_0.f)>>(value.f.unsignedCharValue);
nonNullValue_0.g = value.g.floatValue;
nonNullValue_0.h = value.h.doubleValue;
+ if (value.i != nil) {
+ auto & definedValue_2 = nonNullValue_0.i.Emplace();
+ definedValue_2 = static_cast<std::remove_reference_t<decltype(definedValue_2)>>(value.i.unsignedCharValue);
+ }
}
chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue);
@@ -122301,6 +122492,159 @@
completion:completion];
}
+- (void)readAttributeNullableGlobalEnumWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = UnitTesting::Attributes::NullableGlobalEnum::TypeInfo;
+ [self.device _readKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:nil
+ queue:self.callbackQueue
+ completion:completion];
+}
+
+- (void)writeAttributeNullableGlobalEnumWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion
+{
+ [self writeAttributeNullableGlobalEnumWithValue:(NSNumber * _Nullable) value params:nil completion:completion];
+}
+- (void)writeAttributeNullableGlobalEnumWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion
+{
+ // Make a copy of params before we go async.
+ params = [params copy];
+ value = [value copy];
+
+ auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) {
+ chip::Optional<uint16_t> timedWriteTimeout;
+ if (params != nil) {
+ if (params.timedWriteTimeout != nil){
+ timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue);
+ }
+ }
+
+ ListFreer listFreer;
+ using TypeInfo = UnitTesting::Attributes::NullableGlobalEnum::TypeInfo;
+ TypeInfo::Type cppValue;
+ if (value == nil) {
+ cppValue.SetNull();
+ } else {
+ auto & nonNullValue_0 = cppValue.SetNonNull();
+ nonNullValue_0 = static_cast<std::remove_reference_t<decltype(nonNullValue_0)>>(value.unsignedCharValue);
+ }
+
+ chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue);
+ return cppCluster.WriteAttribute<TypeInfo>(cppValue, bridge, successCb, failureCb, timedWriteTimeout); });
+ std::move(*bridge).DispatchAction(self.device);
+}
+
+- (void)subscribeAttributeNullableGlobalEnumWithParams:(MTRSubscribeParams * _Nonnull)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler
+{
+ using TypeInfo = UnitTesting::Attributes::NullableGlobalEnum::TypeInfo;
+ [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:params
+ queue:self.callbackQueue
+ reportHandler:reportHandler
+ subscriptionEstablished:subscriptionEstablished];
+}
+
++ (void)readAttributeNullableGlobalEnumWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = UnitTesting::Attributes::NullableGlobalEnum::TypeInfo;
+ [clusterStateCacheContainer
+ _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue])
+ clusterID:TypeInfo::GetClusterId()
+ attributeID:TypeInfo::GetAttributeId()
+ queue:queue
+ completion:completion];
+}
+
+- (void)readAttributeNullableGlobalStructWithCompletion:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = UnitTesting::Attributes::NullableGlobalStruct::TypeInfo;
+ [self.device _readKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:nil
+ queue:self.callbackQueue
+ completion:completion];
+}
+
+- (void)writeAttributeNullableGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nullable)value completion:(MTRStatusCompletion)completion
+{
+ [self writeAttributeNullableGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nullable) value params:nil completion:completion];
+}
+- (void)writeAttributeNullableGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion
+{
+ // Make a copy of params before we go async.
+ params = [params copy];
+ value = [value copy];
+
+ auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) {
+ chip::Optional<uint16_t> timedWriteTimeout;
+ if (params != nil) {
+ if (params.timedWriteTimeout != nil){
+ timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue);
+ }
+ }
+
+ ListFreer listFreer;
+ using TypeInfo = UnitTesting::Attributes::NullableGlobalStruct::TypeInfo;
+ TypeInfo::Type cppValue;
+ if (value == nil) {
+ cppValue.SetNull();
+ } else {
+ auto & nonNullValue_0 = cppValue.SetNonNull();
+ nonNullValue_0.name = AsCharSpan(value.name);
+ if (value.myBitmap == nil) {
+ nonNullValue_0.myBitmap.SetNull();
+ } else {
+ auto & nonNullValue_2 = nonNullValue_0.myBitmap.SetNonNull();
+ nonNullValue_2 = static_cast<std::remove_reference_t<decltype(nonNullValue_2)>>(value.myBitmap.unsignedIntValue);
+ }
+ if (value.myEnum != nil) {
+ auto & definedValue_2 = nonNullValue_0.myEnum.Emplace();
+ if (value.myEnum == nil) {
+ definedValue_2.SetNull();
+ } else {
+ auto & nonNullValue_3 = definedValue_2.SetNonNull();
+ nonNullValue_3 = static_cast<std::remove_reference_t<decltype(nonNullValue_3)>>(value.myEnum.unsignedCharValue);
+ }
+ }
+ }
+
+ chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue);
+ return cppCluster.WriteAttribute<TypeInfo>(cppValue, bridge, successCb, failureCb, timedWriteTimeout); });
+ std::move(*bridge).DispatchAction(self.device);
+}
+
+- (void)subscribeAttributeNullableGlobalStructWithParams:(MTRSubscribeParams * _Nonnull)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))reportHandler
+{
+ using TypeInfo = UnitTesting::Attributes::NullableGlobalStruct::TypeInfo;
+ [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:params
+ queue:self.callbackQueue
+ reportHandler:reportHandler
+ subscriptionEstablished:subscriptionEstablished];
+}
+
++ (void)readAttributeNullableGlobalStructWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = UnitTesting::Attributes::NullableGlobalStruct::TypeInfo;
+ [clusterStateCacheContainer
+ _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue])
+ clusterID:TypeInfo::GetClusterId()
+ attributeID:TypeInfo::GetAttributeId()
+ queue:queue
+ completion:completion];
+}
+
- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion
{
using TypeInfo = UnitTesting::Attributes::GeneratedCommandList::TypeInfo;
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h
index 98ca2f9..f920a8e 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h
@@ -5764,6 +5764,8 @@
MTRAttributeIDTypeClusterUnitTestingAttributeTimedWriteBooleanID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000030,
MTRAttributeIDTypeClusterUnitTestingAttributeGeneralErrorBooleanID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000031,
MTRAttributeIDTypeClusterUnitTestingAttributeClusterErrorBooleanID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000032,
+ MTRAttributeIDTypeClusterUnitTestingAttributeGlobalEnumID MTR_PROVISIONALLY_AVAILABLE = 0x00000033,
+ MTRAttributeIDTypeClusterUnitTestingAttributeGlobalStructID MTR_PROVISIONALLY_AVAILABLE = 0x00000034,
MTRAttributeIDTypeClusterUnitTestingAttributeUnsupportedID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x000000FF,
MTRAttributeIDTypeClusterUnitTestingAttributeNullableBooleanID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00004000,
MTRAttributeIDTypeClusterUnitTestingAttributeNullableBitmap8ID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00004001,
@@ -5799,6 +5801,8 @@
MTRAttributeIDTypeClusterUnitTestingAttributeNullableRangeRestrictedInt16uID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00004028,
MTRAttributeIDTypeClusterUnitTestingAttributeNullableRangeRestrictedInt16sID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00004029,
MTRAttributeIDTypeClusterUnitTestingAttributeWriteOnlyInt8uID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000402A,
+ MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalEnumID MTR_PROVISIONALLY_AVAILABLE = 0x00004033,
+ MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalStructID MTR_PROVISIONALLY_AVAILABLE = 0x00004034,
MTRAttributeIDTypeClusterUnitTestingAttributeGeneratedCommandListID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID,
MTRAttributeIDTypeClusterUnitTestingAttributeAcceptedCommandListID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID,
MTRAttributeIDTypeClusterUnitTestingAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID,
@@ -7102,6 +7106,7 @@
MTRCommandIDTypeClusterUnitTestingCommandTestListInt8UReverseRequestID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000000D,
MTRCommandIDTypeClusterUnitTestingCommandStringEchoResponseID MTR_PROVISIONALLY_AVAILABLE = 0x0000000D,
MTRCommandIDTypeClusterUnitTestingCommandTestEnumsRequestID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000000E,
+ MTRCommandIDTypeClusterUnitTestingCommandGlobalEchoResponseID MTR_PROVISIONALLY_AVAILABLE = 0x0000000E,
MTRCommandIDTypeClusterUnitTestingCommandTestNullableOptionalRequestID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000000F,
MTRCommandIDTypeClusterUnitTestingCommandTestComplexNullableOptionalRequestID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000010,
MTRCommandIDTypeClusterUnitTestingCommandSimpleStructEchoRequestID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000011,
@@ -7112,6 +7117,7 @@
MTRCommandIDTypeClusterUnitTestingCommandTestBatchHelperRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000016,
MTRCommandIDTypeClusterUnitTestingCommandTestSecondBatchHelperRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000017,
MTRCommandIDTypeClusterUnitTestingCommandStringEchoRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000018,
+ MTRCommandIDTypeClusterUnitTestingCommandGlobalEchoRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000019,
MTRCommandIDTypeClusterUnitTestingCommandTestDifferentVendorMeiRequestID MTR_PROVISIONALLY_AVAILABLE = 0xFFF200AA,
MTRCommandIDTypeClusterUnitTestingCommandTestDifferentVendorMeiResponseID MTR_PROVISIONALLY_AVAILABLE = 0xFFF200BB,
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm
index 5f9d1b8..6191e7c 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm
@@ -9163,6 +9163,14 @@
result = @"ClusterErrorBoolean";
break;
+ case MTRAttributeIDTypeClusterUnitTestingAttributeGlobalEnumID:
+ result = @"GlobalEnum";
+ break;
+
+ case MTRAttributeIDTypeClusterUnitTestingAttributeGlobalStructID:
+ result = @"GlobalStruct";
+ break;
+
case MTRAttributeIDTypeClusterUnitTestingAttributeUnsupportedID:
result = @"Unsupported";
break;
@@ -9303,6 +9311,14 @@
result = @"WriteOnlyInt8u";
break;
+ case MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalEnumID:
+ result = @"NullableGlobalEnum";
+ break;
+
+ case MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalStructID:
+ result = @"NullableGlobalStruct";
+ break;
+
case MTRAttributeIDTypeClusterUnitTestingAttributeGeneratedCommandListID:
result = @"GeneratedCommandList";
break;
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h
index 8da2b1f..44ecc1e 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h
@@ -7455,6 +7455,7 @@
- (void)testBatchHelperRequestWithParams:(MTRUnitTestingClusterTestBatchHelperRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRUnitTestingClusterTestBatchHelperResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
- (void)testSecondBatchHelperRequestWithParams:(MTRUnitTestingClusterTestSecondBatchHelperRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRUnitTestingClusterTestBatchHelperResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
- (void)stringEchoRequestWithParams:(MTRUnitTestingClusterStringEchoRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRUnitTestingClusterStringEchoResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)globalEchoRequestWithParams:(MTRUnitTestingClusterGlobalEchoRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRUnitTestingClusterGlobalEchoResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
- (void)testDifferentVendorMeiRequestWithParams:(MTRUnitTestingClusterTestDifferentVendorMeiRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRUnitTestingClusterTestDifferentVendorMeiResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
- (NSDictionary<NSString *, id> * _Nullable)readAttributeBooleanWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
@@ -7645,6 +7646,14 @@
- (void)writeAttributeClusterErrorBooleanWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
- (void)writeAttributeClusterErrorBooleanWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeGlobalEnumWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeGlobalEnumWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeGlobalEnumWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE;
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeGlobalStructWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeGlobalStructWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeGlobalStructWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE;
+
- (NSDictionary<NSString *, id> * _Nullable)readAttributeUnsupportedWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
- (void)writeAttributeUnsupportedWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
- (void)writeAttributeUnsupportedWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
@@ -7785,6 +7794,14 @@
- (void)writeAttributeWriteOnlyInt8uWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
- (void)writeAttributeWriteOnlyInt8uWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeNullableGlobalEnumWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeNullableGlobalEnumWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeNullableGlobalEnumWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE;
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeNullableGlobalStructWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeNullableGlobalStructWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeNullableGlobalStructWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE;
+
- (NSDictionary<NSString *, id> * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
- (NSDictionary<NSString *, id> * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm
index ec6f0c4..8e06c4d28 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm
@@ -21757,6 +21757,33 @@
completion:responseHandler];
}
+- (void)globalEchoRequestWithParams:(MTRUnitTestingClusterGlobalEchoRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRUnitTestingClusterGlobalEchoResponseParams * _Nullable data, NSError * _Nullable error))completion
+{
+ if (params == nil) {
+ params = [[MTRUnitTestingClusterGlobalEchoRequestParams
+ alloc] init];
+ }
+
+ auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) {
+ completion(response, error);
+ };
+
+ auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs;
+
+ using RequestType = UnitTesting::Commands::GlobalEchoRequest::Type;
+ [self.device _invokeKnownCommandWithEndpointID:self.endpointID
+ clusterID:@(RequestType::GetClusterId())
+ commandID:@(RequestType::GetCommandId())
+ commandPayload:params
+ expectedValues:expectedValues
+ expectedValueInterval:expectedValueIntervalMs
+ timedInvokeTimeout:timedInvokeTimeoutMs
+ serverSideProcessingTimeout:params.serverSideProcessingTimeout
+ responseClass:MTRUnitTestingClusterGlobalEchoResponseParams.class
+ queue:self.callbackQueue
+ completion:responseHandler];
+}
+
- (void)testDifferentVendorMeiRequestWithParams:(MTRUnitTestingClusterTestDifferentVendorMeiRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRUnitTestingClusterTestDifferentVendorMeiResponseParams * _Nullable data, NSError * _Nullable error))completion
{
if (params == nil) {
@@ -22539,6 +22566,38 @@
[self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeClusterErrorBooleanID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout];
}
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeGlobalEnumWithParams:(MTRReadParams * _Nullable)params
+{
+ return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeGlobalEnumID) params:params];
+}
+
+- (void)writeAttributeGlobalEnumWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs
+{
+ [self writeAttributeGlobalEnumWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil];
+}
+- (void)writeAttributeGlobalEnumWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params
+{
+ NSNumber * timedWriteTimeout = params.timedWriteTimeout;
+
+ [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeGlobalEnumID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout];
+}
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeGlobalStructWithParams:(MTRReadParams * _Nullable)params
+{
+ return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeGlobalStructID) params:params];
+}
+
+- (void)writeAttributeGlobalStructWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs
+{
+ [self writeAttributeGlobalStructWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil];
+}
+- (void)writeAttributeGlobalStructWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params
+{
+ NSNumber * timedWriteTimeout = params.timedWriteTimeout;
+
+ [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeGlobalStructID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout];
+}
+
- (NSDictionary<NSString *, id> * _Nullable)readAttributeUnsupportedWithParams:(MTRReadParams * _Nullable)params
{
return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeUnsupportedID) params:params];
@@ -23099,6 +23158,38 @@
[self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeWriteOnlyInt8uID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout];
}
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeNullableGlobalEnumWithParams:(MTRReadParams * _Nullable)params
+{
+ return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalEnumID) params:params];
+}
+
+- (void)writeAttributeNullableGlobalEnumWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs
+{
+ [self writeAttributeNullableGlobalEnumWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil];
+}
+- (void)writeAttributeNullableGlobalEnumWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params
+{
+ NSNumber * timedWriteTimeout = params.timedWriteTimeout;
+
+ [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalEnumID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout];
+}
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeNullableGlobalStructWithParams:(MTRReadParams * _Nullable)params
+{
+ return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalStructID) params:params];
+}
+
+- (void)writeAttributeNullableGlobalStructWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs
+{
+ [self writeAttributeNullableGlobalStructWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil];
+}
+- (void)writeAttributeNullableGlobalStructWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params
+{
+ NSNumber * timedWriteTimeout = params.timedWriteTimeout;
+
+ [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalStructID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout];
+}
+
- (NSDictionary<NSString *, id> * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params
{
return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeGeneratedCommandListID) params:params];
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h
index 54073ac..62f200f 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h
@@ -12925,6 +12925,27 @@
@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout;
@end
+MTR_PROVISIONALLY_AVAILABLE
+@interface MTRUnitTestingClusterGlobalEchoResponseParams : NSObject <NSCopying>
+
+@property (nonatomic, copy) MTRDataTypeTestGlobalStruct * _Nonnull field1 MTR_PROVISIONALLY_AVAILABLE;
+
+@property (nonatomic, copy) NSNumber * _Nonnull field2 MTR_PROVISIONALLY_AVAILABLE;
+
+/**
+ * Initialize an MTRUnitTestingClusterGlobalEchoResponseParams with a response-value dictionary
+ * of the sort that MTRDeviceResponseHandler would receive.
+ *
+ * Will return nil and hand out an error if the response-value dictionary is not
+ * a command data response or is not the right command response.
+ *
+ * Will return nil and hand out an error if the data response does not match the known
+ * schema for this command.
+ */
+- (nullable instancetype)initWithResponseValue:(NSDictionary<NSString *, id> *)responseValue
+ error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE;
+@end
+
MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4))
@interface MTRUnitTestingClusterTestNullableOptionalRequestParams : NSObject <NSCopying>
@@ -13492,6 +13513,38 @@
@end
MTR_PROVISIONALLY_AVAILABLE
+@interface MTRUnitTestingClusterGlobalEchoRequestParams : NSObject <NSCopying>
+
+@property (nonatomic, copy) MTRDataTypeTestGlobalStruct * _Nonnull field1 MTR_PROVISIONALLY_AVAILABLE;
+
+@property (nonatomic, copy) NSNumber * _Nonnull field2 MTR_PROVISIONALLY_AVAILABLE;
+/**
+ * Controls whether the command is a timed command (using Timed Invoke).
+ *
+ * If nil (the default value), a regular invoke is done for commands that do
+ * not require a timed invoke and a timed invoke with some default timed request
+ * timeout is done for commands that require a timed invoke.
+ *
+ * If not nil, a timed invoke is done, with the provided value used as the timed
+ * request timeout. The value should be chosen small enough to provide the
+ * desired security properties but large enough that it will allow a round-trip
+ * from the sever to the client (for the status response and actual invoke
+ * request) within the timeout window.
+ *
+ */
+@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs;
+
+/**
+ * Controls how much time, in seconds, we will allow for the server to process the command.
+ *
+ * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes.
+ *
+ * If nil, the framework will try to select an appropriate timeout value itself.
+ */
+@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout;
+@end
+
+MTR_PROVISIONALLY_AVAILABLE
@interface MTRUnitTestingClusterTestDifferentVendorMeiRequestParams : NSObject <NSCopying>
@property (nonatomic, copy) NSNumber * _Nonnull arg1 MTR_PROVISIONALLY_AVAILABLE;
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm
index c49195c..6b10028 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm
@@ -32884,6 +32884,11 @@
newElement_0.c.f = [NSNumber numberWithUnsignedChar:entry_0.c.f.Raw()];
newElement_0.c.g = [NSNumber numberWithFloat:entry_0.c.g];
newElement_0.c.h = [NSNumber numberWithDouble:entry_0.c.h];
+ if (entry_0.c.i.HasValue()) {
+ newElement_0.c.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.c.i.Value())];
+ } else {
+ newElement_0.c.i = nil;
+ }
{ // Scope for our temporary variables
auto * array_2 = [NSMutableArray new];
auto iter_2 = entry_0.d.begin();
@@ -32903,6 +32908,11 @@
newElement_2.f = [NSNumber numberWithUnsignedChar:entry_2.f.Raw()];
newElement_2.g = [NSNumber numberWithFloat:entry_2.g];
newElement_2.h = [NSNumber numberWithDouble:entry_2.h];
+ if (entry_2.i.HasValue()) {
+ newElement_2.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2.i.Value())];
+ } else {
+ newElement_2.i = nil;
+ }
[array_2 addObject:newElement_2];
}
CHIP_ERROR err = iter_2.GetStatus();
@@ -32985,6 +32995,11 @@
newElement_0.f = [NSNumber numberWithUnsignedChar:entry_0.f.Raw()];
newElement_0.g = [NSNumber numberWithFloat:entry_0.g];
newElement_0.h = [NSNumber numberWithDouble:entry_0.h];
+ if (entry_0.i.HasValue()) {
+ newElement_0.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.i.Value())];
+ } else {
+ newElement_0.i = nil;
+ }
[array_0 addObject:newElement_0];
}
CHIP_ERROR err = iter_0.GetStatus();
@@ -33497,6 +33512,10 @@
listHolder_0->mList[i_0].c.f = static_cast<std::remove_reference_t<decltype(listHolder_0->mList[i_0].c.f)>>(element_0.c.f.unsignedCharValue);
listHolder_0->mList[i_0].c.g = element_0.c.g.floatValue;
listHolder_0->mList[i_0].c.h = element_0.c.h.doubleValue;
+ if (element_0.c.i != nil) {
+ auto & definedValue_3 = listHolder_0->mList[i_0].c.i.Emplace();
+ definedValue_3 = static_cast<std::remove_reference_t<decltype(definedValue_3)>>(element_0.c.i.unsignedCharValue);
+ }
{
using ListType_2 = std::remove_reference_t<decltype(listHolder_0->mList[i_0].d)>;
using ListMemberType_2 = ListMemberTypeGetter<ListType_2>::Type;
@@ -33520,6 +33539,10 @@
listHolder_2->mList[i_2].f = static_cast<std::remove_reference_t<decltype(listHolder_2->mList[i_2].f)>>(element_2.f.unsignedCharValue);
listHolder_2->mList[i_2].g = element_2.g.floatValue;
listHolder_2->mList[i_2].h = element_2.h.doubleValue;
+ if (element_2.i != nil) {
+ auto & definedValue_4 = listHolder_2->mList[i_2].i.Emplace();
+ definedValue_4 = static_cast<std::remove_reference_t<decltype(definedValue_4)>>(element_2.i.unsignedCharValue);
+ }
}
listHolder_0->mList[i_0].d = ListType_2(listHolder_2->mList, element_0.d.count);
} else {
@@ -33623,6 +33646,10 @@
listHolder_0->mList[i_0].f = static_cast<std::remove_reference_t<decltype(listHolder_0->mList[i_0].f)>>(element_0.f.unsignedCharValue);
listHolder_0->mList[i_0].g = element_0.g.floatValue;
listHolder_0->mList[i_0].h = element_0.h.doubleValue;
+ if (element_0.i != nil) {
+ auto & definedValue_2 = listHolder_0->mList[i_0].i.Emplace();
+ definedValue_2 = static_cast<std::remove_reference_t<decltype(definedValue_2)>>(element_0.i.unsignedCharValue);
+ }
}
encodableStruct.arg2 = ListType_0(listHolder_0->mList, self.arg2.count);
} else {
@@ -33903,6 +33930,10 @@
encodableStruct.arg1.f = static_cast<std::remove_reference_t<decltype(encodableStruct.arg1.f)>>(self.arg1.f.unsignedCharValue);
encodableStruct.arg1.g = self.arg1.g.floatValue;
encodableStruct.arg1.h = self.arg1.h.doubleValue;
+ if (self.arg1.i != nil) {
+ auto & definedValue_1 = encodableStruct.arg1.i.Emplace();
+ definedValue_1 = static_cast<std::remove_reference_t<decltype(definedValue_1)>>(self.arg1.i.unsignedCharValue);
+ }
}
auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0);
@@ -34207,6 +34238,11 @@
self.nullableStructValue.f = [NSNumber numberWithUnsignedChar:decodableStruct.nullableStructValue.Value().f.Raw()];
self.nullableStructValue.g = [NSNumber numberWithFloat:decodableStruct.nullableStructValue.Value().g];
self.nullableStructValue.h = [NSNumber numberWithDouble:decodableStruct.nullableStructValue.Value().h];
+ if (decodableStruct.nullableStructValue.Value().i.HasValue()) {
+ self.nullableStructValue.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.nullableStructValue.Value().i.Value())];
+ } else {
+ self.nullableStructValue.i = nil;
+ }
} else {
self.nullableStructValue = nil;
}
@@ -34229,6 +34265,11 @@
self.optionalStructValue.f = [NSNumber numberWithUnsignedChar:decodableStruct.optionalStructValue.Value().f.Raw()];
self.optionalStructValue.g = [NSNumber numberWithFloat:decodableStruct.optionalStructValue.Value().g];
self.optionalStructValue.h = [NSNumber numberWithDouble:decodableStruct.optionalStructValue.Value().h];
+ if (decodableStruct.optionalStructValue.Value().i.HasValue()) {
+ self.optionalStructValue.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.optionalStructValue.Value().i.Value())];
+ } else {
+ self.optionalStructValue.i = nil;
+ }
} else {
self.optionalStructValue = nil;
}
@@ -34258,6 +34299,11 @@
self.nullableOptionalStructValue.f = [NSNumber numberWithUnsignedChar:decodableStruct.nullableOptionalStructValue.Value().f.Raw()];
self.nullableOptionalStructValue.g = [NSNumber numberWithFloat:decodableStruct.nullableOptionalStructValue.Value().g];
self.nullableOptionalStructValue.h = [NSNumber numberWithDouble:decodableStruct.nullableOptionalStructValue.Value().h];
+ if (decodableStruct.nullableOptionalStructValue.Value().i.HasValue()) {
+ self.nullableOptionalStructValue.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.nullableOptionalStructValue.Value().i.Value())];
+ } else {
+ self.nullableOptionalStructValue.i = nil;
+ }
} else {
self.nullableOptionalStructValue = nil;
}
@@ -34426,6 +34472,29 @@
encodableStruct.arg1.c.f = static_cast<std::remove_reference_t<decltype(encodableStruct.arg1.c.f)>>(self.arg1.c.f.unsignedCharValue);
encodableStruct.arg1.c.g = self.arg1.c.g.floatValue;
encodableStruct.arg1.c.h = self.arg1.c.h.doubleValue;
+ if (self.arg1.c.i != nil) {
+ auto & definedValue_2 = encodableStruct.arg1.c.i.Emplace();
+ definedValue_2 = static_cast<std::remove_reference_t<decltype(definedValue_2)>>(self.arg1.c.i.unsignedCharValue);
+ }
+ if (self.arg1.d != nil) {
+ auto & definedValue_1 = encodableStruct.arg1.d.Emplace();
+ definedValue_1.name = AsCharSpan(self.arg1.d.name);
+ if (self.arg1.d.myBitmap == nil) {
+ definedValue_1.myBitmap.SetNull();
+ } else {
+ auto & nonNullValue_3 = definedValue_1.myBitmap.SetNonNull();
+ nonNullValue_3 = static_cast<std::remove_reference_t<decltype(nonNullValue_3)>>(self.arg1.d.myBitmap.unsignedIntValue);
+ }
+ if (self.arg1.d.myEnum != nil) {
+ auto & definedValue_3 = definedValue_1.myEnum.Emplace();
+ if (self.arg1.d.myEnum == nil) {
+ definedValue_3.SetNull();
+ } else {
+ auto & nonNullValue_4 = definedValue_3.SetNonNull();
+ nonNullValue_4 = static_cast<std::remove_reference_t<decltype(nonNullValue_4)>>(self.arg1.d.myEnum.unsignedCharValue);
+ }
+ }
+ }
}
auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0);
@@ -34619,6 +34688,10 @@
listHolder_0->mList[i_0].f = static_cast<std::remove_reference_t<decltype(listHolder_0->mList[i_0].f)>>(element_0.f.unsignedCharValue);
listHolder_0->mList[i_0].g = element_0.g.floatValue;
listHolder_0->mList[i_0].h = element_0.h.doubleValue;
+ if (element_0.i != nil) {
+ auto & definedValue_2 = listHolder_0->mList[i_0].i.Emplace();
+ definedValue_2 = static_cast<std::remove_reference_t<decltype(definedValue_2)>>(element_0.i.unsignedCharValue);
+ }
}
encodableStruct.arg1 = ListType_0(listHolder_0->mList, self.arg1.count);
} else {
@@ -34758,6 +34831,11 @@
self.arg1.f = [NSNumber numberWithUnsignedChar:decodableStruct.arg1.f.Raw()];
self.arg1.g = [NSNumber numberWithFloat:decodableStruct.arg1.g];
self.arg1.h = [NSNumber numberWithDouble:decodableStruct.arg1.h];
+ if (decodableStruct.arg1.i.HasValue()) {
+ self.arg1.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.arg1.i.Value())];
+ } else {
+ self.arg1.i = nil;
+ }
}
return CHIP_NO_ERROR;
}
@@ -35009,6 +35087,10 @@
encodableStruct.arg1.c.f = static_cast<std::remove_reference_t<decltype(encodableStruct.arg1.c.f)>>(self.arg1.c.f.unsignedCharValue);
encodableStruct.arg1.c.g = self.arg1.c.g.floatValue;
encodableStruct.arg1.c.h = self.arg1.c.h.doubleValue;
+ if (self.arg1.c.i != nil) {
+ auto & definedValue_2 = encodableStruct.arg1.c.i.Emplace();
+ definedValue_2 = static_cast<std::remove_reference_t<decltype(definedValue_2)>>(self.arg1.c.i.unsignedCharValue);
+ }
{
using ListType_1 = std::remove_reference_t<decltype(encodableStruct.arg1.d)>;
using ListMemberType_1 = ListMemberTypeGetter<ListType_1>::Type;
@@ -35032,6 +35114,10 @@
listHolder_1->mList[i_1].f = static_cast<std::remove_reference_t<decltype(listHolder_1->mList[i_1].f)>>(element_1.f.unsignedCharValue);
listHolder_1->mList[i_1].g = element_1.g.floatValue;
listHolder_1->mList[i_1].h = element_1.h.doubleValue;
+ if (element_1.i != nil) {
+ auto & definedValue_3 = listHolder_1->mList[i_1].i.Emplace();
+ definedValue_3 = static_cast<std::remove_reference_t<decltype(definedValue_3)>>(element_1.i.unsignedCharValue);
+ }
}
encodableStruct.arg1.d = ListType_1(listHolder_1->mList, self.arg1.d.count);
} else {
@@ -35299,6 +35385,10 @@
listHolder_0->mList[i_0].c.f = static_cast<std::remove_reference_t<decltype(listHolder_0->mList[i_0].c.f)>>(element_0.c.f.unsignedCharValue);
listHolder_0->mList[i_0].c.g = element_0.c.g.floatValue;
listHolder_0->mList[i_0].c.h = element_0.c.h.doubleValue;
+ if (element_0.c.i != nil) {
+ auto & definedValue_3 = listHolder_0->mList[i_0].c.i.Emplace();
+ definedValue_3 = static_cast<std::remove_reference_t<decltype(definedValue_3)>>(element_0.c.i.unsignedCharValue);
+ }
{
using ListType_2 = std::remove_reference_t<decltype(listHolder_0->mList[i_0].d)>;
using ListMemberType_2 = ListMemberTypeGetter<ListType_2>::Type;
@@ -35322,6 +35412,10 @@
listHolder_2->mList[i_2].f = static_cast<std::remove_reference_t<decltype(listHolder_2->mList[i_2].f)>>(element_2.f.unsignedCharValue);
listHolder_2->mList[i_2].g = element_2.g.floatValue;
listHolder_2->mList[i_2].h = element_2.h.doubleValue;
+ if (element_2.i != nil) {
+ auto & definedValue_4 = listHolder_2->mList[i_2].i.Emplace();
+ definedValue_4 = static_cast<std::remove_reference_t<decltype(definedValue_4)>>(element_2.i.unsignedCharValue);
+ }
}
listHolder_0->mList[i_0].d = ListType_2(listHolder_2->mList, element_0.d.count);
} else {
@@ -35802,6 +35896,110 @@
@dynamic timedInvokeTimeoutMs;
@dynamic serverSideProcessingTimeout;
@end
+@implementation MTRUnitTestingClusterGlobalEchoResponseParams
+- (instancetype)init
+{
+ if (self = [super init]) {
+
+ _field1 = [MTRDataTypeTestGlobalStruct new];
+
+ _field2 = @(0);
+ }
+ return self;
+}
+
+- (id)copyWithZone:(NSZone * _Nullable)zone;
+{
+ auto other = [[MTRUnitTestingClusterGlobalEchoResponseParams alloc] init];
+
+ other.field1 = self.field1;
+ other.field2 = self.field2;
+
+ return other;
+}
+
+- (NSString *)description
+{
+ NSString * descriptionString = [NSString stringWithFormat:@"<%@: field1:%@; field2:%@; >", NSStringFromClass([self class]), _field1, _field2];
+ return descriptionString;
+}
+
+- (nullable instancetype)initWithResponseValue:(NSDictionary<NSString *, id> *)responseValue
+ error:(NSError * __autoreleasing *)error
+{
+ if (!(self = [super init])) {
+ return nil;
+ }
+
+ using DecodableType = chip::app::Clusters::UnitTesting::Commands::GlobalEchoResponse::DecodableType;
+ chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue
+ clusterID:DecodableType::GetClusterId()
+ commandID:DecodableType::GetCommandId()
+ error:error];
+ if (buffer.IsNull()) {
+ return nil;
+ }
+
+ chip::TLV::TLVReader reader;
+ reader.Init(buffer->Start(), buffer->DataLength());
+
+ CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag());
+ if (err == CHIP_NO_ERROR) {
+ DecodableType decodedStruct;
+ err = chip::app::DataModel::Decode(reader, decodedStruct);
+ if (err == CHIP_NO_ERROR) {
+ err = [self _setFieldsFromDecodableStruct:decodedStruct];
+ if (err == CHIP_NO_ERROR) {
+ return self;
+ }
+ }
+ }
+
+ NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()];
+ MTR_LOG_ERROR("%s", errorStr.UTF8String);
+ if (error != nil) {
+ NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) };
+ *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo];
+ }
+ return nil;
+}
+
+@end
+
+@implementation MTRUnitTestingClusterGlobalEchoResponseParams (InternalMethods)
+
+- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTesting::Commands::GlobalEchoResponse::DecodableType &)decodableStruct
+{
+ {
+ self.field1 = [MTRDataTypeTestGlobalStruct new];
+ self.field1.name = AsString(decodableStruct.field1.name);
+ if (self.field1.name == nil) {
+ CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT;
+ return err;
+ }
+ if (decodableStruct.field1.myBitmap.IsNull()) {
+ self.field1.myBitmap = nil;
+ } else {
+ self.field1.myBitmap = [NSNumber numberWithUnsignedInt:decodableStruct.field1.myBitmap.Value().Raw()];
+ }
+ if (decodableStruct.field1.myEnum.HasValue()) {
+ if (decodableStruct.field1.myEnum.Value().IsNull()) {
+ self.field1.myEnum = nil;
+ } else {
+ self.field1.myEnum = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.field1.myEnum.Value().Value())];
+ }
+ } else {
+ self.field1.myEnum = nil;
+ }
+ }
+ {
+ self.field2 = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.field2)];
+ }
+ return CHIP_NO_ERROR;
+}
+
+@end
+
@implementation MTRUnitTestingClusterTestNullableOptionalRequestParams
- (instancetype)init
{
@@ -36028,6 +36226,10 @@
nonNullValue_0.f = static_cast<std::remove_reference_t<decltype(nonNullValue_0.f)>>(self.nullableStruct.f.unsignedCharValue);
nonNullValue_0.g = self.nullableStruct.g.floatValue;
nonNullValue_0.h = self.nullableStruct.h.doubleValue;
+ if (self.nullableStruct.i != nil) {
+ auto & definedValue_2 = nonNullValue_0.i.Emplace();
+ definedValue_2 = static_cast<std::remove_reference_t<decltype(definedValue_2)>>(self.nullableStruct.i.unsignedCharValue);
+ }
}
}
{
@@ -36041,6 +36243,10 @@
definedValue_0.f = static_cast<std::remove_reference_t<decltype(definedValue_0.f)>>(self.optionalStruct.f.unsignedCharValue);
definedValue_0.g = self.optionalStruct.g.floatValue;
definedValue_0.h = self.optionalStruct.h.doubleValue;
+ if (self.optionalStruct.i != nil) {
+ auto & definedValue_2 = definedValue_0.i.Emplace();
+ definedValue_2 = static_cast<std::remove_reference_t<decltype(definedValue_2)>>(self.optionalStruct.i.unsignedCharValue);
+ }
}
}
{
@@ -36058,6 +36264,10 @@
nonNullValue_1.f = static_cast<std::remove_reference_t<decltype(nonNullValue_1.f)>>(self.nullableOptionalStruct.f.unsignedCharValue);
nonNullValue_1.g = self.nullableOptionalStruct.g.floatValue;
nonNullValue_1.h = self.nullableOptionalStruct.h.doubleValue;
+ if (self.nullableOptionalStruct.i != nil) {
+ auto & definedValue_3 = nonNullValue_1.i.Emplace();
+ definedValue_3 = static_cast<std::remove_reference_t<decltype(definedValue_3)>>(self.nullableOptionalStruct.i.unsignedCharValue);
+ }
}
}
}
@@ -36251,6 +36461,10 @@
encodableStruct.arg1.f = static_cast<std::remove_reference_t<decltype(encodableStruct.arg1.f)>>(self.arg1.f.unsignedCharValue);
encodableStruct.arg1.g = self.arg1.g.floatValue;
encodableStruct.arg1.h = self.arg1.h.doubleValue;
+ if (self.arg1.i != nil) {
+ auto & definedValue_1 = encodableStruct.arg1.i.Emplace();
+ definedValue_1 = static_cast<std::remove_reference_t<decltype(definedValue_1)>>(self.arg1.i.unsignedCharValue);
+ }
}
auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0);
@@ -36908,6 +37122,106 @@
}
@end
+@implementation MTRUnitTestingClusterGlobalEchoRequestParams
+- (instancetype)init
+{
+ if (self = [super init]) {
+
+ _field1 = [MTRDataTypeTestGlobalStruct new];
+
+ _field2 = @(0);
+ _timedInvokeTimeoutMs = nil;
+ _serverSideProcessingTimeout = nil;
+ }
+ return self;
+}
+
+- (id)copyWithZone:(NSZone * _Nullable)zone;
+{
+ auto other = [[MTRUnitTestingClusterGlobalEchoRequestParams alloc] init];
+
+ other.field1 = self.field1;
+ other.field2 = self.field2;
+ other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs;
+ other.serverSideProcessingTimeout = self.serverSideProcessingTimeout;
+
+ return other;
+}
+
+- (NSString *)description
+{
+ NSString * descriptionString = [NSString stringWithFormat:@"<%@: field1:%@; field2:%@; >", NSStringFromClass([self class]), _field1, _field2];
+ return descriptionString;
+}
+
+@end
+
+@implementation MTRUnitTestingClusterGlobalEchoRequestParams (InternalMethods)
+
+- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader
+{
+ chip::app::Clusters::UnitTesting::Commands::GlobalEchoRequest::Type encodableStruct;
+ ListFreer listFreer;
+ {
+ encodableStruct.field1.name = AsCharSpan(self.field1.name);
+ if (self.field1.myBitmap == nil) {
+ encodableStruct.field1.myBitmap.SetNull();
+ } else {
+ auto & nonNullValue_1 = encodableStruct.field1.myBitmap.SetNonNull();
+ nonNullValue_1 = static_cast<std::remove_reference_t<decltype(nonNullValue_1)>>(self.field1.myBitmap.unsignedIntValue);
+ }
+ if (self.field1.myEnum != nil) {
+ auto & definedValue_1 = encodableStruct.field1.myEnum.Emplace();
+ if (self.field1.myEnum == nil) {
+ definedValue_1.SetNull();
+ } else {
+ auto & nonNullValue_2 = definedValue_1.SetNonNull();
+ nonNullValue_2 = static_cast<std::remove_reference_t<decltype(nonNullValue_2)>>(self.field1.myEnum.unsignedCharValue);
+ }
+ }
+ }
+ {
+ encodableStruct.field2 = static_cast<std::remove_reference_t<decltype(encodableStruct.field2)>>(self.field2.unsignedCharValue);
+ }
+
+ auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0);
+ if (buffer.IsNull()) {
+ return CHIP_ERROR_NO_MEMORY;
+ }
+
+ chip::System::PacketBufferTLVWriter writer;
+ // Commands never need chained buffers, since they cannot be chunked.
+ writer.Init(std::move(buffer), /* useChainedBuffers = */ false);
+
+ ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct));
+
+ ReturnErrorOnFailure(writer.Finalize(&buffer));
+
+ reader.Init(std::move(buffer));
+ return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag());
+}
+
+- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error
+{
+ chip::System::PacketBufferTLVReader reader;
+ CHIP_ERROR err = [self _encodeToTLVReader:reader];
+ if (err != CHIP_NO_ERROR) {
+ if (error) {
+ *error = [MTRError errorForCHIPErrorCode:err];
+ }
+ return nil;
+ }
+
+ auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader);
+ if (decodedObj == nil) {
+ if (error) {
+ *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE];
+ }
+ }
+ return decodedObj;
+}
+@end
+
@implementation MTRUnitTestingClusterTestDifferentVendorMeiRequestParams
- (instancetype)init
{
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h
index d3058d6..93191eb 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h
@@ -2266,6 +2266,12 @@
@end
+@interface MTRUnitTestingClusterGlobalEchoResponseParams (InternalMethods)
+
+- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTesting::Commands::GlobalEchoResponse::DecodableType &)decodableStruct;
+
+@end
+
@interface MTRUnitTestingClusterTestNullableOptionalRequestParams (InternalMethods)
- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error;
@@ -2326,6 +2332,12 @@
@end
+@interface MTRUnitTestingClusterGlobalEchoRequestParams (InternalMethods)
+
+- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error;
+
+@end
+
@interface MTRUnitTestingClusterTestDifferentVendorMeiRequestParams (InternalMethods)
- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error;
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm
index 4d70a00..821b8f6 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm
@@ -4637,6 +4637,11 @@
memberValue.f = [NSNumber numberWithUnsignedChar:cppValue.arg4.f.Raw()];
memberValue.g = [NSNumber numberWithFloat:cppValue.arg4.g];
memberValue.h = [NSNumber numberWithDouble:cppValue.arg4.h];
+ if (cppValue.arg4.i.HasValue()) {
+ memberValue.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.arg4.i.Value())];
+ } else {
+ memberValue.i = nil;
+ }
value.arg4 = memberValue;
} while (0);
do {
@@ -4661,6 +4666,11 @@
newElement_0.f = [NSNumber numberWithUnsignedChar:entry_0.f.Raw()];
newElement_0.g = [NSNumber numberWithFloat:entry_0.g];
newElement_0.h = [NSNumber numberWithDouble:entry_0.h];
+ if (entry_0.i.HasValue()) {
+ newElement_0.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.i.Value())];
+ } else {
+ newElement_0.i = nil;
+ }
[array_0 addObject:newElement_0];
}
CHIP_ERROR err = iter_0.GetStatus();
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h
index 3a11fc9..d73fc25 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h
@@ -2139,6 +2139,7 @@
@property (nonatomic, copy) NSNumber * _Nonnull f MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
@property (nonatomic, copy) NSNumber * _Nonnull g MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
@property (nonatomic, copy) NSNumber * _Nonnull h MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
+@property (nonatomic, copy) NSNumber * _Nullable i MTR_PROVISIONALLY_AVAILABLE;
@end
MTR_DEPRECATED("Please use MTRUnitTestingClusterSimpleStruct", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4))
@@ -2214,6 +2215,7 @@
@property (nonatomic, copy) NSNumber * _Nonnull a MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
@property (nonatomic, copy) NSNumber * _Nonnull b MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
@property (nonatomic, copy) MTRUnitTestingClusterSimpleStruct * _Nonnull c MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
+@property (nonatomic, copy) MTRDataTypeTestGlobalStruct * _Nullable d MTR_PROVISIONALLY_AVAILABLE;
@end
MTR_DEPRECATED("Please use MTRUnitTestingClusterNestedStruct", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4))
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm
index 94a6b90..632b706 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm
@@ -8825,6 +8825,8 @@
_g = @(0);
_h = @(0);
+
+ _i = nil;
}
return self;
}
@@ -8841,13 +8843,14 @@
other.f = self.f;
other.g = self.g;
other.h = self.h;
+ other.i = self.i;
return other;
}
- (NSString *)description
{
- NSString * descriptionString = [NSString stringWithFormat:@"<%@: a:%@; b:%@; c:%@; d:%@; e:%@; f:%@; g:%@; h:%@; >", NSStringFromClass([self class]), _a, _b, _c, [_d base64EncodedStringWithOptions:0], _e, _f, _g, _h];
+ NSString * descriptionString = [NSString stringWithFormat:@"<%@: a:%@; b:%@; c:%@; d:%@; e:%@; f:%@; g:%@; h:%@; i:%@; >", NSStringFromClass([self class]), _a, _b, _c, [_d base64EncodedStringWithOptions:0], _e, _f, _g, _h, _i];
return descriptionString;
}
@@ -9008,6 +9011,8 @@
_b = @(0);
_c = [MTRUnitTestingClusterSimpleStruct new];
+
+ _d = nil;
}
return self;
}
@@ -9019,13 +9024,14 @@
other.a = self.a;
other.b = self.b;
other.c = self.c;
+ other.d = self.d;
return other;
}
- (NSString *)description
{
- NSString * descriptionString = [NSString stringWithFormat:@"<%@: a:%@; b:%@; c:%@; >", NSStringFromClass([self class]), _a, _b, _c];
+ NSString * descriptionString = [NSString stringWithFormat:@"<%@: a:%@; b:%@; c:%@; d:%@; >", NSStringFromClass([self class]), _a, _b, _c, _d];
return descriptionString;
}
diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp
index 1ba5546..ca6df3d 100644
--- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp
+++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp
@@ -46078,6 +46078,53 @@
} // namespace TimedWriteBoolean
+namespace GlobalEnum {
+
+Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum * value)
+{
+ using Traits = NumericAttributeTraits<chip::app::Clusters::Globals::TestGlobalEnum>;
+ Traits::StorageType temp;
+ uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
+ Protocols::InteractionModel::Status status =
+ emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
+ VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
+ if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
+ {
+ return Protocols::InteractionModel::Status::ConstraintError;
+ }
+ *value = Traits::StorageToWorking(temp);
+ return status;
+}
+
+Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum value,
+ MarkAttributeDirty markDirty)
+{
+ using Traits = NumericAttributeTraits<chip::app::Clusters::Globals::TestGlobalEnum>;
+ if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
+ {
+ return Protocols::InteractionModel::Status::ConstraintError;
+ }
+ Traits::StorageType storageValue;
+ Traits::WorkingToStorage(value, storageValue);
+ uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
+ return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE, markDirty);
+}
+
+Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum value)
+{
+ using Traits = NumericAttributeTraits<chip::app::Clusters::Globals::TestGlobalEnum>;
+ if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
+ {
+ return Protocols::InteractionModel::Status::ConstraintError;
+ }
+ Traits::StorageType storageValue;
+ Traits::WorkingToStorage(value, storageValue);
+ uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
+ return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
+}
+
+} // namespace GlobalEnum
+
namespace Unsupported {
Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, bool * value)
@@ -49016,6 +49063,98 @@
} // namespace WriteOnlyInt8u
+namespace NullableGlobalEnum {
+
+Protocols::InteractionModel::Status Get(chip::EndpointId endpoint,
+ DataModel::Nullable<chip::app::Clusters::Globals::TestGlobalEnum> & value)
+{
+ using Traits = NumericAttributeTraits<chip::app::Clusters::Globals::TestGlobalEnum>;
+ Traits::StorageType temp;
+ uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
+ Protocols::InteractionModel::Status status =
+ emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
+ VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
+ if (Traits::IsNullValue(temp))
+ {
+ value.SetNull();
+ }
+ else
+ {
+ value.SetNonNull() = Traits::StorageToWorking(temp);
+ }
+ return status;
+}
+
+Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum value,
+ MarkAttributeDirty markDirty)
+{
+ using Traits = NumericAttributeTraits<chip::app::Clusters::Globals::TestGlobalEnum>;
+ if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
+ {
+ return Protocols::InteractionModel::Status::ConstraintError;
+ }
+ Traits::StorageType storageValue;
+ Traits::WorkingToStorage(value, storageValue);
+ uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
+ return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE, markDirty);
+}
+
+Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum value)
+{
+ using Traits = NumericAttributeTraits<chip::app::Clusters::Globals::TestGlobalEnum>;
+ if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
+ {
+ return Protocols::InteractionModel::Status::ConstraintError;
+ }
+ Traits::StorageType storageValue;
+ Traits::WorkingToStorage(value, storageValue);
+ uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
+ return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
+}
+
+Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty)
+{
+ using Traits = NumericAttributeTraits<chip::app::Clusters::Globals::TestGlobalEnum>;
+ Traits::StorageType value;
+ Traits::SetNull(value);
+ uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
+ return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE, markDirty);
+}
+
+Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint)
+{
+ using Traits = NumericAttributeTraits<chip::app::Clusters::Globals::TestGlobalEnum>;
+ Traits::StorageType value;
+ Traits::SetNull(value);
+ uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
+ return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
+}
+
+Protocols::InteractionModel::Status Set(chip::EndpointId endpoint,
+ const chip::app::DataModel::Nullable<chip::app::Clusters::Globals::TestGlobalEnum> & value,
+ MarkAttributeDirty markDirty)
+{
+ if (value.IsNull())
+ {
+ return SetNull(endpoint, markDirty);
+ }
+
+ return Set(endpoint, value.Value(), markDirty);
+}
+
+Protocols::InteractionModel::Status Set(chip::EndpointId endpoint,
+ const chip::app::DataModel::Nullable<chip::app::Clusters::Globals::TestGlobalEnum> & value)
+{
+ if (value.IsNull())
+ {
+ return SetNull(endpoint);
+ }
+
+ return Set(endpoint, value.Value());
+}
+
+} // namespace NullableGlobalEnum
+
namespace FeatureMap {
Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value)
diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h
index 53e24c0..ea344fc 100644
--- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h
+++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h
@@ -6957,6 +6957,14 @@
Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value, MarkAttributeDirty markDirty);
} // namespace TimedWriteBoolean
+namespace GlobalEnum {
+Protocols::InteractionModel::Status Get(chip::EndpointId endpoint,
+ chip::app::Clusters::Globals::TestGlobalEnum * value); // TestGlobalEnum
+Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum value);
+Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum value,
+ MarkAttributeDirty markDirty);
+} // namespace GlobalEnum
+
namespace Unsupported {
Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, bool * value); // boolean
Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value);
@@ -7362,6 +7370,21 @@
Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty);
} // namespace WriteOnlyInt8u
+namespace NullableGlobalEnum {
+Protocols::InteractionModel::Status
+Get(chip::EndpointId endpoint, DataModel::Nullable<chip::app::Clusters::Globals::TestGlobalEnum> & value); // TestGlobalEnum
+Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum value);
+Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum value,
+ MarkAttributeDirty markDirty);
+Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint);
+Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty);
+Protocols::InteractionModel::Status Set(chip::EndpointId endpoint,
+ const chip::app::DataModel::Nullable<chip::app::Clusters::Globals::TestGlobalEnum> & value);
+Protocols::InteractionModel::Status Set(chip::EndpointId endpoint,
+ const chip::app::DataModel::Nullable<chip::app::Clusters::Globals::TestGlobalEnum> & value,
+ MarkAttributeDirty markDirty);
+} // namespace NullableGlobalEnum
+
namespace FeatureMap {
Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32
Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value);
diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h
index 60cdf13..d1f11db 100644
--- a/zzz_generated/app-common/app-common/zap-generated/callback.h
+++ b/zzz_generated/app-common/app-common/zap-generated/callback.h
@@ -6930,6 +6930,12 @@
chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
const chip::app::Clusters::UnitTesting::Commands::StringEchoRequest::DecodableType & commandData);
/**
+ * @brief Unit Testing Cluster GlobalEchoRequest Command callback (from client)
+ */
+bool emberAfUnitTestingClusterGlobalEchoRequestCallback(
+ chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
+ const chip::app::Clusters::UnitTesting::Commands::GlobalEchoRequest::DecodableType & commandData);
+/**
* @brief Unit Testing Cluster TestDifferentVendorMeiRequest Command callback (from client)
*/
bool emberAfUnitTestingClusterTestDifferentVendorMeiRequestCallback(
diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp
index af49e06..f206178 100644
--- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp
+++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp
@@ -29391,6 +29391,7 @@
encoder.Encode(to_underlying(Fields::kF), f);
encoder.Encode(to_underlying(Fields::kG), g);
encoder.Encode(to_underlying(Fields::kH), h);
+ encoder.Encode(to_underlying(Fields::kI), i);
return encoder.Finalize();
}
@@ -29440,6 +29441,10 @@
{
err = DataModel::Decode(reader, h);
}
+ else if (__context_tag == to_underlying(Fields::kI))
+ {
+ err = DataModel::Decode(reader, i);
+ }
else
{
}
@@ -29657,6 +29662,7 @@
encoder.Encode(to_underlying(Fields::kA), a);
encoder.Encode(to_underlying(Fields::kB), b);
encoder.Encode(to_underlying(Fields::kC), c);
+ encoder.Encode(to_underlying(Fields::kD), d);
return encoder.Finalize();
}
@@ -29686,6 +29692,10 @@
{
err = DataModel::Decode(reader, c);
}
+ else if (__context_tag == to_underlying(Fields::kD))
+ {
+ err = DataModel::Decode(reader, d);
+ }
else
{
}
@@ -30986,6 +30996,45 @@
}
}
} // namespace TestEnumsRequest.
+namespace GlobalEchoResponse {
+CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
+{
+ DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
+ encoder.Encode(to_underlying(Fields::kField1), field1);
+ encoder.Encode(to_underlying(Fields::kField2), field2);
+ return encoder.Finalize();
+}
+
+CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
+{
+ detail::StructDecodeIterator __iterator(reader);
+ while (true)
+ {
+ auto __element = __iterator.Next();
+ if (std::holds_alternative<CHIP_ERROR>(__element))
+ {
+ return std::get<CHIP_ERROR>(__element);
+ }
+
+ CHIP_ERROR err = CHIP_NO_ERROR;
+ const uint8_t __context_tag = std::get<uint8_t>(__element);
+
+ if (__context_tag == to_underlying(Fields::kField1))
+ {
+ err = DataModel::Decode(reader, field1);
+ }
+ else if (__context_tag == to_underlying(Fields::kField2))
+ {
+ err = DataModel::Decode(reader, field2);
+ }
+ else
+ {
+ }
+
+ ReturnErrorOnFailure(err);
+ }
+}
+} // namespace GlobalEchoResponse.
namespace TestNullableOptionalRequest {
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
{
@@ -31397,6 +31446,45 @@
}
}
} // namespace StringEchoRequest.
+namespace GlobalEchoRequest {
+CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
+{
+ DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
+ encoder.Encode(to_underlying(Fields::kField1), field1);
+ encoder.Encode(to_underlying(Fields::kField2), field2);
+ return encoder.Finalize();
+}
+
+CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
+{
+ detail::StructDecodeIterator __iterator(reader);
+ while (true)
+ {
+ auto __element = __iterator.Next();
+ if (std::holds_alternative<CHIP_ERROR>(__element))
+ {
+ return std::get<CHIP_ERROR>(__element);
+ }
+
+ CHIP_ERROR err = CHIP_NO_ERROR;
+ const uint8_t __context_tag = std::get<uint8_t>(__element);
+
+ if (__context_tag == to_underlying(Fields::kField1))
+ {
+ err = DataModel::Decode(reader, field1);
+ }
+ else if (__context_tag == to_underlying(Fields::kField2))
+ {
+ err = DataModel::Decode(reader, field2);
+ }
+ else
+ {
+ }
+
+ ReturnErrorOnFailure(err);
+ }
+}
+} // namespace GlobalEchoRequest.
namespace TestDifferentVendorMeiRequest {
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
{
@@ -31571,6 +31659,10 @@
return DataModel::Decode(reader, generalErrorBoolean);
case Attributes::ClusterErrorBoolean::TypeInfo::GetAttributeId():
return DataModel::Decode(reader, clusterErrorBoolean);
+ case Attributes::GlobalEnum::TypeInfo::GetAttributeId():
+ return DataModel::Decode(reader, globalEnum);
+ case Attributes::GlobalStruct::TypeInfo::GetAttributeId():
+ return DataModel::Decode(reader, globalStruct);
case Attributes::Unsupported::TypeInfo::GetAttributeId():
return DataModel::Decode(reader, unsupported);
case Attributes::NullableBoolean::TypeInfo::GetAttributeId():
@@ -31641,6 +31733,10 @@
return DataModel::Decode(reader, nullableRangeRestrictedInt16s);
case Attributes::WriteOnlyInt8u::TypeInfo::GetAttributeId():
return DataModel::Decode(reader, writeOnlyInt8u);
+ case Attributes::NullableGlobalEnum::TypeInfo::GetAttributeId():
+ return DataModel::Decode(reader, nullableGlobalEnum);
+ case Attributes::NullableGlobalStruct::TypeInfo::GetAttributeId():
+ return DataModel::Decode(reader, nullableGlobalStruct);
case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId():
return DataModel::Decode(reader, generatedCommandList);
case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId():
diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h
index 25ded74..719c1de 100644
--- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h
+++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h
@@ -44013,6 +44013,7 @@
kF = 5,
kG = 6,
kH = 7,
+ kI = 8,
};
struct Type
@@ -44026,6 +44027,7 @@
chip::BitMask<SimpleBitmap> f = static_cast<chip::BitMask<SimpleBitmap>>(0);
float g = static_cast<float>(0);
double h = static_cast<double>(0);
+ Optional<Globals::TestGlobalEnum> i;
CHIP_ERROR Decode(TLV::TLVReader & reader);
@@ -44163,6 +44165,7 @@
kA = 0,
kB = 1,
kC = 2,
+ kD = 3,
};
struct Type
@@ -44171,6 +44174,7 @@
uint8_t a = static_cast<uint8_t>(0);
bool b = static_cast<bool>(0);
Structs::SimpleStruct::Type c;
+ Optional<Globals::Structs::TestGlobalStruct::Type> d;
CHIP_ERROR Decode(TLV::TLVReader & reader);
@@ -44427,6 +44431,11 @@
struct DecodableType;
} // namespace TestEnumsRequest
+namespace GlobalEchoResponse {
+struct Type;
+struct DecodableType;
+} // namespace GlobalEchoResponse
+
namespace TestNullableOptionalRequest {
struct Type;
struct DecodableType;
@@ -44477,6 +44486,11 @@
struct DecodableType;
} // namespace StringEchoRequest
+namespace GlobalEchoRequest {
+struct Type;
+struct DecodableType;
+} // namespace GlobalEchoRequest
+
namespace TestDifferentVendorMeiRequest {
struct Type;
struct DecodableType;
@@ -45531,6 +45545,41 @@
CHIP_ERROR Decode(TLV::TLVReader & reader);
};
}; // namespace TestEnumsRequest
+namespace GlobalEchoResponse {
+enum class Fields : uint8_t
+{
+ kField1 = 0,
+ kField2 = 1,
+};
+
+struct Type
+{
+public:
+ // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
+ static constexpr CommandId GetCommandId() { return Commands::GlobalEchoResponse::Id; }
+ static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; }
+
+ Globals::Structs::TestGlobalStruct::Type field1;
+ Globals::TestGlobalEnum field2 = static_cast<Globals::TestGlobalEnum>(0);
+
+ CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
+
+ using ResponseType = DataModel::NullObjectType;
+
+ static constexpr bool MustUseTimedInvoke() { return false; }
+};
+
+struct DecodableType
+{
+public:
+ static constexpr CommandId GetCommandId() { return Commands::GlobalEchoResponse::Id; }
+ static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; }
+
+ Globals::Structs::TestGlobalStruct::DecodableType field1;
+ Globals::TestGlobalEnum field2 = static_cast<Globals::TestGlobalEnum>(0);
+ CHIP_ERROR Decode(TLV::TLVReader & reader);
+};
+}; // namespace GlobalEchoResponse
namespace TestNullableOptionalRequest {
enum class Fields : uint8_t
{
@@ -45898,6 +45947,41 @@
CHIP_ERROR Decode(TLV::TLVReader & reader);
};
}; // namespace StringEchoRequest
+namespace GlobalEchoRequest {
+enum class Fields : uint8_t
+{
+ kField1 = 0,
+ kField2 = 1,
+};
+
+struct Type
+{
+public:
+ // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
+ static constexpr CommandId GetCommandId() { return Commands::GlobalEchoRequest::Id; }
+ static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; }
+
+ Globals::Structs::TestGlobalStruct::Type field1;
+ Globals::TestGlobalEnum field2 = static_cast<Globals::TestGlobalEnum>(0);
+
+ CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
+
+ using ResponseType = Clusters::UnitTesting::Commands::GlobalEchoResponse::DecodableType;
+
+ static constexpr bool MustUseTimedInvoke() { return false; }
+};
+
+struct DecodableType
+{
+public:
+ static constexpr CommandId GetCommandId() { return Commands::GlobalEchoRequest::Id; }
+ static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; }
+
+ Globals::Structs::TestGlobalStruct::DecodableType field1;
+ Globals::TestGlobalEnum field2 = static_cast<Globals::TestGlobalEnum>(0);
+ CHIP_ERROR Decode(TLV::TLVReader & reader);
+};
+}; // namespace GlobalEchoRequest
namespace TestDifferentVendorMeiRequest {
enum class Fields : uint8_t
{
@@ -46543,6 +46627,30 @@
static constexpr bool MustUseTimedWrite() { return false; }
};
} // namespace ClusterErrorBoolean
+namespace GlobalEnum {
+struct TypeInfo
+{
+ using Type = chip::app::Clusters::Globals::TestGlobalEnum;
+ using DecodableType = chip::app::Clusters::Globals::TestGlobalEnum;
+ using DecodableArgType = chip::app::Clusters::Globals::TestGlobalEnum;
+
+ static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; }
+ static constexpr AttributeId GetAttributeId() { return Attributes::GlobalEnum::Id; }
+ static constexpr bool MustUseTimedWrite() { return false; }
+};
+} // namespace GlobalEnum
+namespace GlobalStruct {
+struct TypeInfo
+{
+ using Type = chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type;
+ using DecodableType = chip::app::Clusters::Globals::Structs::TestGlobalStruct::DecodableType;
+ using DecodableArgType = const chip::app::Clusters::Globals::Structs::TestGlobalStruct::DecodableType &;
+
+ static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; }
+ static constexpr AttributeId GetAttributeId() { return Attributes::GlobalStruct::Id; }
+ static constexpr bool MustUseTimedWrite() { return false; }
+};
+} // namespace GlobalStruct
namespace Unsupported {
struct TypeInfo
{
@@ -46970,6 +47078,31 @@
static constexpr bool MustUseTimedWrite() { return false; }
};
} // namespace WriteOnlyInt8u
+namespace NullableGlobalEnum {
+struct TypeInfo
+{
+ using Type = chip::app::DataModel::Nullable<chip::app::Clusters::Globals::TestGlobalEnum>;
+ using DecodableType = chip::app::DataModel::Nullable<chip::app::Clusters::Globals::TestGlobalEnum>;
+ using DecodableArgType = const chip::app::DataModel::Nullable<chip::app::Clusters::Globals::TestGlobalEnum> &;
+
+ static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; }
+ static constexpr AttributeId GetAttributeId() { return Attributes::NullableGlobalEnum::Id; }
+ static constexpr bool MustUseTimedWrite() { return false; }
+};
+} // namespace NullableGlobalEnum
+namespace NullableGlobalStruct {
+struct TypeInfo
+{
+ using Type = chip::app::DataModel::Nullable<chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type>;
+ using DecodableType = chip::app::DataModel::Nullable<chip::app::Clusters::Globals::Structs::TestGlobalStruct::DecodableType>;
+ using DecodableArgType =
+ const chip::app::DataModel::Nullable<chip::app::Clusters::Globals::Structs::TestGlobalStruct::DecodableType> &;
+
+ static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; }
+ static constexpr AttributeId GetAttributeId() { return Attributes::NullableGlobalStruct::Id; }
+ static constexpr bool MustUseTimedWrite() { return false; }
+};
+} // namespace NullableGlobalStruct
namespace GeneratedCommandList {
struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo
{
@@ -47078,7 +47211,9 @@
Attributes::TimedWriteBoolean::TypeInfo::DecodableType timedWriteBoolean = static_cast<bool>(0);
Attributes::GeneralErrorBoolean::TypeInfo::DecodableType generalErrorBoolean = static_cast<bool>(0);
Attributes::ClusterErrorBoolean::TypeInfo::DecodableType clusterErrorBoolean = static_cast<bool>(0);
- Attributes::Unsupported::TypeInfo::DecodableType unsupported = static_cast<bool>(0);
+ Attributes::GlobalEnum::TypeInfo::DecodableType globalEnum = static_cast<chip::app::Clusters::Globals::TestGlobalEnum>(0);
+ Attributes::GlobalStruct::TypeInfo::DecodableType globalStruct;
+ Attributes::Unsupported::TypeInfo::DecodableType unsupported = static_cast<bool>(0);
Attributes::NullableBoolean::TypeInfo::DecodableType nullableBoolean;
Attributes::NullableBitmap8::TypeInfo::DecodableType nullableBitmap8;
Attributes::NullableBitmap16::TypeInfo::DecodableType nullableBitmap16;
@@ -47113,6 +47248,8 @@
Attributes::NullableRangeRestrictedInt16u::TypeInfo::DecodableType nullableRangeRestrictedInt16u;
Attributes::NullableRangeRestrictedInt16s::TypeInfo::DecodableType nullableRangeRestrictedInt16s;
Attributes::WriteOnlyInt8u::TypeInfo::DecodableType writeOnlyInt8u = static_cast<uint8_t>(0);
+ Attributes::NullableGlobalEnum::TypeInfo::DecodableType nullableGlobalEnum;
+ Attributes::NullableGlobalStruct::TypeInfo::DecodableType nullableGlobalStruct;
Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList;
Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList;
Attributes::EventList::TypeInfo::DecodableType eventList;
diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h
index 0a144da..5deab64 100644
--- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h
+++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h
@@ -8296,6 +8296,14 @@
static constexpr AttributeId Id = 0x00000032;
} // namespace ClusterErrorBoolean
+namespace GlobalEnum {
+static constexpr AttributeId Id = 0x00000033;
+} // namespace GlobalEnum
+
+namespace GlobalStruct {
+static constexpr AttributeId Id = 0x00000034;
+} // namespace GlobalStruct
+
namespace Unsupported {
static constexpr AttributeId Id = 0x000000FF;
} // namespace Unsupported
@@ -8436,6 +8444,14 @@
static constexpr AttributeId Id = 0x0000402A;
} // namespace WriteOnlyInt8u
+namespace NullableGlobalEnum {
+static constexpr AttributeId Id = 0x00004033;
+} // namespace NullableGlobalEnum
+
+namespace NullableGlobalStruct {
+static constexpr AttributeId Id = 0x00004034;
+} // namespace NullableGlobalStruct
+
namespace GeneratedCommandList {
static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id;
} // namespace GeneratedCommandList
diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h
index 68b11f1..e921063 100644
--- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h
+++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h
@@ -1980,6 +1980,10 @@
static constexpr CommandId Id = 0x0000000E;
} // namespace TestEnumsRequest
+namespace GlobalEchoResponse {
+static constexpr CommandId Id = 0x0000000E;
+} // namespace GlobalEchoResponse
+
namespace TestNullableOptionalRequest {
static constexpr CommandId Id = 0x0000000F;
} // namespace TestNullableOptionalRequest
@@ -2020,6 +2024,10 @@
static constexpr CommandId Id = 0x00000018;
} // namespace StringEchoRequest
+namespace GlobalEchoRequest {
+static constexpr CommandId Id = 0x00000019;
+} // namespace GlobalEchoRequest
+
namespace TestDifferentVendorMeiRequest {
static constexpr CommandId Id = 0xFFF200AA;
} // namespace TestDifferentVendorMeiRequest
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h
index 9367f84..a48a4b5 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h
+++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h
@@ -14243,6 +14243,7 @@
| * TestBatchHelperRequest | 0x16 |
| * TestSecondBatchHelperRequest | 0x17 |
| * StringEchoRequest | 0x18 |
+| * GlobalEchoRequest | 0x19 |
| * TestDifferentVendorMeiRequest | 0xFFF200AA|
|------------------------------------------------------------------------------|
| Attributes: | |
@@ -14293,6 +14294,8 @@
| * TimedWriteBoolean | 0x0030 |
| * GeneralErrorBoolean | 0x0031 |
| * ClusterErrorBoolean | 0x0032 |
+| * GlobalEnum | 0x0033 |
+| * GlobalStruct | 0x0034 |
| * Unsupported | 0x00FF |
| * NullableBoolean | 0x4000 |
| * NullableBitmap8 | 0x4001 |
@@ -14328,6 +14331,8 @@
| * NullableRangeRestrictedInt16u | 0x4028 |
| * NullableRangeRestrictedInt16s | 0x4029 |
| * WriteOnlyInt8u | 0x402A |
+| * NullableGlobalEnum | 0x4033 |
+| * NullableGlobalStruct | 0x4034 |
| * GeneratedCommandList | 0xFFF8 |
| * AcceptedCommandList | 0xFFF9 |
| * EventList | 0xFFFA |
@@ -15345,6 +15350,46 @@
};
/*
+ * Command GlobalEchoRequest
+ */
+class UnitTestingGlobalEchoRequest : public ClusterCommand
+{
+public:
+ UnitTestingGlobalEchoRequest(CredentialIssuerCommands * credsIssuerConfig) :
+ ClusterCommand("global-echo-request", credsIssuerConfig), mComplex_Field1(&mRequest.field1)
+ {
+ AddArgument("Field1", &mComplex_Field1);
+ AddArgument("Field2", 0, UINT8_MAX, &mRequest.field2);
+ ClusterCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector<chip::EndpointId> endpointIds) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::CommandId commandId = chip::app::Clusters::UnitTesting::Commands::GlobalEchoRequest::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId,
+ commandId, endpointIds.at(0));
+ return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest);
+ }
+
+ CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::CommandId commandId = chip::app::Clusters::UnitTesting::Commands::GlobalEchoRequest::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId,
+ groupId);
+
+ return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest);
+ }
+
+private:
+ chip::app::Clusters::UnitTesting::Commands::GlobalEchoRequest::Type mRequest;
+ TypedComplexArgument<chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type> mComplex_Field1;
+};
+
+/*
* Command TestDifferentVendorMeiRequest
*/
class UnitTestingTestDifferentVendorMeiRequest : public ClusterCommand
@@ -27673,6 +27718,7 @@
make_unique<UnitTestingTestBatchHelperRequest>(credsIssuerConfig), //
make_unique<UnitTestingTestSecondBatchHelperRequest>(credsIssuerConfig), //
make_unique<UnitTestingStringEchoRequest>(credsIssuerConfig), //
+ make_unique<UnitTestingGlobalEchoRequest>(credsIssuerConfig), //
make_unique<UnitTestingTestDifferentVendorMeiRequest>(credsIssuerConfig), //
//
// Attributes
@@ -27726,6 +27772,8 @@
make_unique<ReadAttribute>(Id, "timed-write-boolean", Attributes::TimedWriteBoolean::Id, credsIssuerConfig), //
make_unique<ReadAttribute>(Id, "general-error-boolean", Attributes::GeneralErrorBoolean::Id, credsIssuerConfig), //
make_unique<ReadAttribute>(Id, "cluster-error-boolean", Attributes::ClusterErrorBoolean::Id, credsIssuerConfig), //
+ make_unique<ReadAttribute>(Id, "global-enum", Attributes::GlobalEnum::Id, credsIssuerConfig), //
+ make_unique<ReadAttribute>(Id, "global-struct", Attributes::GlobalStruct::Id, credsIssuerConfig), //
make_unique<ReadAttribute>(Id, "unsupported", Attributes::Unsupported::Id, credsIssuerConfig), //
make_unique<ReadAttribute>(Id, "nullable-boolean", Attributes::NullableBoolean::Id, credsIssuerConfig), //
make_unique<ReadAttribute>(Id, "nullable-bitmap8", Attributes::NullableBitmap8::Id, credsIssuerConfig), //
@@ -27765,6 +27813,8 @@
make_unique<ReadAttribute>(Id, "nullable-range-restricted-int16s", Attributes::NullableRangeRestrictedInt16s::Id,
credsIssuerConfig), //
make_unique<ReadAttribute>(Id, "write-only-int8u", Attributes::WriteOnlyInt8u::Id, credsIssuerConfig), //
+ make_unique<ReadAttribute>(Id, "nullable-global-enum", Attributes::NullableGlobalEnum::Id, credsIssuerConfig), //
+ make_unique<ReadAttribute>(Id, "nullable-global-struct", Attributes::NullableGlobalStruct::Id, credsIssuerConfig), //
make_unique<ReadAttribute>(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), //
make_unique<ReadAttribute>(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), //
make_unique<ReadAttribute>(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), //
@@ -27873,6 +27923,10 @@
WriteCommandType::kWrite, credsIssuerConfig), //
make_unique<WriteAttribute<bool>>(Id, "cluster-error-boolean", 0, 1, Attributes::ClusterErrorBoolean::Id,
WriteCommandType::kWrite, credsIssuerConfig), //
+ make_unique<WriteAttribute<chip::app::Clusters::Globals::TestGlobalEnum>>(
+ Id, "global-enum", 0, UINT8_MAX, Attributes::GlobalEnum::Id, WriteCommandType::kWrite, credsIssuerConfig), //
+ make_unique<WriteAttributeAsComplex<chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type>>(
+ Id, "global-struct", Attributes::GlobalStruct::Id, WriteCommandType::kWrite, credsIssuerConfig), //
make_unique<WriteAttribute<bool>>(Id, "unsupported", 0, 1, Attributes::Unsupported::Id, WriteCommandType::kWrite,
credsIssuerConfig), //
make_unique<WriteAttribute<chip::app::DataModel::Nullable<bool>>>(
@@ -27966,6 +28020,12 @@
WriteCommandType::kWrite, credsIssuerConfig), //
make_unique<WriteAttribute<uint8_t>>(Id, "write-only-int8u", 0, UINT8_MAX, Attributes::WriteOnlyInt8u::Id,
WriteCommandType::kWrite, credsIssuerConfig), //
+ make_unique<WriteAttribute<chip::app::DataModel::Nullable<chip::app::Clusters::Globals::TestGlobalEnum>>>(
+ Id, "nullable-global-enum", 0, UINT8_MAX, Attributes::NullableGlobalEnum::Id, WriteCommandType::kWrite,
+ credsIssuerConfig), //
+ make_unique<
+ WriteAttributeAsComplex<chip::app::DataModel::Nullable<chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type>>>(
+ Id, "nullable-global-struct", Attributes::NullableGlobalStruct::Id, WriteCommandType::kWrite, credsIssuerConfig), //
make_unique<WriteAttributeAsComplex<chip::app::DataModel::List<const chip::CommandId>>>(
Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite,
credsIssuerConfig), //
@@ -28031,6 +28091,8 @@
make_unique<SubscribeAttribute>(Id, "timed-write-boolean", Attributes::TimedWriteBoolean::Id, credsIssuerConfig), //
make_unique<SubscribeAttribute>(Id, "general-error-boolean", Attributes::GeneralErrorBoolean::Id, credsIssuerConfig), //
make_unique<SubscribeAttribute>(Id, "cluster-error-boolean", Attributes::ClusterErrorBoolean::Id, credsIssuerConfig), //
+ make_unique<SubscribeAttribute>(Id, "global-enum", Attributes::GlobalEnum::Id, credsIssuerConfig), //
+ make_unique<SubscribeAttribute>(Id, "global-struct", Attributes::GlobalStruct::Id, credsIssuerConfig), //
make_unique<SubscribeAttribute>(Id, "unsupported", Attributes::Unsupported::Id, credsIssuerConfig), //
make_unique<SubscribeAttribute>(Id, "nullable-boolean", Attributes::NullableBoolean::Id, credsIssuerConfig), //
make_unique<SubscribeAttribute>(Id, "nullable-bitmap8", Attributes::NullableBitmap8::Id, credsIssuerConfig), //
@@ -28070,6 +28132,8 @@
make_unique<SubscribeAttribute>(Id, "nullable-range-restricted-int16s", Attributes::NullableRangeRestrictedInt16s::Id,
credsIssuerConfig), //
make_unique<SubscribeAttribute>(Id, "write-only-int8u", Attributes::WriteOnlyInt8u::Id, credsIssuerConfig), //
+ make_unique<SubscribeAttribute>(Id, "nullable-global-enum", Attributes::NullableGlobalEnum::Id, credsIssuerConfig), //
+ make_unique<SubscribeAttribute>(Id, "nullable-global-struct", Attributes::NullableGlobalStruct::Id, credsIssuerConfig), //
make_unique<SubscribeAttribute>(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), //
make_unique<SubscribeAttribute>(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), //
make_unique<SubscribeAttribute>(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), //
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp
index 3b958cf..8a97664 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp
+++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp
@@ -19,6 +19,44 @@
#include <commands/clusters/ComplexArgument.h>
+CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type & request,
+ Json::Value & value)
+{
+ VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT);
+
+ // Copy to track which members we already processed.
+ Json::Value valueCopy(value);
+
+ ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TestGlobalStruct.name", "name", value.isMember("name")));
+ ReturnErrorOnFailure(
+ ComplexArgumentParser::EnsureMemberExist("TestGlobalStruct.myBitmap", "myBitmap", value.isMember("myBitmap")));
+
+ char labelWithMember[kMaxLabelLength];
+ snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "name");
+ ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.name, value["name"]));
+ valueCopy.removeMember("name");
+
+ snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "myBitmap");
+ ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.myBitmap, value["myBitmap"]));
+ valueCopy.removeMember("myBitmap");
+
+ if (value.isMember("myEnum"))
+ {
+ snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "myEnum");
+ ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.myEnum, value["myEnum"]));
+ }
+ valueCopy.removeMember("myEnum");
+
+ return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy);
+}
+
+void ComplexArgumentParser::Finalize(chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type & request)
+{
+ ComplexArgumentParser::Finalize(request.name);
+ ComplexArgumentParser::Finalize(request.myBitmap);
+ ComplexArgumentParser::Finalize(request.myEnum);
+}
+
CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::ModeTagStruct::Type & request,
Json::Value & value)
{
@@ -423,44 +461,6 @@
ComplexArgumentParser::Finalize(request.operationalStateLabel);
}
-CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type & request,
- Json::Value & value)
-{
- VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT);
-
- // Copy to track which members we already processed.
- Json::Value valueCopy(value);
-
- ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TestGlobalStruct.name", "name", value.isMember("name")));
- ReturnErrorOnFailure(
- ComplexArgumentParser::EnsureMemberExist("TestGlobalStruct.myBitmap", "myBitmap", value.isMember("myBitmap")));
-
- char labelWithMember[kMaxLabelLength];
- snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "name");
- ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.name, value["name"]));
- valueCopy.removeMember("name");
-
- snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "myBitmap");
- ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.myBitmap, value["myBitmap"]));
- valueCopy.removeMember("myBitmap");
-
- if (value.isMember("myEnum"))
- {
- snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "myEnum");
- ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.myEnum, value["myEnum"]));
- }
- valueCopy.removeMember("myEnum");
-
- return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy);
-}
-
-void ComplexArgumentParser::Finalize(chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type & request)
-{
- ComplexArgumentParser::Finalize(request.name);
- ComplexArgumentParser::Finalize(request.myBitmap);
- ComplexArgumentParser::Finalize(request.myEnum);
-}
-
CHIP_ERROR ComplexArgumentParser::Setup(const char * label,
chip::app::Clusters::Descriptor::Structs::SemanticTagStruct::Type & request,
Json::Value & value)
@@ -5739,6 +5739,13 @@
ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.h, value["h"]));
valueCopy.removeMember("h");
+ if (value.isMember("i"))
+ {
+ snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "i");
+ ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.i, value["i"]));
+ }
+ valueCopy.removeMember("i");
+
return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy);
}
@@ -5752,6 +5759,7 @@
ComplexArgumentParser::Finalize(request.f);
ComplexArgumentParser::Finalize(request.g);
ComplexArgumentParser::Finalize(request.h);
+ ComplexArgumentParser::Finalize(request.i);
}
CHIP_ERROR ComplexArgumentParser::Setup(const char * label,
@@ -5978,6 +5986,13 @@
ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.c, value["c"]));
valueCopy.removeMember("c");
+ if (value.isMember("d"))
+ {
+ snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "d");
+ ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.d, value["d"]));
+ }
+ valueCopy.removeMember("d");
+
return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy);
}
@@ -5986,6 +6001,7 @@
ComplexArgumentParser::Finalize(request.a);
ComplexArgumentParser::Finalize(request.b);
ComplexArgumentParser::Finalize(request.c);
+ ComplexArgumentParser::Finalize(request.d);
}
CHIP_ERROR ComplexArgumentParser::Setup(const char * label,
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h
index 47683b1..5bb0718 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h
+++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h
@@ -22,6 +22,11 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <lib/core/CHIPError.h>
+static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type & request,
+ Json::Value & value);
+
+static void Finalize(chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type & request);
+
static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::ModeTagStruct::Type & request,
Json::Value & value);
@@ -71,11 +76,6 @@
static void Finalize(chip::app::Clusters::detail::Structs::OperationalStateStruct::Type & request);
-static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type & request,
- Json::Value & value);
-
-static void Finalize(chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type & request);
-
static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Descriptor::Structs::SemanticTagStruct::Type & request,
Json::Value & value);
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
index fb156de..7fe1851 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
+++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
@@ -22,6 +22,39 @@
using namespace chip::app::Clusters;
CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
+ const chip::app::Clusters::Globals::Structs::TestGlobalStruct::DecodableType & value)
+{
+ DataModelLogger::LogString(label, indent, "{");
+ {
+ CHIP_ERROR err = LogValue("Name", indent + 1, value.name);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Name'");
+ return err;
+ }
+ }
+ {
+ CHIP_ERROR err = LogValue("MyBitmap", indent + 1, value.myBitmap);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MyBitmap'");
+ return err;
+ }
+ }
+ {
+ CHIP_ERROR err = LogValue("MyEnum", indent + 1, value.myEnum);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MyEnum'");
+ return err;
+ }
+ }
+ DataModelLogger::LogString(indent, "}");
+
+ return CHIP_NO_ERROR;
+}
+
+CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
const chip::app::Clusters::detail::Structs::ModeTagStruct::DecodableType & value)
{
DataModelLogger::LogString(label, indent, "{");
@@ -369,39 +402,6 @@
}
CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
- const chip::app::Clusters::Globals::Structs::TestGlobalStruct::DecodableType & value)
-{
- DataModelLogger::LogString(label, indent, "{");
- {
- CHIP_ERROR err = LogValue("Name", indent + 1, value.name);
- if (err != CHIP_NO_ERROR)
- {
- DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Name'");
- return err;
- }
- }
- {
- CHIP_ERROR err = LogValue("MyBitmap", indent + 1, value.myBitmap);
- if (err != CHIP_NO_ERROR)
- {
- DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MyBitmap'");
- return err;
- }
- }
- {
- CHIP_ERROR err = LogValue("MyEnum", indent + 1, value.myEnum);
- if (err != CHIP_NO_ERROR)
- {
- DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MyEnum'");
- return err;
- }
- }
- DataModelLogger::LogString(indent, "}");
-
- return CHIP_NO_ERROR;
-}
-
-CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
const chip::app::Clusters::Descriptor::Structs::SemanticTagStruct::DecodableType & value)
{
DataModelLogger::LogString(label, indent, "{");
@@ -5083,6 +5083,14 @@
return err;
}
}
+ {
+ CHIP_ERROR err = LogValue("I", indent + 1, value.i);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'I'");
+ return err;
+ }
+ }
DataModelLogger::LogString(indent, "}");
return CHIP_NO_ERROR;
@@ -5296,6 +5304,14 @@
return err;
}
}
+ {
+ CHIP_ERROR err = LogValue("D", indent + 1, value.d);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'D'");
+ return err;
+ }
+ }
DataModelLogger::LogString(indent, "}");
return CHIP_NO_ERROR;
@@ -8759,6 +8775,15 @@
return CHIP_NO_ERROR;
}
CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
+ const UnitTesting::Commands::GlobalEchoResponse::DecodableType & value)
+{
+ DataModelLogger::LogString(label, indent, "{");
+ ReturnErrorOnFailure(DataModelLogger::LogValue("field1", indent + 1, value.field1));
+ ReturnErrorOnFailure(DataModelLogger::LogValue("field2", indent + 1, value.field2));
+ DataModelLogger::LogString(indent, "}");
+ return CHIP_NO_ERROR;
+}
+CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
const UnitTesting::Commands::TestDifferentVendorMeiResponse::DecodableType & value)
{
DataModelLogger::LogString(label, indent, "{");
@@ -19002,6 +19027,16 @@
ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
return DataModelLogger::LogValue("cluster_error_boolean", 1, value);
}
+ case UnitTesting::Attributes::GlobalEnum::Id: {
+ chip::app::Clusters::Globals::TestGlobalEnum value;
+ ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
+ return DataModelLogger::LogValue("global_enum", 1, value);
+ }
+ case UnitTesting::Attributes::GlobalStruct::Id: {
+ chip::app::Clusters::Globals::Structs::TestGlobalStruct::DecodableType value;
+ ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
+ return DataModelLogger::LogValue("global_struct", 1, value);
+ }
case UnitTesting::Attributes::Unsupported::Id: {
bool value;
ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
@@ -19177,6 +19212,16 @@
ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
return DataModelLogger::LogValue("write_only_int8u", 1, value);
}
+ case UnitTesting::Attributes::NullableGlobalEnum::Id: {
+ chip::app::DataModel::Nullable<chip::app::Clusters::Globals::TestGlobalEnum> value;
+ ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
+ return DataModelLogger::LogValue("nullable_global_enum", 1, value);
+ }
+ case UnitTesting::Attributes::NullableGlobalStruct::Id: {
+ chip::app::DataModel::Nullable<chip::app::Clusters::Globals::Structs::TestGlobalStruct::DecodableType> value;
+ ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
+ return DataModelLogger::LogValue("nullable_global_struct", 1, value);
+ }
case UnitTesting::Attributes::GeneratedCommandList::Id: {
chip::app::DataModel::DecodableList<chip::CommandId> value;
ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
@@ -19991,6 +20036,11 @@
ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
return DataModelLogger::LogValue("StringEchoResponse", 1, value);
}
+ case UnitTesting::Commands::GlobalEchoResponse::Id: {
+ UnitTesting::Commands::GlobalEchoResponse::DecodableType value;
+ ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
+ return DataModelLogger::LogValue("GlobalEchoResponse", 1, value);
+ }
case UnitTesting::Commands::TestDifferentVendorMeiResponse::Id: {
UnitTesting::Commands::TestDifferentVendorMeiResponse::DecodableType value;
ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h
index 165d44d..52dede5 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h
+++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h
@@ -21,6 +21,9 @@
#include <lib/core/CHIPError.h>
static CHIP_ERROR LogValue(const char * label, size_t indent,
+ const chip::app::Clusters::Globals::Structs::TestGlobalStruct::DecodableType & value);
+
+static CHIP_ERROR LogValue(const char * label, size_t indent,
const chip::app::Clusters::detail::Structs::ModeTagStruct::DecodableType & value);
static CHIP_ERROR LogValue(const char * label, size_t indent,
@@ -51,9 +54,6 @@
const chip::app::Clusters::detail::Structs::OperationalStateStruct::DecodableType & value);
static CHIP_ERROR LogValue(const char * label, size_t indent,
- const chip::app::Clusters::Globals::Structs::TestGlobalStruct::DecodableType & value);
-
-static CHIP_ERROR LogValue(const char * label, size_t indent,
const chip::app::Clusters::Descriptor::Structs::SemanticTagStruct::DecodableType & value);
static CHIP_ERROR LogValue(const char * label, size_t indent,
@@ -869,6 +869,8 @@
static CHIP_ERROR LogValue(const char * label, size_t indent,
const chip::app::Clusters::UnitTesting::Commands::StringEchoResponse::DecodableType & value);
static CHIP_ERROR LogValue(const char * label, size_t indent,
+ const chip::app::Clusters::UnitTesting::Commands::GlobalEchoResponse::DecodableType & value);
+static CHIP_ERROR LogValue(const char * label, size_t indent,
const chip::app::Clusters::UnitTesting::Commands::TestDifferentVendorMeiResponse::DecodableType & value);
static CHIP_ERROR LogValue(const char * label, size_t indent,
const chip::app::Clusters::SampleMei::Commands::AddArgumentsResponse::DecodableType & value);
diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h
index d31a6b2..e226d87 100644
--- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h
+++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h
@@ -177168,6 +177168,7 @@
| * TestBatchHelperRequest | 0x16 |
| * TestSecondBatchHelperRequest | 0x17 |
| * StringEchoRequest | 0x18 |
+| * GlobalEchoRequest | 0x19 |
| * TestDifferentVendorMeiRequest | 0xFFF200AA|
|------------------------------------------------------------------------------|
| Attributes: | |
@@ -177218,6 +177219,8 @@
| * TimedWriteBoolean | 0x0030 |
| * GeneralErrorBoolean | 0x0031 |
| * ClusterErrorBoolean | 0x0032 |
+| * GlobalEnum | 0x0033 |
+| * GlobalStruct | 0x0034 |
| * Unsupported | 0x00FF |
| * NullableBoolean | 0x4000 |
| * NullableBitmap8 | 0x4001 |
@@ -177253,6 +177256,8 @@
| * NullableRangeRestrictedInt16u | 0x4028 |
| * NullableRangeRestrictedInt16s | 0x4029 |
| * WriteOnlyInt8u | 0x402A |
+| * NullableGlobalEnum | 0x4033 |
+| * NullableGlobalStruct | 0x4034 |
| * GeneratedCommandList | 0xFFF8 |
| * AcceptedCommandList | 0xFFF9 |
| * EventList | 0xFFFA |
@@ -177605,6 +177610,11 @@
newElement_0.c.f = [NSNumber numberWithUnsignedChar:entry_0.c.f.Raw()];
newElement_0.c.g = [NSNumber numberWithFloat:entry_0.c.g];
newElement_0.c.h = [NSNumber numberWithDouble:entry_0.c.h];
+ if (entry_0.c.i.HasValue()) {
+ newElement_0.c.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.c.i.Value())];
+ } else {
+ newElement_0.c.i = nil;
+ }
{ // Scope for our temporary variables
auto * array_2 = [NSMutableArray new];
for (auto & entry_2 : entry_0.d) {
@@ -177618,6 +177628,11 @@
newElement_2.f = [NSNumber numberWithUnsignedChar:entry_2.f.Raw()];
newElement_2.g = [NSNumber numberWithFloat:entry_2.g];
newElement_2.h = [NSNumber numberWithDouble:entry_2.h];
+ if (entry_2.i.HasValue()) {
+ newElement_2.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2.i.Value())];
+ } else {
+ newElement_2.i = nil;
+ }
[array_2 addObject:newElement_2];
}
newElement_0.d = array_2;
@@ -177666,6 +177681,11 @@
newElement_0.f = [NSNumber numberWithUnsignedChar:entry_0.f.Raw()];
newElement_0.g = [NSNumber numberWithFloat:entry_0.g];
newElement_0.h = [NSNumber numberWithDouble:entry_0.h];
+ if (entry_0.i.HasValue()) {
+ newElement_0.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.i.Value())];
+ } else {
+ newElement_0.i = nil;
+ }
[array_0 addObject:newElement_0];
}
params.arg2 = array_0;
@@ -177756,6 +177776,11 @@
params.arg1.f = [NSNumber numberWithUnsignedChar:mRequest.arg1.f.Raw()];
params.arg1.g = [NSNumber numberWithFloat:mRequest.arg1.g];
params.arg1.h = [NSNumber numberWithDouble:mRequest.arg1.h];
+ if (mRequest.arg1.i.HasValue()) {
+ params.arg1.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.arg1.i.Value())];
+ } else {
+ params.arg1.i = nil;
+ }
uint16_t repeatCount = mRepeatCount.ValueOr(1);
uint16_t __block responsesNeeded = repeatCount;
while (repeatCount--) {
@@ -177822,6 +177847,31 @@
params.arg1.c.f = [NSNumber numberWithUnsignedChar:mRequest.arg1.c.f.Raw()];
params.arg1.c.g = [NSNumber numberWithFloat:mRequest.arg1.c.g];
params.arg1.c.h = [NSNumber numberWithDouble:mRequest.arg1.c.h];
+ if (mRequest.arg1.c.i.HasValue()) {
+ params.arg1.c.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.arg1.c.i.Value())];
+ } else {
+ params.arg1.c.i = nil;
+ }
+ if (mRequest.arg1.d.HasValue()) {
+ params.arg1.d = [MTRDataTypeTestGlobalStruct new];
+ params.arg1.d.name = [[NSString alloc] initWithBytes:mRequest.arg1.d.Value().name.data() length:mRequest.arg1.d.Value().name.size() encoding:NSUTF8StringEncoding];
+ if (mRequest.arg1.d.Value().myBitmap.IsNull()) {
+ params.arg1.d.myBitmap = nil;
+ } else {
+ params.arg1.d.myBitmap = [NSNumber numberWithUnsignedInt:mRequest.arg1.d.Value().myBitmap.Value().Raw()];
+ }
+ if (mRequest.arg1.d.Value().myEnum.HasValue()) {
+ if (mRequest.arg1.d.Value().myEnum.Value().IsNull()) {
+ params.arg1.d.myEnum = nil;
+ } else {
+ params.arg1.d.myEnum = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.arg1.d.Value().myEnum.Value().Value())];
+ }
+ } else {
+ params.arg1.d.myEnum = nil;
+ }
+ } else {
+ params.arg1.d = nil;
+ }
uint16_t repeatCount = mRepeatCount.ValueOr(1);
uint16_t __block responsesNeeded = repeatCount;
while (repeatCount--) {
@@ -177889,6 +177939,11 @@
newElement_0.f = [NSNumber numberWithUnsignedChar:entry_0.f.Raw()];
newElement_0.g = [NSNumber numberWithFloat:entry_0.g];
newElement_0.h = [NSNumber numberWithDouble:entry_0.h];
+ if (entry_0.i.HasValue()) {
+ newElement_0.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.i.Value())];
+ } else {
+ newElement_0.i = nil;
+ }
[array_0 addObject:newElement_0];
}
params.arg1 = array_0;
@@ -178022,6 +178077,11 @@
params.arg1.c.f = [NSNumber numberWithUnsignedChar:mRequest.arg1.c.f.Raw()];
params.arg1.c.g = [NSNumber numberWithFloat:mRequest.arg1.c.g];
params.arg1.c.h = [NSNumber numberWithDouble:mRequest.arg1.c.h];
+ if (mRequest.arg1.c.i.HasValue()) {
+ params.arg1.c.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.arg1.c.i.Value())];
+ } else {
+ params.arg1.c.i = nil;
+ }
{ // Scope for our temporary variables
auto * array_1 = [NSMutableArray new];
for (auto & entry_1 : mRequest.arg1.d) {
@@ -178035,6 +178095,11 @@
newElement_1.f = [NSNumber numberWithUnsignedChar:entry_1.f.Raw()];
newElement_1.g = [NSNumber numberWithFloat:entry_1.g];
newElement_1.h = [NSNumber numberWithDouble:entry_1.h];
+ if (entry_1.i.HasValue()) {
+ newElement_1.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1.i.Value())];
+ } else {
+ newElement_1.i = nil;
+ }
[array_1 addObject:newElement_1];
}
params.arg1.d = array_1;
@@ -178136,6 +178201,11 @@
newElement_0.c.f = [NSNumber numberWithUnsignedChar:entry_0.c.f.Raw()];
newElement_0.c.g = [NSNumber numberWithFloat:entry_0.c.g];
newElement_0.c.h = [NSNumber numberWithDouble:entry_0.c.h];
+ if (entry_0.c.i.HasValue()) {
+ newElement_0.c.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.c.i.Value())];
+ } else {
+ newElement_0.c.i = nil;
+ }
{ // Scope for our temporary variables
auto * array_2 = [NSMutableArray new];
for (auto & entry_2 : entry_0.d) {
@@ -178149,6 +178219,11 @@
newElement_2.f = [NSNumber numberWithUnsignedChar:entry_2.f.Raw()];
newElement_2.g = [NSNumber numberWithFloat:entry_2.g];
newElement_2.h = [NSNumber numberWithDouble:entry_2.h];
+ if (entry_2.i.HasValue()) {
+ newElement_2.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2.i.Value())];
+ } else {
+ newElement_2.i = nil;
+ }
[array_2 addObject:newElement_2];
}
newElement_0.d = array_2;
@@ -178483,6 +178558,11 @@
params.nullableStruct.f = [NSNumber numberWithUnsignedChar:mRequest.nullableStruct.Value().f.Raw()];
params.nullableStruct.g = [NSNumber numberWithFloat:mRequest.nullableStruct.Value().g];
params.nullableStruct.h = [NSNumber numberWithDouble:mRequest.nullableStruct.Value().h];
+ if (mRequest.nullableStruct.Value().i.HasValue()) {
+ params.nullableStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.nullableStruct.Value().i.Value())];
+ } else {
+ params.nullableStruct.i = nil;
+ }
}
if (mRequest.optionalStruct.HasValue()) {
params.optionalStruct = [MTRUnitTestingClusterSimpleStruct new];
@@ -178494,6 +178574,11 @@
params.optionalStruct.f = [NSNumber numberWithUnsignedChar:mRequest.optionalStruct.Value().f.Raw()];
params.optionalStruct.g = [NSNumber numberWithFloat:mRequest.optionalStruct.Value().g];
params.optionalStruct.h = [NSNumber numberWithDouble:mRequest.optionalStruct.Value().h];
+ if (mRequest.optionalStruct.Value().i.HasValue()) {
+ params.optionalStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.optionalStruct.Value().i.Value())];
+ } else {
+ params.optionalStruct.i = nil;
+ }
} else {
params.optionalStruct = nil;
}
@@ -178510,6 +178595,11 @@
params.nullableOptionalStruct.f = [NSNumber numberWithUnsignedChar:mRequest.nullableOptionalStruct.Value().Value().f.Raw()];
params.nullableOptionalStruct.g = [NSNumber numberWithFloat:mRequest.nullableOptionalStruct.Value().Value().g];
params.nullableOptionalStruct.h = [NSNumber numberWithDouble:mRequest.nullableOptionalStruct.Value().Value().h];
+ if (mRequest.nullableOptionalStruct.Value().Value().i.HasValue()) {
+ params.nullableOptionalStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.nullableOptionalStruct.Value().Value().i.Value())];
+ } else {
+ params.nullableOptionalStruct.i = nil;
+ }
}
} else {
params.nullableOptionalStruct = nil;
@@ -178625,6 +178715,11 @@
params.arg1.f = [NSNumber numberWithUnsignedChar:mRequest.arg1.f.Raw()];
params.arg1.g = [NSNumber numberWithFloat:mRequest.arg1.g];
params.arg1.h = [NSNumber numberWithDouble:mRequest.arg1.h];
+ if (mRequest.arg1.i.HasValue()) {
+ params.arg1.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.arg1.i.Value())];
+ } else {
+ params.arg1.i = nil;
+ }
uint16_t repeatCount = mRepeatCount.ValueOr(1);
uint16_t __block responsesNeeded = repeatCount;
while (repeatCount--) {
@@ -179063,6 +179158,88 @@
#endif // MTR_ENABLE_PROVISIONAL
#if MTR_ENABLE_PROVISIONAL
/*
+ * Command GlobalEchoRequest
+ */
+class UnitTestingGlobalEchoRequest : public ClusterCommand {
+public:
+ UnitTestingGlobalEchoRequest()
+ : ClusterCommand("global-echo-request")
+ , mComplex_Field1(&mRequest.field1)
+ {
+#if MTR_ENABLE_PROVISIONAL
+ AddArgument("Field1", &mComplex_Field1);
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ AddArgument("Field2", 0, UINT8_MAX, &mRequest.field2);
+#endif // MTR_ENABLE_PROVISIONAL
+ ClusterCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::CommandId commandId = chip::app::Clusters::UnitTesting::Commands::GlobalEchoRequest::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId);
+
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRUnitTestingClusterGlobalEchoRequestParams alloc] init];
+ params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil;
+#if MTR_ENABLE_PROVISIONAL
+ params.field1 = [MTRDataTypeTestGlobalStruct new];
+ params.field1.name = [[NSString alloc] initWithBytes:mRequest.field1.name.data() length:mRequest.field1.name.size() encoding:NSUTF8StringEncoding];
+ if (mRequest.field1.myBitmap.IsNull()) {
+ params.field1.myBitmap = nil;
+ } else {
+ params.field1.myBitmap = [NSNumber numberWithUnsignedInt:mRequest.field1.myBitmap.Value().Raw()];
+ }
+ if (mRequest.field1.myEnum.HasValue()) {
+ if (mRequest.field1.myEnum.Value().IsNull()) {
+ params.field1.myEnum = nil;
+ } else {
+ params.field1.myEnum = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.field1.myEnum.Value().Value())];
+ }
+ } else {
+ params.field1.myEnum = nil;
+ }
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ params.field2 = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.field2)];
+#endif // MTR_ENABLE_PROVISIONAL
+ uint16_t repeatCount = mRepeatCount.ValueOr(1);
+ uint16_t __block responsesNeeded = repeatCount;
+ while (repeatCount--) {
+ [cluster globalEchoRequestWithParams:params completion:
+ ^(MTRUnitTestingClusterGlobalEchoResponseParams * _Nullable values, NSError * _Nullable error) {
+ NSLog(@"Values: %@", values);
+ if (error == nil) {
+ constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting::Commands::GlobalEchoResponse::Id;
+ RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values);
+ }
+ responsesNeeded--;
+ if (error != nil) {
+ mError = error;
+ LogNSError("Error", error);
+ constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting::Commands::GlobalEchoResponse::Id;
+ RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error);
+ }
+ if (responsesNeeded == 0) {
+ SetCommandExitStatus(mError);
+ }
+ }];
+ }
+ return CHIP_NO_ERROR;
+ }
+
+private:
+ chip::app::Clusters::UnitTesting::Commands::GlobalEchoRequest::Type mRequest;
+ TypedComplexArgument<chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type> mComplex_Field1;
+};
+
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+/*
* Command TestDifferentVendorMeiRequest
*/
class UnitTestingTestDifferentVendorMeiRequest : public ClusterCommand {
@@ -183580,6 +183757,11 @@
newElement_0.nullableStruct.f = [NSNumber numberWithUnsignedChar:entry_0.nullableStruct.Value().f.Raw()];
newElement_0.nullableStruct.g = [NSNumber numberWithFloat:entry_0.nullableStruct.Value().g];
newElement_0.nullableStruct.h = [NSNumber numberWithDouble:entry_0.nullableStruct.Value().h];
+ if (entry_0.nullableStruct.Value().i.HasValue()) {
+ newElement_0.nullableStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.nullableStruct.Value().i.Value())];
+ } else {
+ newElement_0.nullableStruct.i = nil;
+ }
}
if (entry_0.optionalStruct.HasValue()) {
newElement_0.optionalStruct = [MTRUnitTestingClusterSimpleStruct new];
@@ -183591,6 +183773,11 @@
newElement_0.optionalStruct.f = [NSNumber numberWithUnsignedChar:entry_0.optionalStruct.Value().f.Raw()];
newElement_0.optionalStruct.g = [NSNumber numberWithFloat:entry_0.optionalStruct.Value().g];
newElement_0.optionalStruct.h = [NSNumber numberWithDouble:entry_0.optionalStruct.Value().h];
+ if (entry_0.optionalStruct.Value().i.HasValue()) {
+ newElement_0.optionalStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.optionalStruct.Value().i.Value())];
+ } else {
+ newElement_0.optionalStruct.i = nil;
+ }
} else {
newElement_0.optionalStruct = nil;
}
@@ -183607,6 +183794,11 @@
newElement_0.nullableOptionalStruct.f = [NSNumber numberWithUnsignedChar:entry_0.nullableOptionalStruct.Value().Value().f.Raw()];
newElement_0.nullableOptionalStruct.g = [NSNumber numberWithFloat:entry_0.nullableOptionalStruct.Value().Value().g];
newElement_0.nullableOptionalStruct.h = [NSNumber numberWithDouble:entry_0.nullableOptionalStruct.Value().Value().h];
+ if (entry_0.nullableOptionalStruct.Value().Value().i.HasValue()) {
+ newElement_0.nullableOptionalStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.nullableOptionalStruct.Value().Value().i.Value())];
+ } else {
+ newElement_0.nullableOptionalStruct.i = nil;
+ }
}
} else {
newElement_0.nullableOptionalStruct = nil;
@@ -183915,6 +184107,11 @@
value.f = [NSNumber numberWithUnsignedChar:mValue.f.Raw()];
value.g = [NSNumber numberWithFloat:mValue.g];
value.h = [NSNumber numberWithDouble:mValue.h];
+ if (mValue.i.HasValue()) {
+ value.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(mValue.i.Value())];
+ } else {
+ value.i = nil;
+ }
[cluster writeAttributeStructAttrWithValue:value params:params completion:^(NSError * _Nullable error) {
if (error != nil) {
@@ -184705,6 +184902,11 @@
newElement_0.fabricSensitiveStruct.f = [NSNumber numberWithUnsignedChar:entry_0.fabricSensitiveStruct.f.Raw()];
newElement_0.fabricSensitiveStruct.g = [NSNumber numberWithFloat:entry_0.fabricSensitiveStruct.g];
newElement_0.fabricSensitiveStruct.h = [NSNumber numberWithDouble:entry_0.fabricSensitiveStruct.h];
+ if (entry_0.fabricSensitiveStruct.i.HasValue()) {
+ newElement_0.fabricSensitiveStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.fabricSensitiveStruct.i.Value())];
+ } else {
+ newElement_0.fabricSensitiveStruct.i = nil;
+ }
{ // Scope for our temporary variables
auto * array_2 = [NSMutableArray new];
for (auto & entry_2 : entry_0.fabricSensitiveInt8uList) {
@@ -185149,6 +185351,277 @@
}
};
+#if MTR_ENABLE_PROVISIONAL
+
+/*
+ * Attribute GlobalEnum
+ */
+class ReadUnitTestingGlobalEnum : public ReadAttribute {
+public:
+ ReadUnitTestingGlobalEnum()
+ : ReadAttribute("global-enum")
+ {
+ }
+
+ ~ReadUnitTestingGlobalEnum()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::AttributeId attributeId = chip::app::Clusters::UnitTesting::Attributes::GlobalEnum::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId);
+
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ [cluster readAttributeGlobalEnumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"UnitTesting.GlobalEnum response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ LogNSError("UnitTesting GlobalEnum read Error", error);
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+ return CHIP_NO_ERROR;
+ }
+};
+
+class WriteUnitTestingGlobalEnum : public WriteAttribute {
+public:
+ WriteUnitTestingGlobalEnum()
+ : WriteAttribute("global-enum")
+ {
+ AddArgument("attr-name", "global-enum");
+ AddArgument("attr-value", 0, UINT8_MAX, &mValue);
+ WriteAttribute::AddArguments();
+ }
+
+ ~WriteUnitTestingGlobalEnum()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::AttributeId attributeId = chip::app::Clusters::UnitTesting::Attributes::GlobalEnum::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId);
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRWriteParams alloc] init];
+ params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil;
+ params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil;
+ NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue];
+
+ [cluster writeAttributeGlobalEnumWithValue:value params:params completion:^(NSError * _Nullable error) {
+ if (error != nil) {
+ LogNSError("UnitTesting GlobalEnum write Error", error);
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+ return CHIP_NO_ERROR;
+ }
+
+private:
+ uint8_t mValue;
+};
+
+class SubscribeAttributeUnitTestingGlobalEnum : public SubscribeAttribute {
+public:
+ SubscribeAttributeUnitTestingGlobalEnum()
+ : SubscribeAttribute("global-enum")
+ {
+ }
+
+ ~SubscribeAttributeUnitTestingGlobalEnum()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::CommandId attributeId = chip::app::Clusters::UnitTesting::Attributes::GlobalEnum::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId);
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)];
+ if (mKeepSubscriptions.HasValue()) {
+ params.replaceExistingSubscriptions = !mKeepSubscriptions.Value();
+ }
+ if (mFabricFiltered.HasValue()) {
+ params.filterByFabric = mFabricFiltered.Value();
+ }
+ if (mAutoResubscribe.HasValue()) {
+ params.resubscribeAutomatically = mAutoResubscribe.Value();
+ }
+ [cluster subscribeAttributeGlobalEnumWithParams:params
+ subscriptionEstablished:^() { mSubscriptionEstablished = YES; }
+ reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"UnitTesting.GlobalEnum response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+};
+
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+
+/*
+ * Attribute GlobalStruct
+ */
+class ReadUnitTestingGlobalStruct : public ReadAttribute {
+public:
+ ReadUnitTestingGlobalStruct()
+ : ReadAttribute("global-struct")
+ {
+ }
+
+ ~ReadUnitTestingGlobalStruct()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::AttributeId attributeId = chip::app::Clusters::UnitTesting::Attributes::GlobalStruct::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId);
+
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ [cluster readAttributeGlobalStructWithCompletion:^(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"UnitTesting.GlobalStruct response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ LogNSError("UnitTesting GlobalStruct read Error", error);
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+ return CHIP_NO_ERROR;
+ }
+};
+
+class WriteUnitTestingGlobalStruct : public WriteAttribute {
+public:
+ WriteUnitTestingGlobalStruct()
+ : WriteAttribute("global-struct")
+ , mComplex(&mValue)
+ {
+ AddArgument("attr-name", "global-struct");
+ AddArgument("attr-value", &mComplex);
+ WriteAttribute::AddArguments();
+ }
+
+ ~WriteUnitTestingGlobalStruct()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::AttributeId attributeId = chip::app::Clusters::UnitTesting::Attributes::GlobalStruct::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId);
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRWriteParams alloc] init];
+ params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil;
+ params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil;
+ MTRDataTypeTestGlobalStruct * _Nonnull value;
+ value = [MTRDataTypeTestGlobalStruct new];
+ value.name = [[NSString alloc] initWithBytes:mValue.name.data() length:mValue.name.size() encoding:NSUTF8StringEncoding];
+ if (mValue.myBitmap.IsNull()) {
+ value.myBitmap = nil;
+ } else {
+ value.myBitmap = [NSNumber numberWithUnsignedInt:mValue.myBitmap.Value().Raw()];
+ }
+ if (mValue.myEnum.HasValue()) {
+ if (mValue.myEnum.Value().IsNull()) {
+ value.myEnum = nil;
+ } else {
+ value.myEnum = [NSNumber numberWithUnsignedChar:chip::to_underlying(mValue.myEnum.Value().Value())];
+ }
+ } else {
+ value.myEnum = nil;
+ }
+
+ [cluster writeAttributeGlobalStructWithValue:value params:params completion:^(NSError * _Nullable error) {
+ if (error != nil) {
+ LogNSError("UnitTesting GlobalStruct write Error", error);
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+ return CHIP_NO_ERROR;
+ }
+
+private:
+ chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type mValue;
+ TypedComplexArgument<chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type> mComplex;
+};
+
+class SubscribeAttributeUnitTestingGlobalStruct : public SubscribeAttribute {
+public:
+ SubscribeAttributeUnitTestingGlobalStruct()
+ : SubscribeAttribute("global-struct")
+ {
+ }
+
+ ~SubscribeAttributeUnitTestingGlobalStruct()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::CommandId attributeId = chip::app::Clusters::UnitTesting::Attributes::GlobalStruct::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId);
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)];
+ if (mKeepSubscriptions.HasValue()) {
+ params.replaceExistingSubscriptions = !mKeepSubscriptions.Value();
+ }
+ if (mFabricFiltered.HasValue()) {
+ params.filterByFabric = mFabricFiltered.Value();
+ }
+ if (mAutoResubscribe.HasValue()) {
+ params.resubscribeAutomatically = mAutoResubscribe.Value();
+ }
+ [cluster subscribeAttributeGlobalStructWithParams:params
+ subscriptionEstablished:^() { mSubscriptionEstablished = YES; }
+ reportHandler:^(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"UnitTesting.GlobalStruct response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+};
+
+#endif // MTR_ENABLE_PROVISIONAL
+
/*
* Attribute Unsupported
*/
@@ -188876,6 +189349,11 @@
value.f = [NSNumber numberWithUnsignedChar:mValue.Value().f.Raw()];
value.g = [NSNumber numberWithFloat:mValue.Value().g];
value.h = [NSNumber numberWithDouble:mValue.Value().h];
+ if (mValue.Value().i.HasValue()) {
+ value.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(mValue.Value().i.Value())];
+ } else {
+ value.i = nil;
+ }
}
[cluster writeAttributeNullableStructWithValue:value params:params completion:^(NSError * _Nullable error) {
@@ -189565,6 +190043,284 @@
}
};
+#if MTR_ENABLE_PROVISIONAL
+
+/*
+ * Attribute NullableGlobalEnum
+ */
+class ReadUnitTestingNullableGlobalEnum : public ReadAttribute {
+public:
+ ReadUnitTestingNullableGlobalEnum()
+ : ReadAttribute("nullable-global-enum")
+ {
+ }
+
+ ~ReadUnitTestingNullableGlobalEnum()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::AttributeId attributeId = chip::app::Clusters::UnitTesting::Attributes::NullableGlobalEnum::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId);
+
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ [cluster readAttributeNullableGlobalEnumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"UnitTesting.NullableGlobalEnum response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ LogNSError("UnitTesting NullableGlobalEnum read Error", error);
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+ return CHIP_NO_ERROR;
+ }
+};
+
+class WriteUnitTestingNullableGlobalEnum : public WriteAttribute {
+public:
+ WriteUnitTestingNullableGlobalEnum()
+ : WriteAttribute("nullable-global-enum")
+ {
+ AddArgument("attr-name", "nullable-global-enum");
+ AddArgument("attr-value", 0, UINT8_MAX, &mValue);
+ WriteAttribute::AddArguments();
+ }
+
+ ~WriteUnitTestingNullableGlobalEnum()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::AttributeId attributeId = chip::app::Clusters::UnitTesting::Attributes::NullableGlobalEnum::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId);
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRWriteParams alloc] init];
+ params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil;
+ params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil;
+ NSNumber * _Nullable value = nil;
+ if (!mValue.IsNull()) {
+ value = [NSNumber numberWithUnsignedChar:mValue.Value()];
+ }
+
+ [cluster writeAttributeNullableGlobalEnumWithValue:value params:params completion:^(NSError * _Nullable error) {
+ if (error != nil) {
+ LogNSError("UnitTesting NullableGlobalEnum write Error", error);
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+ return CHIP_NO_ERROR;
+ }
+
+private:
+ chip::app::DataModel::Nullable<uint8_t> mValue;
+};
+
+class SubscribeAttributeUnitTestingNullableGlobalEnum : public SubscribeAttribute {
+public:
+ SubscribeAttributeUnitTestingNullableGlobalEnum()
+ : SubscribeAttribute("nullable-global-enum")
+ {
+ }
+
+ ~SubscribeAttributeUnitTestingNullableGlobalEnum()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::CommandId attributeId = chip::app::Clusters::UnitTesting::Attributes::NullableGlobalEnum::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId);
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)];
+ if (mKeepSubscriptions.HasValue()) {
+ params.replaceExistingSubscriptions = !mKeepSubscriptions.Value();
+ }
+ if (mFabricFiltered.HasValue()) {
+ params.filterByFabric = mFabricFiltered.Value();
+ }
+ if (mAutoResubscribe.HasValue()) {
+ params.resubscribeAutomatically = mAutoResubscribe.Value();
+ }
+ [cluster subscribeAttributeNullableGlobalEnumWithParams:params
+ subscriptionEstablished:^() { mSubscriptionEstablished = YES; }
+ reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"UnitTesting.NullableGlobalEnum response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+};
+
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+
+/*
+ * Attribute NullableGlobalStruct
+ */
+class ReadUnitTestingNullableGlobalStruct : public ReadAttribute {
+public:
+ ReadUnitTestingNullableGlobalStruct()
+ : ReadAttribute("nullable-global-struct")
+ {
+ }
+
+ ~ReadUnitTestingNullableGlobalStruct()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::AttributeId attributeId = chip::app::Clusters::UnitTesting::Attributes::NullableGlobalStruct::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId);
+
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ [cluster readAttributeNullableGlobalStructWithCompletion:^(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"UnitTesting.NullableGlobalStruct response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ LogNSError("UnitTesting NullableGlobalStruct read Error", error);
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+ return CHIP_NO_ERROR;
+ }
+};
+
+class WriteUnitTestingNullableGlobalStruct : public WriteAttribute {
+public:
+ WriteUnitTestingNullableGlobalStruct()
+ : WriteAttribute("nullable-global-struct")
+ , mComplex(&mValue)
+ {
+ AddArgument("attr-name", "nullable-global-struct");
+ AddArgument("attr-value", &mComplex);
+ WriteAttribute::AddArguments();
+ }
+
+ ~WriteUnitTestingNullableGlobalStruct()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::AttributeId attributeId = chip::app::Clusters::UnitTesting::Attributes::NullableGlobalStruct::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId);
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRWriteParams alloc] init];
+ params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil;
+ params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil;
+ MTRDataTypeTestGlobalStruct * _Nullable value;
+ if (mValue.IsNull()) {
+ value = nil;
+ } else {
+ value = [MTRDataTypeTestGlobalStruct new];
+ value.name = [[NSString alloc] initWithBytes:mValue.Value().name.data() length:mValue.Value().name.size() encoding:NSUTF8StringEncoding];
+ if (mValue.Value().myBitmap.IsNull()) {
+ value.myBitmap = nil;
+ } else {
+ value.myBitmap = [NSNumber numberWithUnsignedInt:mValue.Value().myBitmap.Value().Raw()];
+ }
+ if (mValue.Value().myEnum.HasValue()) {
+ if (mValue.Value().myEnum.Value().IsNull()) {
+ value.myEnum = nil;
+ } else {
+ value.myEnum = [NSNumber numberWithUnsignedChar:chip::to_underlying(mValue.Value().myEnum.Value().Value())];
+ }
+ } else {
+ value.myEnum = nil;
+ }
+ }
+
+ [cluster writeAttributeNullableGlobalStructWithValue:value params:params completion:^(NSError * _Nullable error) {
+ if (error != nil) {
+ LogNSError("UnitTesting NullableGlobalStruct write Error", error);
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+ return CHIP_NO_ERROR;
+ }
+
+private:
+ chip::app::DataModel::Nullable<chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type> mValue;
+ TypedComplexArgument<chip::app::DataModel::Nullable<chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type>> mComplex;
+};
+
+class SubscribeAttributeUnitTestingNullableGlobalStruct : public SubscribeAttribute {
+public:
+ SubscribeAttributeUnitTestingNullableGlobalStruct()
+ : SubscribeAttribute("nullable-global-struct")
+ {
+ }
+
+ ~SubscribeAttributeUnitTestingNullableGlobalStruct()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::CommandId attributeId = chip::app::Clusters::UnitTesting::Attributes::NullableGlobalStruct::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId);
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)];
+ if (mKeepSubscriptions.HasValue()) {
+ params.replaceExistingSubscriptions = !mKeepSubscriptions.Value();
+ }
+ if (mFabricFiltered.HasValue()) {
+ params.filterByFabric = mFabricFiltered.Value();
+ }
+ if (mAutoResubscribe.HasValue()) {
+ params.resubscribeAutomatically = mAutoResubscribe.Value();
+ }
+ [cluster subscribeAttributeNullableGlobalStructWithParams:params
+ subscriptionEstablished:^() { mSubscriptionEstablished = YES; }
+ reportHandler:^(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"UnitTesting.NullableGlobalStruct response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+};
+
+#endif // MTR_ENABLE_PROVISIONAL
+
/*
* Attribute GeneratedCommandList
*/
@@ -198237,6 +198993,9 @@
make_unique<UnitTestingStringEchoRequest>(), //
#endif // MTR_ENABLE_PROVISIONAL
#if MTR_ENABLE_PROVISIONAL
+ make_unique<UnitTestingGlobalEchoRequest>(), //
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
make_unique<UnitTestingTestDifferentVendorMeiRequest>(), //
#endif // MTR_ENABLE_PROVISIONAL
make_unique<ReadAttribute>(Id), //
@@ -198383,6 +199142,16 @@
make_unique<ReadUnitTestingClusterErrorBoolean>(), //
make_unique<WriteUnitTestingClusterErrorBoolean>(), //
make_unique<SubscribeAttributeUnitTestingClusterErrorBoolean>(), //
+#if MTR_ENABLE_PROVISIONAL
+ make_unique<ReadUnitTestingGlobalEnum>(), //
+ make_unique<WriteUnitTestingGlobalEnum>(), //
+ make_unique<SubscribeAttributeUnitTestingGlobalEnum>(), //
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ make_unique<ReadUnitTestingGlobalStruct>(), //
+ make_unique<WriteUnitTestingGlobalStruct>(), //
+ make_unique<SubscribeAttributeUnitTestingGlobalStruct>(), //
+#endif // MTR_ENABLE_PROVISIONAL
make_unique<ReadUnitTestingUnsupported>(), //
make_unique<WriteUnitTestingUnsupported>(), //
make_unique<SubscribeAttributeUnitTestingUnsupported>(), //
@@ -198488,6 +199257,16 @@
make_unique<ReadUnitTestingWriteOnlyInt8u>(), //
make_unique<WriteUnitTestingWriteOnlyInt8u>(), //
make_unique<SubscribeAttributeUnitTestingWriteOnlyInt8u>(), //
+#if MTR_ENABLE_PROVISIONAL
+ make_unique<ReadUnitTestingNullableGlobalEnum>(), //
+ make_unique<WriteUnitTestingNullableGlobalEnum>(), //
+ make_unique<SubscribeAttributeUnitTestingNullableGlobalEnum>(), //
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ make_unique<ReadUnitTestingNullableGlobalStruct>(), //
+ make_unique<WriteUnitTestingNullableGlobalStruct>(), //
+ make_unique<SubscribeAttributeUnitTestingNullableGlobalStruct>(), //
+#endif // MTR_ENABLE_PROVISIONAL
make_unique<ReadUnitTestingGeneratedCommandList>(), //
make_unique<SubscribeAttributeUnitTestingGeneratedCommandList>(), //
make_unique<ReadUnitTestingAcceptedCommandList>(), //