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 a9f9df1b37112f..5d421d2ad0a9f2 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
@@ -2333,7 +2333,7 @@ server cluster OnOffSwitchConfiguration = 7 {
}
server cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -2394,7 +2394,7 @@ server cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct RemoveTrustedRootCertificateRequest {
@@ -2420,9 +2420,9 @@ server cluster OperationalCredentials = 62 {
}
response struct NOCResponse {
- INT8U statusCode = 0;
- INT8U fabricIndex = 1;
- CHAR_STRING debugText = 2;
+ OperationalCertStatus statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional CHAR_STRING debugText = 2;
}
response struct OpCSRResponse {
diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter
index 3f3332c78ddaba..26d21d379d7b78 100644
--- a/examples/bridge-app/bridge-common/bridge-app.matter
+++ b/examples/bridge-app/bridge-common/bridge-app.matter
@@ -672,7 +672,7 @@ server cluster OnOff = 6 {
}
server cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -733,7 +733,7 @@ server cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct RemoveTrustedRootCertificateRequest {
@@ -759,9 +759,9 @@ server cluster OperationalCredentials = 62 {
}
response struct NOCResponse {
- INT8U statusCode = 0;
- INT8U fabricIndex = 1;
- CHAR_STRING debugText = 2;
+ OperationalCertStatus statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional CHAR_STRING debugText = 2;
}
response struct OpCSRResponse {
diff --git a/examples/door-lock-app/door-lock-common/door-lock-app.matter b/examples/door-lock-app/door-lock-common/door-lock-app.matter
index d76af2dbf0d4ed..29def6b0bc9a16 100644
--- a/examples/door-lock-app/door-lock-common/door-lock-app.matter
+++ b/examples/door-lock-app/door-lock-common/door-lock-app.matter
@@ -1034,7 +1034,7 @@ server cluster NetworkCommissioning = 49 {
}
server cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -1095,7 +1095,7 @@ server cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct RemoveTrustedRootCertificateRequest {
@@ -1121,9 +1121,9 @@ server cluster OperationalCredentials = 62 {
}
response struct NOCResponse {
- INT8U statusCode = 0;
- INT8U fabricIndex = 1;
- CHAR_STRING debugText = 2;
+ OperationalCertStatus statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional CHAR_STRING debugText = 2;
}
response struct OpCSRResponse {
diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter
index 21f2976c98136c..f4a37fff63c66b 100644
--- a/examples/light-switch-app/light-switch-common/light-switch-app.matter
+++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter
@@ -1012,7 +1012,7 @@ client cluster OnOff = 6 {
}
server cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -1073,7 +1073,7 @@ server cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct RemoveTrustedRootCertificateRequest {
@@ -1099,9 +1099,9 @@ server cluster OperationalCredentials = 62 {
}
response struct NOCResponse {
- INT8U statusCode = 0;
- INT8U fabricIndex = 1;
- CHAR_STRING debugText = 2;
+ OperationalCertStatus statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional CHAR_STRING debugText = 2;
}
response struct OpCSRResponse {
diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter
index 912b8ac0320b7a..c50f9fb09caff7 100644
--- a/examples/lighting-app/lighting-common/lighting-app.matter
+++ b/examples/lighting-app/lighting-common/lighting-app.matter
@@ -1172,7 +1172,7 @@ server cluster OnOffSwitchConfiguration = 7 {
}
server cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -1233,7 +1233,7 @@ server cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct RemoveTrustedRootCertificateRequest {
@@ -1259,9 +1259,9 @@ server cluster OperationalCredentials = 62 {
}
response struct NOCResponse {
- INT8U statusCode = 0;
- INT8U fabricIndex = 1;
- CHAR_STRING debugText = 2;
+ OperationalCertStatus statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional CHAR_STRING debugText = 2;
}
response struct OpCSRResponse {
diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter
index 361f5bdf864739..f4ae7182146654 100644
--- a/examples/lock-app/lock-common/lock-app.matter
+++ b/examples/lock-app/lock-common/lock-app.matter
@@ -528,7 +528,7 @@ server cluster OnOff = 6 {
}
server cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -589,7 +589,7 @@ server cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct RemoveTrustedRootCertificateRequest {
@@ -615,9 +615,9 @@ server cluster OperationalCredentials = 62 {
}
response struct NOCResponse {
- INT8U statusCode = 0;
- INT8U fabricIndex = 1;
- CHAR_STRING debugText = 2;
+ OperationalCertStatus statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional CHAR_STRING debugText = 2;
}
response struct OpCSRResponse {
diff --git a/examples/log-source-app/log-source-common/log-source-app.matter b/examples/log-source-app/log-source-common/log-source-app.matter
index 261ceacefa80a0..15971fa12a1fe8 100644
--- a/examples/log-source-app/log-source-common/log-source-app.matter
+++ b/examples/log-source-app/log-source-common/log-source-app.matter
@@ -289,7 +289,7 @@ server cluster NetworkCommissioning = 49 {
}
server cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -342,7 +342,7 @@ server cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct UpdateFabricLabelRequest {
@@ -359,9 +359,9 @@ server cluster OperationalCredentials = 62 {
}
response struct NOCResponse {
- INT8U statusCode = 0;
- INT8U fabricIndex = 1;
- CHAR_STRING debugText = 2;
+ OperationalCertStatus statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional CHAR_STRING debugText = 2;
}
response struct OpCSRResponse {
diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter
index b949d2495ee321..a9469260f65c29 100644
--- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter
+++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter
@@ -390,7 +390,7 @@ server cluster OtaSoftwareUpdateProvider = 41 {
}
server cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -451,7 +451,7 @@ server cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct UpdateFabricLabelRequest {
@@ -468,9 +468,9 @@ server cluster OperationalCredentials = 62 {
}
response struct NOCResponse {
- INT8U statusCode = 0;
- INT8U fabricIndex = 1;
- CHAR_STRING debugText = 2;
+ OperationalCertStatus statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional CHAR_STRING debugText = 2;
}
response struct OpCSRResponse {
diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter
index ab6faecd125214..ffce7afde32dd2 100644
--- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter
+++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter
@@ -434,7 +434,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 {
}
server cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -495,7 +495,7 @@ server cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct RemoveTrustedRootCertificateRequest {
@@ -521,9 +521,9 @@ server cluster OperationalCredentials = 62 {
}
response struct NOCResponse {
- INT8U statusCode = 0;
- INT8U fabricIndex = 1;
- CHAR_STRING debugText = 2;
+ OperationalCertStatus statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional CHAR_STRING debugText = 2;
}
response struct OpCSRResponse {
diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter
index 959a3611d35ffe..c80003c88a780d 100644
--- a/examples/placeholder/linux/apps/app1/config.matter
+++ b/examples/placeholder/linux/apps/app1/config.matter
@@ -564,7 +564,7 @@ server cluster OnOff = 6 {
}
client cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -618,7 +618,7 @@ client cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct RemoveTrustedRootCertificateRequest {
@@ -646,7 +646,7 @@ client cluster OperationalCredentials = 62 {
}
server cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -700,7 +700,7 @@ server cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct RemoveTrustedRootCertificateRequest {
@@ -726,9 +726,9 @@ server cluster OperationalCredentials = 62 {
}
response struct NOCResponse {
- INT8U statusCode = 0;
- INT8U fabricIndex = 1;
- CHAR_STRING debugText = 2;
+ OperationalCertStatus statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional CHAR_STRING debugText = 2;
}
response struct OpCSRResponse {
diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter
index 959a3611d35ffe..c80003c88a780d 100644
--- a/examples/placeholder/linux/apps/app2/config.matter
+++ b/examples/placeholder/linux/apps/app2/config.matter
@@ -564,7 +564,7 @@ server cluster OnOff = 6 {
}
client cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -618,7 +618,7 @@ client cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct RemoveTrustedRootCertificateRequest {
@@ -646,7 +646,7 @@ client cluster OperationalCredentials = 62 {
}
server cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -700,7 +700,7 @@ server cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct RemoveTrustedRootCertificateRequest {
@@ -726,9 +726,9 @@ server cluster OperationalCredentials = 62 {
}
response struct NOCResponse {
- INT8U statusCode = 0;
- INT8U fabricIndex = 1;
- CHAR_STRING debugText = 2;
+ OperationalCertStatus statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional CHAR_STRING debugText = 2;
}
response struct OpCSRResponse {
diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter
index 3bc9dac8a089ee..09a042606736f2 100644
--- a/examples/pump-app/pump-common/pump-app.matter
+++ b/examples/pump-app/pump-common/pump-app.matter
@@ -583,7 +583,7 @@ server cluster OnOff = 6 {
}
server cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -644,7 +644,7 @@ server cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct RemoveTrustedRootCertificateRequest {
@@ -670,9 +670,9 @@ server cluster OperationalCredentials = 62 {
}
response struct NOCResponse {
- INT8U statusCode = 0;
- INT8U fabricIndex = 1;
- CHAR_STRING debugText = 2;
+ OperationalCertStatus statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional CHAR_STRING debugText = 2;
}
response struct OpCSRResponse {
diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter
index 784e14de14d1df..a3ba75ad6b6546 100644
--- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter
+++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter
@@ -603,7 +603,7 @@ client cluster OnOff = 6 {
}
server cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -664,7 +664,7 @@ server cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct RemoveTrustedRootCertificateRequest {
@@ -690,9 +690,9 @@ server cluster OperationalCredentials = 62 {
}
response struct NOCResponse {
- INT8U statusCode = 0;
- INT8U fabricIndex = 1;
- CHAR_STRING debugText = 2;
+ OperationalCertStatus statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional CHAR_STRING debugText = 2;
}
response struct OpCSRResponse {
diff --git a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter
index bdf43ce17f459b..3914cfe2cad82f 100644
--- a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter
+++ b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter
@@ -489,7 +489,7 @@ server cluster NetworkCommissioning = 49 {
}
server cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -550,7 +550,7 @@ server cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct RemoveTrustedRootCertificateRequest {
@@ -576,9 +576,9 @@ server cluster OperationalCredentials = 62 {
}
response struct NOCResponse {
- INT8U statusCode = 0;
- INT8U fabricIndex = 1;
- CHAR_STRING debugText = 2;
+ OperationalCertStatus statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional CHAR_STRING debugText = 2;
}
response struct OpCSRResponse {
diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter
index 9e3c9871e5fbb0..7623a8bcb1c9b8 100644
--- a/examples/thermostat/thermostat-common/thermostat.matter
+++ b/examples/thermostat/thermostat-common/thermostat.matter
@@ -738,7 +738,7 @@ server cluster OtaSoftwareUpdateProvider = 41 {
}
server cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -799,7 +799,7 @@ server cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct RemoveTrustedRootCertificateRequest {
@@ -825,9 +825,9 @@ server cluster OperationalCredentials = 62 {
}
response struct NOCResponse {
- INT8U statusCode = 0;
- INT8U fabricIndex = 1;
- CHAR_STRING debugText = 2;
+ OperationalCertStatus statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional CHAR_STRING debugText = 2;
}
response struct OpCSRResponse {
diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter
index f5dfa931f74242..f4cb76d33d3802 100644
--- a/examples/tv-app/tv-common/tv-app.matter
+++ b/examples/tv-app/tv-common/tv-app.matter
@@ -1434,7 +1434,7 @@ server cluster OnOff = 6 {
}
client cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -1495,7 +1495,7 @@ client cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct UpdateFabricLabelRequest {
@@ -1512,9 +1512,9 @@ client cluster OperationalCredentials = 62 {
}
response struct NOCResponse {
- INT8U statusCode = 0;
- INT8U fabricIndex = 1;
- CHAR_STRING debugText = 2;
+ OperationalCertStatus statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional CHAR_STRING debugText = 2;
}
response struct OpCSRResponse {
@@ -1532,7 +1532,7 @@ client cluster OperationalCredentials = 62 {
}
server cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -1593,7 +1593,7 @@ server cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct RemoveTrustedRootCertificateRequest {
@@ -1619,9 +1619,9 @@ server cluster OperationalCredentials = 62 {
}
response struct NOCResponse {
- INT8U statusCode = 0;
- INT8U fabricIndex = 1;
- CHAR_STRING debugText = 2;
+ OperationalCertStatus statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional CHAR_STRING debugText = 2;
}
response struct OpCSRResponse {
diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter
index 201f791afab394..86a64e07333c15 100644
--- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter
+++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter
@@ -2124,7 +2124,7 @@ server cluster OnOff = 6 {
}
server cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -2185,7 +2185,7 @@ server cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct RemoveTrustedRootCertificateRequest {
@@ -2211,9 +2211,9 @@ server cluster OperationalCredentials = 62 {
}
response struct NOCResponse {
- INT8U statusCode = 0;
- INT8U fabricIndex = 1;
- CHAR_STRING debugText = 2;
+ OperationalCertStatus statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional CHAR_STRING debugText = 2;
}
response struct OpCSRResponse {
diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter
index a4f63893fb43df..5a31da0c6d18e5 100644
--- a/examples/window-app/common/window-app.matter
+++ b/examples/window-app/common/window-app.matter
@@ -510,7 +510,7 @@ server cluster NetworkCommissioning = 49 {
}
server cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -571,7 +571,7 @@ server cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct RemoveTrustedRootCertificateRequest {
@@ -597,9 +597,9 @@ server cluster OperationalCredentials = 62 {
}
response struct NOCResponse {
- INT8U statusCode = 0;
- INT8U fabricIndex = 1;
- CHAR_STRING debugText = 2;
+ OperationalCertStatus statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional CHAR_STRING debugText = 2;
}
response struct OpCSRResponse {
diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp
index ede38add11da6a..c113b39ad90f2d 100644
--- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp
+++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp
@@ -57,6 +57,9 @@ using namespace chip::app::Clusters::OperationalCredentials;
namespace {
+CHIP_ERROR SendNOCResponse(app::CommandHandler * commandObj, const ConcreteCommandPath & path, OperationalCertStatus status,
+ uint8_t index, const CharSpan & debug_text);
+
constexpr uint8_t kDACCertificate = 1;
constexpr uint8_t kPAICertificate = 2;
@@ -364,17 +367,29 @@ bool emberAfOperationalCredentialsClusterRemoveFabricCallback(app::CommandHandle
emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: RemoveFabric"); // TODO: Generate emberAfFabricClusterPrintln
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
- CHIP_ERROR err = Server::GetInstance().GetFabricTable().Delete(fabricBeingRemoved);
- VerifyOrExit(err == CHIP_NO_ERROR, status = EMBER_ZCL_STATUS_FAILURE);
+ CHIP_ERROR err = Server::GetInstance().GetFabricTable().Delete(fabricBeingRemoved);
+ SuccessOrExit(err);
app::DnssdServer::Instance().StartServer();
exit:
fabricListChanged();
- emberAfSendImmediateDefaultResponse(status);
- if (err == CHIP_NO_ERROR)
+ // Not using ConvertToNOCResponseStatus here because it's pretty
+ // AddNOC/UpdateNOC specific.
+ if (err == CHIP_ERROR_NOT_FOUND)
+ {
+ SendNOCResponse(commandObj, commandPath, OperationalCertStatus::kInvalidFabricIndex, fabricBeingRemoved, CharSpan());
+ }
+ else if (err != CHIP_NO_ERROR)
+ {
+ // We have no idea what happened; just report failure.
+ StatusIB status(err);
+ commandObj->AddStatus(commandPath, status.mStatus);
+ }
+ else
{
+ SendNOCResponse(commandObj, commandPath, OperationalCertStatus::kSuccess, fabricBeingRemoved, CharSpan());
+
// Use a more direct getter for FabricIndex from commandObj
chip::Messaging::ExchangeContext * ec = commandObj->GetExchangeContext();
FabricIndex currentFabricIndex = commandObj->GetAccessingFabricIndex();
@@ -432,38 +447,38 @@ namespace {
// TODO: Manage ephemeral RCAC/ICAC/NOC storage to avoid a full FabricInfo being needed here.
FabricInfo gFabricBeingCommissioned;
-CHIP_ERROR SendNOCResponse(app::CommandHandler * commandObj, EmberAfNodeOperationalCertStatus status, uint8_t index,
- CharSpan debug_text)
+CHIP_ERROR SendNOCResponse(app::CommandHandler * commandObj, const ConcreteCommandPath & path, OperationalCertStatus status,
+ uint8_t index, const CharSpan & debug_text)
{
- app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), OperationalCredentials::Id, Commands::NOCResponse::Id };
- TLV::TLVWriter * writer = nullptr;
-
- VerifyOrReturnError(commandObj != nullptr, CHIP_ERROR_INCORRECT_STATE);
-
- ReturnErrorOnFailure(commandObj->PrepareCommand(path));
- writer = commandObj->GetCommandDataIBTLVWriter();
- ReturnErrorOnFailure(writer->Put(TLV::ContextTag(0), status));
- if (status == EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_SUCCESS)
+ Commands::NOCResponse::Type payload;
+ payload.statusCode = status;
+ if (status == OperationalCertStatus::kSuccess)
+ {
+ payload.fabricIndex.Emplace(index);
+ }
+ if (!debug_text.empty())
{
- ReturnErrorOnFailure(writer->Put(TLV::ContextTag(1), index));
+ // Max length of DebugText is 128 in the spec.
+ const CharSpan & to_send = debug_text.size() > 128 ? debug_text.SubSpan(0, 128) : debug_text;
+ payload.debugText.Emplace(to_send);
}
- ReturnErrorOnFailure(writer->PutString(TLV::ContextTag(2), debug_text));
- return commandObj->FinishCommand();
+
+ return commandObj->AddResponseData(path, payload);
}
-EmberAfNodeOperationalCertStatus ConvertToNOCResponseStatus(CHIP_ERROR err)
+OperationalCertStatus ConvertToNOCResponseStatus(CHIP_ERROR err)
{
if (err == CHIP_NO_ERROR)
{
- return EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_SUCCESS;
+ return OperationalCertStatus::kSuccess;
}
else if (err == CHIP_ERROR_INVALID_PUBLIC_KEY)
{
- return EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_INVALID_PUBLIC_KEY;
+ return OperationalCertStatus::kInvalidPublicKey;
}
else if (err == CHIP_ERROR_INVALID_FABRIC_ID || err == CHIP_ERROR_WRONG_NODE_ID)
{
- return EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_INVALID_NODE_OP_ID;
+ return OperationalCertStatus::kInvalidNodeOpId;
}
else if (err == CHIP_ERROR_CA_CERT_NOT_FOUND || err == CHIP_ERROR_CERT_PATH_LEN_CONSTRAINT_EXCEEDED ||
err == CHIP_ERROR_CERT_PATH_TOO_LONG || err == CHIP_ERROR_CERT_USAGE_NOT_ALLOWED || err == CHIP_ERROR_CERT_EXPIRED ||
@@ -471,14 +486,14 @@ EmberAfNodeOperationalCertStatus ConvertToNOCResponseStatus(CHIP_ERROR err)
err == CHIP_ERROR_UNSUPPORTED_ELLIPTIC_CURVE || err == CHIP_ERROR_CERT_LOAD_FAILED ||
err == CHIP_ERROR_CERT_NOT_TRUSTED || err == CHIP_ERROR_WRONG_CERT_SUBJECT)
{
- return EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_INVALID_NOC;
+ return OperationalCertStatus::kInvalidNOC;
}
else if (err == CHIP_ERROR_NO_MEMORY)
{
- return EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_TABLE_FULL;
+ return OperationalCertStatus::kTableFull;
}
- return EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_INVALID_NOC;
+ return OperationalCertStatus::kInvalidNOC;
}
} // namespace
@@ -491,7 +506,7 @@ bool emberAfOperationalCredentialsClusterAddNOCCallback(app::CommandHandler * co
auto & ICACValue = commandData.ICACValue;
auto & adminVendorId = commandData.adminVendorId;
- EmberAfNodeOperationalCertStatus nocResponse = EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_SUCCESS;
+ auto nocResponse = OperationalCertStatus::kSuccess;
CHIP_ERROR err = CHIP_NO_ERROR;
FabricIndex fabricIndex = 0;
@@ -526,11 +541,11 @@ bool emberAfOperationalCredentialsClusterAddNOCCallback(app::CommandHandler * co
exit:
gFabricBeingCommissioned.Reset();
- SendNOCResponse(commandObj, nocResponse, fabricIndex, CharSpan());
+ SendNOCResponse(commandObj, commandPath, nocResponse, fabricIndex, CharSpan());
- if (nocResponse != EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_SUCCESS)
+ if (nocResponse != OperationalCertStatus::kSuccess)
{
- emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: Failed AddNOC request. Status %d", nocResponse);
+ emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: Failed AddNOC request. Status %d", to_underlying(nocResponse));
}
else
{
@@ -547,7 +562,7 @@ bool emberAfOperationalCredentialsClusterUpdateNOCCallback(app::CommandHandler *
auto & NOCValue = commandData.NOCValue;
auto & ICACValue = commandData.ICACValue;
- EmberAfNodeOperationalCertStatus nocResponse = EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_SUCCESS;
+ auto nocResponse = OperationalCertStatus::kSuccess;
CHIP_ERROR err = CHIP_NO_ERROR;
FabricIndex fabricIndex = 0;
@@ -574,11 +589,11 @@ bool emberAfOperationalCredentialsClusterUpdateNOCCallback(app::CommandHandler *
exit:
- SendNOCResponse(commandObj, nocResponse, fabricIndex, CharSpan());
+ SendNOCResponse(commandObj, commandPath, nocResponse, fabricIndex, CharSpan());
- if (nocResponse != EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_SUCCESS)
+ if (nocResponse != OperationalCertStatus::kSuccess)
{
- emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: Failed UpdateNOC request. Status %d", nocResponse);
+ emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: Failed UpdateNOC request. Status %d", to_underlying(nocResponse));
}
else
{
diff --git a/src/app/tests/suites/TestOperationalCredentialsCluster.yaml b/src/app/tests/suites/TestOperationalCredentialsCluster.yaml
index fd3563b7db1531..6b56cf330b678c 100644
--- a/src/app/tests/suites/TestOperationalCredentialsCluster.yaml
+++ b/src/app/tests/suites/TestOperationalCredentialsCluster.yaml
@@ -60,3 +60,14 @@ tests:
values:
- name: "FabricIndex"
value: 1
+
+ - label: "Remove nonexistent fabric"
+ command: "RemoveFabric"
+ arguments:
+ values:
+ - name: "FabricIndex"
+ value: 243 # Pretty unlikely to have that here!
+ response:
+ values:
+ - name: "StatusCode"
+ value: 11 # InvalidFabricIndex
diff --git a/src/app/zap-templates/templates/app/helper.js b/src/app/zap-templates/templates/app/helper.js
index 17820cb246c26a..06c068cf17c36a 100644
--- a/src/app/zap-templates/templates/app/helper.js
+++ b/src/app/zap-templates/templates/app/helper.js
@@ -773,7 +773,6 @@ function isWeaklyTypedEnum(label)
"LevelControlOptions",
"MoveMode",
"NetworkFaultType",
- "NodeOperationalCertStatus",
"OnOffDelayedAllOffEffectVariant",
"OnOffDyingLightEffectVariant",
"OnOffEffectIdentifier",
diff --git a/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml
index a8b9cb783995ec..f319f82a109a33 100644
--- a/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml
+++ b/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml
@@ -27,7 +27,7 @@ limitations under the License.
-
+
@@ -113,9 +113,9 @@ limitations under the License.
Response to AddNOC or UpdateNOC commands.
-
-
-
+
+
+
@@ -125,7 +125,7 @@ limitations under the License.
This command is used by Administrative Nodes to remove a given fabric index and delete all associated fabric-scoped data.
-
+
diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp
index 5014d44f37f1b1..b4f73dd0229d1b 100644
--- a/src/controller/CHIPDeviceController.cpp
+++ b/src/controller/CHIPDeviceController.cpp
@@ -1284,27 +1284,28 @@ CHIP_ERROR DeviceCommissioner::SendOperationalCertificate(DeviceProxy * device,
return CHIP_NO_ERROR;
}
-CHIP_ERROR DeviceCommissioner::ConvertFromNodeOperationalCertStatus(uint8_t err)
+CHIP_ERROR DeviceCommissioner::ConvertFromOperationalCertStatus(OperationalCredentials::OperationalCertStatus err)
{
+ using OperationalCredentials::OperationalCertStatus;
switch (err)
{
- case EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_SUCCESS:
+ case OperationalCertStatus::kSuccess:
return CHIP_NO_ERROR;
- case EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_INVALID_PUBLIC_KEY:
+ case OperationalCertStatus::kInvalidPublicKey:
return CHIP_ERROR_INVALID_PUBLIC_KEY;
- case EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_INVALID_NODE_OP_ID:
+ case OperationalCertStatus::kInvalidNodeOpId:
return CHIP_ERROR_WRONG_NODE_ID;
- case EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_INVALID_NOC:
- return CHIP_ERROR_CERT_LOAD_FAILED;
- case EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_MISSING_CSR:
+ case OperationalCertStatus::kInvalidNOC:
+ return CHIP_ERROR_UNSUPPORTED_CERT_FORMAT;
+ case OperationalCertStatus::kMissingCsr:
return CHIP_ERROR_INCORRECT_STATE;
- case EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_TABLE_FULL:
+ case OperationalCertStatus::kTableFull:
return CHIP_ERROR_NO_MEMORY;
- case EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_INSUFFICIENT_PRIVILEGE:
- case EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_FABRIC_CONFLICT:
- case EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_LABEL_CONFLICT:
+ case OperationalCertStatus::kInsufficientPrivilege:
+ case OperationalCertStatus::kFabricConflict:
+ case OperationalCertStatus::kLabelConflict:
return CHIP_ERROR_INVALID_ARGUMENT;
- case EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_INVALID_FABRIC_INDEX:
+ case OperationalCertStatus::kInvalidFabricIndex:
return CHIP_ERROR_INVALID_FABRIC_ID;
}
@@ -1321,7 +1322,7 @@ void DeviceCommissioner::OnAddNOCFailureResponse(void * context, CHIP_ERROR erro
void DeviceCommissioner::OnOperationalCertificateAddResponse(
void * context, const OperationalCredentials::Commands::NOCResponse::DecodableType & data)
{
- ChipLogProgress(Controller, "Device returned status %d on receiving the NOC", data.statusCode);
+ ChipLogProgress(Controller, "Device returned status %d on receiving the NOC", to_underlying(data.statusCode));
DeviceCommissioner * commissioner = static_cast(context);
CHIP_ERROR err = CHIP_NO_ERROR;
@@ -1331,7 +1332,7 @@ void DeviceCommissioner::OnOperationalCertificateAddResponse(
VerifyOrExit(commissioner->mDeviceBeingCommissioned != nullptr, err = CHIP_ERROR_INCORRECT_STATE);
- err = ConvertFromNodeOperationalCertStatus(data.statusCode);
+ err = ConvertFromOperationalCertStatus(data.statusCode);
SuccessOrExit(err);
device = commissioner->mDeviceBeingCommissioned;
diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h
index 80beefd4a48fc9..19d0d03793d123 100644
--- a/src/controller/CHIPDeviceController.h
+++ b/src/controller/CHIPDeviceController.h
@@ -852,7 +852,7 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController,
return cluster.InvokeCommand(request, this, successCb, failureCb);
}
- static CHIP_ERROR ConvertFromNodeOperationalCertStatus(uint8_t err);
+ static CHIP_ERROR ConvertFromOperationalCertStatus(chip::app::Clusters::OperationalCredentials::OperationalCertStatus err);
chip::Callback::Callback mOnDeviceConnectedCallback;
chip::Callback::Callback mOnDeviceConnectionFailureCallback;
diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter
index d4f0f0223876ab..7d6b56b4be6112 100644
--- a/src/controller/data_model/controller-clusters.matter
+++ b/src/controller/data_model/controller-clusters.matter
@@ -2688,7 +2688,7 @@ client cluster OnOffSwitchConfiguration = 7 {
}
client cluster OperationalCredentials = 62 {
- enum NodeOperationalCertStatus : ENUM8 {
+ enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
@@ -2752,7 +2752,7 @@ client cluster OperationalCredentials = 62 {
}
request struct RemoveFabricRequest {
- INT8U fabricIndex = 0;
+ fabric_idx fabricIndex = 0;
}
request struct RemoveTrustedRootCertificateRequest {
@@ -2778,9 +2778,9 @@ client cluster OperationalCredentials = 62 {
}
response struct NOCResponse {
- INT8U statusCode = 0;
- INT8U fabricIndex = 1;
- CHAR_STRING debugText = 2;
+ OperationalCertStatus statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional CHAR_STRING debugText = 2;
}
response struct OpCSRResponse {
diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp
index 961897f52a175a..ca51adcd1ab644 100644
--- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp
+++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp
@@ -2584,21 +2584,36 @@ void CHIPOperationalCredentialsClusterNOCResponseCallback::CallbackFn(
VerifyOrReturn(javaCallbackRef != nullptr);
err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess",
- "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;)V", &javaMethod);
+ "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", &javaMethod);
VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err)));
jobject StatusCode;
std::string StatusCodeClassName = "java/lang/Integer";
std::string StatusCodeCtorSignature = "(I)V";
chip::JniReferences::GetInstance().CreateBoxedObject(StatusCodeClassName.c_str(), StatusCodeCtorSignature.c_str(),
- dataResponse.statusCode, StatusCode);
+ static_cast(dataResponse.statusCode), StatusCode);
jobject FabricIndex;
- std::string FabricIndexClassName = "java/lang/Integer";
- std::string FabricIndexCtorSignature = "(I)V";
- chip::JniReferences::GetInstance().CreateBoxedObject(FabricIndexClassName.c_str(), FabricIndexCtorSignature.c_str(),
- dataResponse.fabricIndex, FabricIndex);
+ if (!dataResponse.fabricIndex.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr, FabricIndex);
+ }
+ else
+ {
+ std::string FabricIndexClassName = "java/lang/Integer";
+ std::string FabricIndexCtorSignature = "(I)V";
+ chip::JniReferences::GetInstance().CreateBoxedObject(
+ FabricIndexClassName.c_str(), FabricIndexCtorSignature.c_str(), dataResponse.fabricIndex.Value(), FabricIndex);
+ }
jobject DebugText;
- DebugText = env->NewStringUTF(std::string(dataResponse.debugText.data(), dataResponse.debugText.size()).c_str());
+ if (!dataResponse.debugText.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr, DebugText);
+ }
+ else
+ {
+ DebugText =
+ env->NewStringUTF(std::string(dataResponse.debugText.Value().data(), dataResponse.debugText.Value().size()).c_str());
+ }
env->CallVoidMethod(javaCallbackRef, javaMethod, StatusCode, FabricIndex, DebugText);
}
diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java
index 013c4449b4c54f..cb1b890546a46b 100644
--- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java
+++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java
@@ -12736,7 +12736,7 @@ public interface CertificateChainResponseCallback {
}
public interface NOCResponseCallback {
- void onSuccess(Integer statusCode, Integer fabricIndex, String debugText);
+ void onSuccess(Integer statusCode, Optional fabricIndex, Optional debugText);
void onError(Exception error);
}
diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java
index 0470d03b76502e..35f4a3d29e9e36 100644
--- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java
+++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java
@@ -4652,15 +4652,17 @@ public void setCallbackDelegate(ClusterCommandCallback callback) {
}
@Override
- public void onSuccess(Integer StatusCode, Integer FabricIndex, String DebugText) {
+ public void onSuccess(
+ Integer StatusCode, Optional FabricIndex, Optional DebugText) {
Map responseValues = new LinkedHashMap<>();
CommandResponseInfo StatusCodeResponseValue =
new CommandResponseInfo("StatusCode", "Integer");
responseValues.put(StatusCodeResponseValue, StatusCode);
CommandResponseInfo FabricIndexResponseValue =
- new CommandResponseInfo("FabricIndex", "Integer");
+ new CommandResponseInfo("FabricIndex", "Optional");
responseValues.put(FabricIndexResponseValue, FabricIndex);
- CommandResponseInfo DebugTextResponseValue = new CommandResponseInfo("DebugText", "String");
+ CommandResponseInfo DebugTextResponseValue =
+ new CommandResponseInfo("DebugText", "Optional");
responseValues.put(DebugTextResponseValue, DebugText);
callback.onSuccess(responseValues);
}
diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py
index 76ceded3bdeb1e..5ee4a97ed76843 100644
--- a/src/controller/python/chip/clusters/Objects.py
+++ b/src/controller/python/chip/clusters/Objects.py
@@ -14068,7 +14068,7 @@ def descriptor(cls) -> ClusterObjectDescriptor:
clusterRevision: 'uint' = None
class Enums:
- class NodeOperationalCertStatus(IntEnum):
+ class OperationalCertStatus(IntEnum):
kSuccess = 0x00
kInvalidPublicKey = 0x01
kInvalidNodeOpId = 0x02
@@ -14265,14 +14265,14 @@ class NOCResponse(ClusterCommand):
def descriptor(cls) -> ClusterObjectDescriptor:
return ClusterObjectDescriptor(
Fields = [
- ClusterObjectFieldDescriptor(Label="statusCode", Tag=0, Type=uint),
- ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=1, Type=uint),
- ClusterObjectFieldDescriptor(Label="debugText", Tag=2, Type=str),
+ ClusterObjectFieldDescriptor(Label="statusCode", Tag=0, Type=OperationalCredentials.Enums.OperationalCertStatus),
+ ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=1, Type=typing.Optional[uint]),
+ ClusterObjectFieldDescriptor(Label="debugText", Tag=2, Type=typing.Optional[str]),
])
- statusCode: 'uint' = 0
- fabricIndex: 'uint' = 0
- debugText: 'str' = ""
+ statusCode: 'OperationalCredentials.Enums.OperationalCertStatus' = 0
+ fabricIndex: 'typing.Optional[uint]' = None
+ debugText: 'typing.Optional[str]' = None
@dataclass
class UpdateFabricLabel(ClusterCommand):
diff --git a/src/credentials/FabricTable.cpp b/src/credentials/FabricTable.cpp
index 114c954e3f1487..d53d87471daacf 100644
--- a/src/credentials/FabricTable.cpp
+++ b/src/credentials/FabricTable.cpp
@@ -615,6 +615,10 @@ CHIP_ERROR FabricTable::Delete(FabricIndex index)
mDelegate->OnFabricDeletedFromStorage(index);
}
}
+ if (!fabricIsInitialized)
+ {
+ return CHIP_ERROR_NOT_FOUND;
+ }
return CHIP_NO_ERROR;
}
diff --git a/src/credentials/FabricTable.h b/src/credentials/FabricTable.h
index f4b67b7e46415e..532b25a28ff76f 100644
--- a/src/credentials/FabricTable.h
+++ b/src/credentials/FabricTable.h
@@ -405,6 +405,7 @@ class DLL_EXPORT FabricTable
CHIP_ERROR Store(FabricIndex index);
CHIP_ERROR LoadFromStorage(FabricInfo * info);
+ // Returns CHIP_ERROR_NOT_FOUND if there is no fabric for that index.
CHIP_ERROR Delete(FabricIndex index);
void DeleteAllFabrics();
diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm
index d82f8f1d15d5cd..fa1dabd908afa5 100644
--- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm
@@ -10411,15 +10411,23 @@
{
auto * response = [CHIPOperationalCredentialsClusterNOCResponseParams new];
{
- response.statusCode = [NSNumber numberWithUnsignedChar:data.statusCode];
+ response.statusCode = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.statusCode)];
}
{
- response.fabricIndex = [NSNumber numberWithUnsignedChar:data.fabricIndex];
+ if (data.fabricIndex.HasValue()) {
+ response.fabricIndex = [NSNumber numberWithUnsignedChar:data.fabricIndex.Value()];
+ } else {
+ response.fabricIndex = nil;
+ }
}
{
- response.debugText = [[NSString alloc] initWithBytes:data.debugText.data()
- length:data.debugText.size()
- encoding:NSUTF8StringEncoding];
+ if (data.debugText.HasValue()) {
+ response.debugText = [[NSString alloc] initWithBytes:data.debugText.Value().data()
+ length:data.debugText.Value().size()
+ encoding:NSUTF8StringEncoding];
+ } else {
+ response.debugText = nil;
+ }
}
DispatchSuccess(context, response);
};
@@ -13830,19 +13838,18 @@
}
}
-void CHIPOperationalCredentialsClusterNodeOperationalCertStatusAttributeCallbackBridge::OnSuccessFn(
- void * context, chip::app::Clusters::OperationalCredentials::NodeOperationalCertStatus value)
+void CHIPOperationalCredentialsClusterOperationalCertStatusAttributeCallbackBridge::OnSuccessFn(
+ void * context, chip::app::Clusters::OperationalCredentials::OperationalCertStatus value)
{
NSNumber * _Nonnull objCValue;
objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)];
DispatchSuccess(context, objCValue);
};
-void CHIPOperationalCredentialsClusterNodeOperationalCertStatusAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(
+void CHIPOperationalCredentialsClusterOperationalCertStatusAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(
void * context)
{
- auto * self
- = static_cast(context);
+ auto * self = static_cast(context);
if (!self->mQueue) {
return;
}
@@ -13856,8 +13863,8 @@
}
}
-void CHIPNullableOperationalCredentialsClusterNodeOperationalCertStatusAttributeCallbackBridge::OnSuccessFn(void * context,
- const chip::app::DataModel::Nullable & value)
+void CHIPNullableOperationalCredentialsClusterOperationalCertStatusAttributeCallbackBridge::OnSuccessFn(void * context,
+ const chip::app::DataModel::Nullable & value)
{
NSNumber * _Nullable objCValue;
if (value.IsNull()) {
@@ -13868,12 +13875,11 @@
DispatchSuccess(context, objCValue);
};
-void CHIPNullableOperationalCredentialsClusterNodeOperationalCertStatusAttributeCallbackSubscriptionBridge::
- OnSubscriptionEstablished(void * context)
+void CHIPNullableOperationalCredentialsClusterOperationalCertStatusAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(
+ void * context)
{
auto * self
- = static_cast(
- context);
+ = static_cast(context);
if (!self->mQueue) {
return;
}
diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h
index 832f2f4e477fa3..3fd303407845dc 100644
--- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h
+++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h
@@ -331,10 +331,10 @@ typedef void (*AdministratorCommissioningClusterStatusCodeAttributeCallback)(
void *, chip::app::Clusters::AdministratorCommissioning::StatusCode);
typedef void (*NullableAdministratorCommissioningClusterStatusCodeAttributeCallback)(
void *, const chip::app::DataModel::Nullable &);
-typedef void (*OperationalCredentialsClusterNodeOperationalCertStatusAttributeCallback)(
- void *, chip::app::Clusters::OperationalCredentials::NodeOperationalCertStatus);
-typedef void (*NullableOperationalCredentialsClusterNodeOperationalCertStatusAttributeCallback)(
- void *, const chip::app::DataModel::Nullable &);
+typedef void (*OperationalCredentialsClusterOperationalCertStatusAttributeCallback)(
+ void *, chip::app::Clusters::OperationalCredentials::OperationalCertStatus);
+typedef void (*NullableOperationalCredentialsClusterOperationalCertStatusAttributeCallback)(
+ void *, const chip::app::DataModel::Nullable &);
typedef void (*GroupKeyManagementClusterGroupKeySecurityPolicyAttributeCallback)(
void *, chip::app::Clusters::GroupKeyManagement::GroupKeySecurityPolicy);
typedef void (*NullableGroupKeyManagementClusterGroupKeySecurityPolicyAttributeCallback)(
@@ -11558,28 +11558,26 @@ class CHIPNullableAdministratorCommissioningClusterStatusCodeAttributeCallbackSu
SubscriptionEstablishedHandler mEstablishedHandler;
};
-class CHIPOperationalCredentialsClusterNodeOperationalCertStatusAttributeCallbackBridge
- : public CHIPCallbackBridge
+class CHIPOperationalCredentialsClusterOperationalCertStatusAttributeCallbackBridge
+ : public CHIPCallbackBridge
{
public:
- CHIPOperationalCredentialsClusterNodeOperationalCertStatusAttributeCallbackBridge(dispatch_queue_t queue,
- ResponseHandler handler,
- CHIPActionBlock action,
- bool keepAlive = false) :
- CHIPCallbackBridge(queue, handler, action,
- OnSuccessFn, keepAlive){};
+ CHIPOperationalCredentialsClusterOperationalCertStatusAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler,
+ CHIPActionBlock action, bool keepAlive = false) :
+ CHIPCallbackBridge(queue, handler, action, OnSuccessFn,
+ keepAlive){};
- static void OnSuccessFn(void * context, chip::app::Clusters::OperationalCredentials::NodeOperationalCertStatus value);
+ static void OnSuccessFn(void * context, chip::app::Clusters::OperationalCredentials::OperationalCertStatus value);
};
-class CHIPOperationalCredentialsClusterNodeOperationalCertStatusAttributeCallbackSubscriptionBridge
- : public CHIPOperationalCredentialsClusterNodeOperationalCertStatusAttributeCallbackBridge
+class CHIPOperationalCredentialsClusterOperationalCertStatusAttributeCallbackSubscriptionBridge
+ : public CHIPOperationalCredentialsClusterOperationalCertStatusAttributeCallbackBridge
{
public:
- CHIPOperationalCredentialsClusterNodeOperationalCertStatusAttributeCallbackSubscriptionBridge(
+ CHIPOperationalCredentialsClusterOperationalCertStatusAttributeCallbackSubscriptionBridge(
dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action,
SubscriptionEstablishedHandler establishedHandler) :
- CHIPOperationalCredentialsClusterNodeOperationalCertStatusAttributeCallbackBridge(queue, handler, action, true),
+ CHIPOperationalCredentialsClusterOperationalCertStatusAttributeCallbackBridge(queue, handler, action, true),
mEstablishedHandler(establishedHandler)
{}
@@ -11589,30 +11587,30 @@ class CHIPOperationalCredentialsClusterNodeOperationalCertStatusAttributeCallbac
SubscriptionEstablishedHandler mEstablishedHandler;
};
-class CHIPNullableOperationalCredentialsClusterNodeOperationalCertStatusAttributeCallbackBridge
- : public CHIPCallbackBridge
+class CHIPNullableOperationalCredentialsClusterOperationalCertStatusAttributeCallbackBridge
+ : public CHIPCallbackBridge
{
public:
- CHIPNullableOperationalCredentialsClusterNodeOperationalCertStatusAttributeCallbackBridge(dispatch_queue_t queue,
- ResponseHandler handler,
- CHIPActionBlock action,
- bool keepAlive = false) :
- CHIPCallbackBridge(
- queue, handler, action, OnSuccessFn, keepAlive){};
+ CHIPNullableOperationalCredentialsClusterOperationalCertStatusAttributeCallbackBridge(dispatch_queue_t queue,
+ ResponseHandler handler,
+ CHIPActionBlock action,
+ bool keepAlive = false) :
+ CHIPCallbackBridge(queue, handler, action,
+ OnSuccessFn, keepAlive){};
- static void OnSuccessFn(
- void * context,
- const chip::app::DataModel::Nullable & value);
+ static void
+ OnSuccessFn(void * context,
+ const chip::app::DataModel::Nullable & value);
};
-class CHIPNullableOperationalCredentialsClusterNodeOperationalCertStatusAttributeCallbackSubscriptionBridge
- : public CHIPNullableOperationalCredentialsClusterNodeOperationalCertStatusAttributeCallbackBridge
+class CHIPNullableOperationalCredentialsClusterOperationalCertStatusAttributeCallbackSubscriptionBridge
+ : public CHIPNullableOperationalCredentialsClusterOperationalCertStatusAttributeCallbackBridge
{
public:
- CHIPNullableOperationalCredentialsClusterNodeOperationalCertStatusAttributeCallbackSubscriptionBridge(
+ CHIPNullableOperationalCredentialsClusterOperationalCertStatusAttributeCallbackSubscriptionBridge(
dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action,
SubscriptionEstablishedHandler establishedHandler) :
- CHIPNullableOperationalCredentialsClusterNodeOperationalCertStatusAttributeCallbackBridge(queue, handler, action, true),
+ CHIPNullableOperationalCredentialsClusterOperationalCertStatusAttributeCallbackBridge(queue, handler, action, true),
mEstablishedHandler(establishedHandler)
{}
diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h
index 38b3d0d834deda..1d702c6c0bf917 100644
--- a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h
+++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h
@@ -801,8 +801,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface CHIPOperationalCredentialsClusterNOCResponseParams : NSObject
@property (strong, nonatomic) NSNumber * _Nonnull statusCode;
-@property (strong, nonatomic) NSNumber * _Nonnull fabricIndex;
-@property (strong, nonatomic) NSString * _Nonnull debugText;
+@property (strong, nonatomic) NSNumber * _Nullable fabricIndex;
+@property (strong, nonatomic) NSString * _Nullable debugText;
- (instancetype)init;
@end
diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm
index d5c745df59d1a0..0a929d982a9206 100644
--- a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm
@@ -1692,9 +1692,9 @@ - (instancetype)init
_statusCode = @(0);
- _fabricIndex = @(0);
+ _fabricIndex = nil;
- _debugText = @"";
+ _debugText = nil;
}
return self;
}
diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m
index d22c9944803ec2..2428a0275298e8 100644
--- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m
+++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m
@@ -41881,6 +41881,36 @@ - (void)testSendClusterTestOperationalCredentialsCluster_000003_ReadAttribute
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
+- (void)testSendClusterTestOperationalCredentialsCluster_000004_RemoveFabric
+{
+ XCTestExpectation * expectation = [self expectationWithDescription:@"Remove nonexistent fabric"];
+
+ CHIPDevice * device = GetConnectedDevice();
+ dispatch_queue_t queue = dispatch_get_main_queue();
+ CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device
+ endpoint:0
+ queue:queue];
+ XCTAssertNotNil(cluster);
+
+ __auto_type * params = [[CHIPOperationalCredentialsClusterRemoveFabricParams alloc] init];
+ params.fabricIndex = [NSNumber numberWithUnsignedChar:243];
+ [cluster
+ removeFabricWithParams:params
+ completionHandler:^(CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) {
+ NSLog(@"Remove nonexistent fabric Error: %@", err);
+
+ XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0);
+
+ {
+ id actualValue = values.statusCode;
+ XCTAssertEqual([actualValue unsignedCharValue], 11);
+ }
+
+ [expectation fulfill];
+ }];
+
+ [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
+}
- (void)testSendClusterTestModeSelectCluster_000000_WaitForCommissionee
{
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 f15f761d16f41c..c91c5596e9dfd0 100644
--- a/zzz_generated/app-common/app-common/zap-generated/callback.h
+++ b/zzz_generated/app-common/app-common/zap-generated/callback.h
@@ -14083,7 +14083,8 @@ bool emberAfOperationalCredentialsClusterUpdateNOCCallback(
* @brief Operational Credentials Cluster NOCResponse Command callback (from server)
*/
bool emberAfOperationalCredentialsClusterNOCResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj,
- uint8_t StatusCode, uint8_t FabricIndex, chip::CharSpan DebugText);
+ uint8_t StatusCode, chip::FabricIndex FabricIndex,
+ chip::CharSpan DebugText);
/**
* @brief Operational Credentials Cluster UpdateFabricLabel Command callback (from client)
*/
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 33a6c8e9f14bd4..7eae053e920885 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
@@ -15742,11 +15742,8 @@ struct TypeInfo
} // namespace Attributes
} // namespace AdministratorCommissioning
namespace OperationalCredentials {
-// Need to convert consumers to using the new enum classes, so we
-// don't just have casts all over.
-#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM
-// Enum for NodeOperationalCertStatus
-enum class NodeOperationalCertStatus : uint8_t
+// Enum for OperationalCertStatus
+enum class OperationalCertStatus : uint8_t
{
kSuccess = 0x00,
kInvalidPublicKey = 0x01,
@@ -15759,9 +15756,6 @@ enum class NodeOperationalCertStatus : uint8_t
kLabelConflict = 0x0A,
kInvalidFabricIndex = 0x0B,
};
-#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM
-using NodeOperationalCertStatus = EmberAfNodeOperationalCertStatus;
-#endif
namespace Structs {
namespace FabricDescriptor {
@@ -16191,9 +16185,9 @@ struct Type
static constexpr CommandId GetCommandId() { return Commands::NOCResponse::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
- uint8_t statusCode = static_cast(0);
- uint8_t fabricIndex = static_cast(0);
- chip::CharSpan debugText;
+ OperationalCertStatus statusCode = static_cast(0);
+ Optional fabricIndex;
+ Optional debugText;
CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const;
@@ -16208,9 +16202,9 @@ struct DecodableType
static constexpr CommandId GetCommandId() { return Commands::NOCResponse::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
- uint8_t statusCode = static_cast(0);
- uint8_t fabricIndex = static_cast(0);
- chip::CharSpan debugText;
+ OperationalCertStatus statusCode = static_cast(0);
+ Optional fabricIndex;
+ Optional debugText;
CHIP_ERROR Decode(TLV::TLVReader & reader);
};
}; // namespace NOCResponse
@@ -16259,7 +16253,7 @@ struct Type
static constexpr CommandId GetCommandId() { return Commands::RemoveFabric::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
- uint8_t fabricIndex = static_cast(0);
+ chip::FabricIndex fabricIndex = static_cast(0);
CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const;
@@ -16274,7 +16268,7 @@ struct DecodableType
static constexpr CommandId GetCommandId() { return Commands::RemoveFabric::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
- uint8_t fabricIndex = static_cast(0);
+ chip::FabricIndex fabricIndex = static_cast(0);
CHIP_ERROR Decode(TLV::TLVReader & reader);
};
}; // namespace RemoveFabric
diff --git a/zzz_generated/app-common/app-common/zap-generated/enums.h b/zzz_generated/app-common/app-common/zap-generated/enums.h
index 1b1bc9256aab6d..096bf70358add6 100644
--- a/zzz_generated/app-common/app-common/zap-generated/enums.h
+++ b/zzz_generated/app-common/app-common/zap-generated/enums.h
@@ -350,21 +350,6 @@ enum EmberAfNetworkFaultType : uint8_t
EMBER_ZCL_NETWORK_FAULT_TYPE_CONNECTION_FAILED = 3,
};
-// Enum for NodeOperationalCertStatus
-enum EmberAfNodeOperationalCertStatus : uint8_t
-{
- EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_SUCCESS = 0,
- EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_INVALID_PUBLIC_KEY = 1,
- EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_INVALID_NODE_OP_ID = 2,
- EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_INVALID_NOC = 3,
- EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_MISSING_CSR = 4,
- EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_TABLE_FULL = 5,
- EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_INSUFFICIENT_PRIVILEGE = 8,
- EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_FABRIC_CONFLICT = 9,
- EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_LABEL_CONFLICT = 10,
- EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_INVALID_FABRIC_INDEX = 11,
-};
-
// Enum for OnOffDelayedAllOffEffectVariant
enum EmberAfOnOffDelayedAllOffEffectVariant : uint8_t
{
diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h
index 00c66eb18fc40d..9215078abca9c1 100644
--- a/zzz_generated/chip-tool/zap-generated/test/Commands.h
+++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h
@@ -72724,6 +72724,10 @@ class TestOperationalCredentialsCluster : public TestCommand
ChipLogProgress(chipTool, " ***** Test Step 3 : Read current fabric index\n");
err = TestReadCurrentFabricIndex_3();
break;
+ case 4:
+ ChipLogProgress(chipTool, " ***** Test Step 4 : Remove nonexistent fabric\n");
+ err = TestRemoveNonexistentFabric_4();
+ break;
}
if (CHIP_NO_ERROR != err)
@@ -72735,7 +72739,7 @@ class TestOperationalCredentialsCluster : public TestCommand
private:
std::atomic_uint16_t mTestIndex;
- const uint16_t mTestCount = 4;
+ const uint16_t mTestCount = 5;
chip::Optional mCluster;
chip::Optional mEndpoint;
@@ -72854,6 +72858,42 @@ class TestOperationalCredentialsCluster : public TestCommand
VerifyOrReturn(CheckConstraintMinValue("currentFabricIndex", currentFabricIndex, 1));
NextTest();
}
+
+ CHIP_ERROR TestRemoveNonexistentFabric_4()
+ {
+ const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0;
+ using RequestType = chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type;
+
+ RequestType request;
+ request.fabricIndex = 243;
+
+ auto success = [](void * context, const typename RequestType::ResponseType & data) {
+ (static_cast(context))
+ ->OnSuccessResponse_4(data.statusCode, data.fabricIndex, data.debugText);
+ };
+
+ auto failure = [](void * context, CHIP_ERROR error) {
+ (static_cast(context))->OnFailureResponse_4(error);
+ };
+
+ ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request));
+ return CHIP_NO_ERROR;
+ }
+
+ void OnFailureResponse_4(CHIP_ERROR error)
+ {
+ chip::app::StatusIB status(error);
+ ThrowFailureResponse();
+ }
+
+ void OnSuccessResponse_4(chip::app::Clusters::OperationalCredentials::OperationalCertStatus statusCode,
+ const chip::Optional & fabricIndex,
+ const chip::Optional & debugText)
+ {
+ VerifyOrReturn(CheckValue("statusCode", statusCode, 11));
+
+ NextTest();
+ }
};
class TestModeSelectCluster : public TestCommand
diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp
deleted file mode 100644
index a4a3f5fe8318c1..00000000000000
--- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp
+++ /dev/null
@@ -1,3137 +0,0 @@
-/*
- *
- * Copyright (c) 2022 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.
- */
-
-// THIS FILE IS GENERATED BY ZAP
-
-#include
-
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-using namespace ::chip;
-using namespace ::chip::app::DataModel;
-
-namespace {
-[[maybe_unused]] constexpr uint16_t kByteSpanSizeLengthInBytes = 2;
-} // namespace
-
-#define CHECK_STATUS_WITH_RETVAL(error, retval) \
- if (CHIP_NO_ERROR != error) \
- { \
- ChipLogError(Zcl, "CHECK_STATUS %s", ErrorStr(error)); \
- if (onFailureCallback != nullptr) \
- { \
- Callback::Callback * cb = \
- Callback::Callback::FromCancelable(onFailureCallback); \
- cb->mCall(cb->mContext, static_cast(EMBER_ZCL_STATUS_INVALID_VALUE)); \
- } \
- return retval; \
- }
-
-#define CHECK_STATUS(error) CHECK_STATUS_WITH_RETVAL(error, true)
-#define CHECK_STATUS_VOID(error) CHECK_STATUS_WITH_RETVAL(error, )
-
-#define CHECK_MESSAGE_LENGTH_WITH_RETVAL(value, retval) \
- if (!CanCastTo(value)) \
- { \
- ChipLogError(Zcl, "CHECK_MESSAGE_LENGTH expects a uint16_t value, got: %d", value); \
- if (onFailureCallback != nullptr) \
- { \
- Callback::Callback * cb = \
- Callback::Callback::FromCancelable(onFailureCallback); \
- cb->mCall(cb->mContext, static_cast(EMBER_ZCL_STATUS_INVALID_VALUE)); \
- } \
- return retval; \
- } \
- \
- if (messageLen < value) \
- { \
- ChipLogError(Zcl, "Unexpected response length: %d", messageLen); \
- if (onFailureCallback != nullptr) \
- { \
- Callback::Callback * cb = \
- Callback::Callback::FromCancelable(onFailureCallback); \
- cb->mCall(cb->mContext, static_cast(EMBER_ZCL_STATUS_INVALID_VALUE)); \
- } \
- return retval; \
- } \
- \
- messageLen = static_cast(messageLen - static_cast(value));
-
-#define CHECK_MESSAGE_LENGTH(value) CHECK_MESSAGE_LENGTH_WITH_RETVAL(value, true)
-#define CHECK_MESSAGE_LENGTH_VOID(value) CHECK_MESSAGE_LENGTH_WITH_RETVAL(value, )
-
-#define GET_RESPONSE_CALLBACKS(name) \
- Callback::Cancelable * onSuccessCallback = nullptr; \
- Callback::Cancelable * onFailureCallback = nullptr; \
- NodeId sourceId = emberAfCurrentCommand()->SourceNodeId(); \
- uint8_t sequenceNumber = emberAfCurrentCommand()->seqNum; \
- CHIP_ERROR err = gCallbacks.GetResponseCallback(sourceId, sequenceNumber, &onSuccessCallback, &onFailureCallback); \
- \
- if (CHIP_NO_ERROR != err) \
- { \
- if (onSuccessCallback == nullptr) \
- { \
- ChipLogDetail(Zcl, "%s: Missing success callback", name); \
- } \
- \
- if (onFailureCallback == nullptr) \
- { \
- ChipLogDetail(Zcl, "%s: Missing failure callback", name); \
- } \
- \
- return true; \
- }
-
-#define GET_CLUSTER_RESPONSE_CALLBACKS(name) \
- Callback::Cancelable * onSuccessCallback = nullptr; \
- Callback::Cancelable * onFailureCallback = nullptr; \
- NodeId sourceIdentifier = reinterpret_cast(commandObj); \
- /* #6559: Currently, we only have one commands for the IMInvokeCommands and to a device, so the seqNum is always set to 0. */ \
- CHIP_ERROR err = gCallbacks.GetResponseCallback(sourceIdentifier, 0, &onSuccessCallback, &onFailureCallback); \
- \
- if (CHIP_NO_ERROR != err) \
- { \
- if (onSuccessCallback == nullptr) \
- { \
- ChipLogDetail(Zcl, "%s: Missing success callback", name); \
- } \
- \
- if (onFailureCallback == nullptr) \
- { \
- ChipLogDetail(Zcl, "%s: Missing failure callback", name); \
- } \
- \
- return true; \
- }
-
-// Singleton instance of the callbacks manager
-app::CHIPDeviceCallbacksMgr & gCallbacks = app::CHIPDeviceCallbacksMgr::GetInstance();
-
-void AccessControlClusterAclListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void AccessControlClusterExtensionListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void AccessControlClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void AccountLoginClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void AdministratorCommissioningClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData,
- Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void ApplicationBasicClusterAllowedVendorListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void ApplicationBasicClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void ApplicationLauncherClusterApplicationLauncherListListAttributeFilter(TLV::TLVReader * tlvData,
- Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void ApplicationLauncherClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void AudioOutputClusterAudioOutputListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void AudioOutputClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void BarrierControlClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void BasicClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void BinaryInputBasicClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void BindingClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void BooleanStateClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void BridgedActionsClusterActionListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void BridgedActionsClusterEndpointListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void BridgedActionsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void BridgedDeviceBasicClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void ChannelClusterChannelListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void ChannelClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void ColorControlClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void ContentLauncherClusterAcceptHeaderListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void ContentLauncherClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void DescriptorClusterDeviceListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void DescriptorClusterServerListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void DescriptorClusterClientListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void DescriptorClusterPartsListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void DescriptorClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void DiagnosticLogsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void DoorLockClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void ElectricalMeasurementClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData,
- Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void EthernetNetworkDiagnosticsClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData,
- Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onFailureCallback);
- cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE);
- }
- return;
- }
-
- Callback::Callback * cb =
- Callback::Callback::FromCancelable(onSuccessCallback);
- cb->mCall(cb->mContext, list);
-}
-
-void FixedLabelClusterLabelListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback,
- Callback::Cancelable * onFailureCallback)
-{
- chip::app::DataModel::DecodableList list;
- CHIP_ERROR err = Decode(*tlvData, list);
- if (err != CHIP_NO_ERROR)
- {
- if (onFailureCallback != nullptr)
- {
- Callback::Callback * cb =
- Callback::Callback