Skip to content

Commit ac5ebd5

Browse files
XML Changes for Improved Capabilities for General Diagnostics Cluster (project-chip#41965)
* XML changes * Codegen * edit zcl json files * Codegen * General diagnostic and all devices app code changes * Edit zcl files for feature map attribute * Codegen * Restyled by whitespace * Restyled by prettier-json * Codegen * Fix unit tests * Restyled by clang-format * Update XML with UpTime optional based on latest errata changes * Codegen * Update general diagnostics code * Restyled by whitespace * Restyled by clang-format --------- Co-authored-by: Restyled.io <[email protected]>
1 parent 69e6678 commit ac5ebd5

File tree

173 files changed

+3210
-846
lines changed

Some content is hidden

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

173 files changed

+3210
-846
lines changed

examples/air-purifier-app/air-purifier-common/air-purifier-app.matter

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ cluster DiagnosticLogs = 50 {
12261226

12271227
/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
12281228
cluster GeneralDiagnostics = 51 {
1229-
revision 2;
1229+
revision 3;
12301230

12311231
enum BootReasonEnum : enum8 {
12321232
kUnspecified = 0;
@@ -1279,14 +1279,23 @@ cluster GeneralDiagnostics = 51 {
12791279

12801280
bitmap Feature : bitmap32 {
12811281
kDataModelTest = 0x1;
1282+
kDeviceLoad = 0x2;
1283+
}
1284+
1285+
struct DeviceLoadStruct {
1286+
int16u currentSubscriptions = 0;
1287+
int16u currentSubscriptionsForFabric = 1;
1288+
int32u totalSubscriptionsEstablished = 2;
1289+
int32u totalInteractionModelMessagesSent = 3;
1290+
int32u totalInteractionModelMessagesReceived = 4;
12821291
}
12831292

12841293
struct NetworkInterface {
12851294
char_string<32> name = 0;
12861295
boolean isOperational = 1;
12871296
nullable boolean offPremiseServicesReachableIPv4 = 2;
12881297
nullable boolean offPremiseServicesReachableIPv6 = 3;
1289-
octet_string<8> hardwareAddress = 4;
1298+
octet_string hardwareAddress = 4;
12901299
octet_string IPv4Addresses[] = 5;
12911300
octet_string IPv6Addresses[] = 6;
12921301
InterfaceTypeEnum type = 7;
@@ -1320,6 +1329,7 @@ cluster GeneralDiagnostics = 51 {
13201329
readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6;
13211330
readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7;
13221331
readonly attribute boolean testEventTriggersEnabled = 8;
1332+
readonly attribute optional DeviceLoadStruct deviceLoadStatus = 10;
13231333
readonly attribute command_id generatedCommandList[] = 65528;
13241334
readonly attribute command_id acceptedCommandList[] = 65529;
13251335
readonly attribute attrib_id attributeList[] = 65531;
@@ -1343,14 +1353,14 @@ cluster GeneralDiagnostics = 51 {
13431353
}
13441354

13451355
response struct PayloadTestResponse = 4 {
1346-
octet_string payload = 0;
1356+
long_octet_string<2048> payload = 0;
13471357
}
13481358

1349-
/** Provide a means for certification tests to trigger some test-plan-specific events */
1359+
/** This command SHALL be supported to provide a means for certification tests to trigger some test-plan-specific events, necessary to assist in automation of device interactions for some certification test cases. */
13501360
command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
1351-
/** Take a snapshot of system time and epoch time. */
1361+
/** This command MAY be used by a client to obtain a correlated view of both System Time, and, if currently synchronized and supported, "wall clock time" of the server. */
13521362
command TimeSnapshot(): TimeSnapshotResponse = 1;
1353-
/** Request a variable length payload response. */
1363+
/** This command provides a means for certification tests or manufacturer's internal tests to validate particular command handling and encoding constraints by generating a response of a given size. */
13541364
command access(invoke: manage) PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
13551365
}
13561366

examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ cluster NetworkCommissioning = 49 {
11091109

11101110
/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
11111111
cluster GeneralDiagnostics = 51 {
1112-
revision 2;
1112+
revision 3;
11131113

11141114
enum BootReasonEnum : enum8 {
11151115
kUnspecified = 0;
@@ -1162,14 +1162,23 @@ cluster GeneralDiagnostics = 51 {
11621162

11631163
bitmap Feature : bitmap32 {
11641164
kDataModelTest = 0x1;
1165+
kDeviceLoad = 0x2;
1166+
}
1167+
1168+
struct DeviceLoadStruct {
1169+
int16u currentSubscriptions = 0;
1170+
int16u currentSubscriptionsForFabric = 1;
1171+
int32u totalSubscriptionsEstablished = 2;
1172+
int32u totalInteractionModelMessagesSent = 3;
1173+
int32u totalInteractionModelMessagesReceived = 4;
11651174
}
11661175

11671176
struct NetworkInterface {
11681177
char_string<32> name = 0;
11691178
boolean isOperational = 1;
11701179
nullable boolean offPremiseServicesReachableIPv4 = 2;
11711180
nullable boolean offPremiseServicesReachableIPv6 = 3;
1172-
octet_string<8> hardwareAddress = 4;
1181+
octet_string hardwareAddress = 4;
11731182
octet_string IPv4Addresses[] = 5;
11741183
octet_string IPv6Addresses[] = 6;
11751184
InterfaceTypeEnum type = 7;
@@ -1203,6 +1212,7 @@ cluster GeneralDiagnostics = 51 {
12031212
readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6;
12041213
readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7;
12051214
readonly attribute boolean testEventTriggersEnabled = 8;
1215+
readonly attribute optional DeviceLoadStruct deviceLoadStatus = 10;
12061216
readonly attribute command_id generatedCommandList[] = 65528;
12071217
readonly attribute command_id acceptedCommandList[] = 65529;
12081218
readonly attribute attrib_id attributeList[] = 65531;
@@ -1226,14 +1236,14 @@ cluster GeneralDiagnostics = 51 {
12261236
}
12271237

12281238
response struct PayloadTestResponse = 4 {
1229-
octet_string payload = 0;
1239+
long_octet_string<2048> payload = 0;
12301240
}
12311241

1232-
/** Provide a means for certification tests to trigger some test-plan-specific events */
1242+
/** This command SHALL be supported to provide a means for certification tests to trigger some test-plan-specific events, necessary to assist in automation of device interactions for some certification test cases. */
12331243
command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
1234-
/** Take a snapshot of system time and epoch time. */
1244+
/** This command MAY be used by a client to obtain a correlated view of both System Time, and, if currently synchronized and supported, "wall clock time" of the server. */
12351245
command TimeSnapshot(): TimeSnapshotResponse = 1;
1236-
/** Request a variable length payload response. */
1246+
/** This command provides a means for certification tests or manufacturer's internal tests to validate particular command handling and encoding constraints by generating a response of a given size. */
12371247
command access(invoke: manage) PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
12381248
}
12391249

examples/air-quality-sensor-app/air-quality-sensor-common/icd-lit-air-quality-sensor-app.matter

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ cluster NetworkCommissioning = 49 {
11091109

11101110
/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
11111111
cluster GeneralDiagnostics = 51 {
1112-
revision 2;
1112+
revision 3;
11131113

11141114
enum BootReasonEnum : enum8 {
11151115
kUnspecified = 0;
@@ -1162,14 +1162,23 @@ cluster GeneralDiagnostics = 51 {
11621162

11631163
bitmap Feature : bitmap32 {
11641164
kDataModelTest = 0x1;
1165+
kDeviceLoad = 0x2;
1166+
}
1167+
1168+
struct DeviceLoadStruct {
1169+
int16u currentSubscriptions = 0;
1170+
int16u currentSubscriptionsForFabric = 1;
1171+
int32u totalSubscriptionsEstablished = 2;
1172+
int32u totalInteractionModelMessagesSent = 3;
1173+
int32u totalInteractionModelMessagesReceived = 4;
11651174
}
11661175

11671176
struct NetworkInterface {
11681177
char_string<32> name = 0;
11691178
boolean isOperational = 1;
11701179
nullable boolean offPremiseServicesReachableIPv4 = 2;
11711180
nullable boolean offPremiseServicesReachableIPv6 = 3;
1172-
octet_string<8> hardwareAddress = 4;
1181+
octet_string hardwareAddress = 4;
11731182
octet_string IPv4Addresses[] = 5;
11741183
octet_string IPv6Addresses[] = 6;
11751184
InterfaceTypeEnum type = 7;
@@ -1203,6 +1212,7 @@ cluster GeneralDiagnostics = 51 {
12031212
readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6;
12041213
readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7;
12051214
readonly attribute boolean testEventTriggersEnabled = 8;
1215+
readonly attribute optional DeviceLoadStruct deviceLoadStatus = 10;
12061216
readonly attribute command_id generatedCommandList[] = 65528;
12071217
readonly attribute command_id acceptedCommandList[] = 65529;
12081218
readonly attribute attrib_id attributeList[] = 65531;
@@ -1226,14 +1236,14 @@ cluster GeneralDiagnostics = 51 {
12261236
}
12271237

12281238
response struct PayloadTestResponse = 4 {
1229-
octet_string payload = 0;
1239+
long_octet_string<2048> payload = 0;
12301240
}
12311241

1232-
/** Provide a means for certification tests to trigger some test-plan-specific events */
1242+
/** This command SHALL be supported to provide a means for certification tests to trigger some test-plan-specific events, necessary to assist in automation of device interactions for some certification test cases. */
12331243
command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
1234-
/** Take a snapshot of system time and epoch time. */
1244+
/** This command MAY be used by a client to obtain a correlated view of both System Time, and, if currently synchronized and supported, "wall clock time" of the server. */
12351245
command TimeSnapshot(): TimeSnapshotResponse = 1;
1236-
/** Request a variable length payload response. */
1246+
/** This command provides a means for certification tests or manufacturer's internal tests to validate particular command handling and encoding constraints by generating a response of a given size. */
12371247
command access(invoke: manage) PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
12381248
}
12391249

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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,7 +2047,7 @@ cluster DiagnosticLogs = 50 {
20472047

20482048
/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
20492049
cluster GeneralDiagnostics = 51 {
2050-
revision 2;
2050+
revision 3;
20512051

20522052
enum BootReasonEnum : enum8 {
20532053
kUnspecified = 0;
@@ -2100,14 +2100,23 @@ cluster GeneralDiagnostics = 51 {
21002100

21012101
bitmap Feature : bitmap32 {
21022102
kDataModelTest = 0x1;
2103+
kDeviceLoad = 0x2;
2104+
}
2105+
2106+
struct DeviceLoadStruct {
2107+
int16u currentSubscriptions = 0;
2108+
int16u currentSubscriptionsForFabric = 1;
2109+
int32u totalSubscriptionsEstablished = 2;
2110+
int32u totalInteractionModelMessagesSent = 3;
2111+
int32u totalInteractionModelMessagesReceived = 4;
21032112
}
21042113

21052114
struct NetworkInterface {
21062115
char_string<32> name = 0;
21072116
boolean isOperational = 1;
21082117
nullable boolean offPremiseServicesReachableIPv4 = 2;
21092118
nullable boolean offPremiseServicesReachableIPv6 = 3;
2110-
octet_string<8> hardwareAddress = 4;
2119+
octet_string hardwareAddress = 4;
21112120
octet_string IPv4Addresses[] = 5;
21122121
octet_string IPv6Addresses[] = 6;
21132122
InterfaceTypeEnum type = 7;
@@ -2141,6 +2150,7 @@ cluster GeneralDiagnostics = 51 {
21412150
readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6;
21422151
readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7;
21432152
readonly attribute boolean testEventTriggersEnabled = 8;
2153+
readonly attribute optional DeviceLoadStruct deviceLoadStatus = 10;
21442154
readonly attribute command_id generatedCommandList[] = 65528;
21452155
readonly attribute command_id acceptedCommandList[] = 65529;
21462156
readonly attribute attrib_id attributeList[] = 65531;
@@ -2164,14 +2174,14 @@ cluster GeneralDiagnostics = 51 {
21642174
}
21652175

21662176
response struct PayloadTestResponse = 4 {
2167-
octet_string payload = 0;
2177+
long_octet_string<2048> payload = 0;
21682178
}
21692179

2170-
/** Provide a means for certification tests to trigger some test-plan-specific events */
2180+
/** This command SHALL be supported to provide a means for certification tests to trigger some test-plan-specific events, necessary to assist in automation of device interactions for some certification test cases. */
21712181
command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
2172-
/** Take a snapshot of system time and epoch time. */
2182+
/** This command MAY be used by a client to obtain a correlated view of both System Time, and, if currently synchronized and supported, "wall clock time" of the server. */
21732183
command TimeSnapshot(): TimeSnapshotResponse = 1;
2174-
/** Request a variable length payload response. */
2184+
/** This command provides a means for certification tests or manufacturer's internal tests to validate particular command handling and encoding constraints by generating a response of a given size. */
21752185
command access(invoke: manage) PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
21762186
}
21772187

examples/all-clusters-app/realtek/data_model/all-clusters-app.matter

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,7 +2047,7 @@ cluster DiagnosticLogs = 50 {
20472047

20482048
/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
20492049
cluster GeneralDiagnostics = 51 {
2050-
revision 2;
2050+
revision 3;
20512051

20522052
enum BootReasonEnum : enum8 {
20532053
kUnspecified = 0;
@@ -2100,14 +2100,23 @@ cluster GeneralDiagnostics = 51 {
21002100

21012101
bitmap Feature : bitmap32 {
21022102
kDataModelTest = 0x1;
2103+
kDeviceLoad = 0x2;
2104+
}
2105+
2106+
struct DeviceLoadStruct {
2107+
int16u currentSubscriptions = 0;
2108+
int16u currentSubscriptionsForFabric = 1;
2109+
int32u totalSubscriptionsEstablished = 2;
2110+
int32u totalInteractionModelMessagesSent = 3;
2111+
int32u totalInteractionModelMessagesReceived = 4;
21032112
}
21042113

21052114
struct NetworkInterface {
21062115
char_string<32> name = 0;
21072116
boolean isOperational = 1;
21082117
nullable boolean offPremiseServicesReachableIPv4 = 2;
21092118
nullable boolean offPremiseServicesReachableIPv6 = 3;
2110-
octet_string<8> hardwareAddress = 4;
2119+
octet_string hardwareAddress = 4;
21112120
octet_string IPv4Addresses[] = 5;
21122121
octet_string IPv6Addresses[] = 6;
21132122
InterfaceTypeEnum type = 7;
@@ -2141,6 +2150,7 @@ cluster GeneralDiagnostics = 51 {
21412150
readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6;
21422151
readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7;
21432152
readonly attribute boolean testEventTriggersEnabled = 8;
2153+
readonly attribute optional DeviceLoadStruct deviceLoadStatus = 10;
21442154
readonly attribute command_id generatedCommandList[] = 65528;
21452155
readonly attribute command_id acceptedCommandList[] = 65529;
21462156
readonly attribute attrib_id attributeList[] = 65531;
@@ -2164,14 +2174,14 @@ cluster GeneralDiagnostics = 51 {
21642174
}
21652175

21662176
response struct PayloadTestResponse = 4 {
2167-
octet_string payload = 0;
2177+
long_octet_string<2048> payload = 0;
21682178
}
21692179

2170-
/** Provide a means for certification tests to trigger some test-plan-specific events */
2180+
/** This command SHALL be supported to provide a means for certification tests to trigger some test-plan-specific events, necessary to assist in automation of device interactions for some certification test cases. */
21712181
command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
2172-
/** Take a snapshot of system time and epoch time. */
2182+
/** This command MAY be used by a client to obtain a correlated view of both System Time, and, if currently synchronized and supported, "wall clock time" of the server. */
21732183
command TimeSnapshot(): TimeSnapshotResponse = 1;
2174-
/** Request a variable length payload response. */
2184+
/** This command provides a means for certification tests or manufacturer's internal tests to validate particular command handling and encoding constraints by generating a response of a given size. */
21752185
command access(invoke: manage) PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
21762186
}
21772187

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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1964,7 +1964,7 @@ cluster DiagnosticLogs = 50 {
19641964

19651965
/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
19661966
cluster GeneralDiagnostics = 51 {
1967-
revision 2;
1967+
revision 3;
19681968

19691969
enum BootReasonEnum : enum8 {
19701970
kUnspecified = 0;
@@ -2017,14 +2017,23 @@ cluster GeneralDiagnostics = 51 {
20172017

20182018
bitmap Feature : bitmap32 {
20192019
kDataModelTest = 0x1;
2020+
kDeviceLoad = 0x2;
2021+
}
2022+
2023+
struct DeviceLoadStruct {
2024+
int16u currentSubscriptions = 0;
2025+
int16u currentSubscriptionsForFabric = 1;
2026+
int32u totalSubscriptionsEstablished = 2;
2027+
int32u totalInteractionModelMessagesSent = 3;
2028+
int32u totalInteractionModelMessagesReceived = 4;
20202029
}
20212030

20222031
struct NetworkInterface {
20232032
char_string<32> name = 0;
20242033
boolean isOperational = 1;
20252034
nullable boolean offPremiseServicesReachableIPv4 = 2;
20262035
nullable boolean offPremiseServicesReachableIPv6 = 3;
2027-
octet_string<8> hardwareAddress = 4;
2036+
octet_string hardwareAddress = 4;
20282037
octet_string IPv4Addresses[] = 5;
20292038
octet_string IPv6Addresses[] = 6;
20302039
InterfaceTypeEnum type = 7;
@@ -2058,6 +2067,7 @@ cluster GeneralDiagnostics = 51 {
20582067
readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6;
20592068
readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7;
20602069
readonly attribute boolean testEventTriggersEnabled = 8;
2070+
readonly attribute optional DeviceLoadStruct deviceLoadStatus = 10;
20612071
readonly attribute command_id generatedCommandList[] = 65528;
20622072
readonly attribute command_id acceptedCommandList[] = 65529;
20632073
readonly attribute attrib_id attributeList[] = 65531;
@@ -2081,14 +2091,14 @@ cluster GeneralDiagnostics = 51 {
20812091
}
20822092

20832093
response struct PayloadTestResponse = 4 {
2084-
octet_string payload = 0;
2094+
long_octet_string<2048> payload = 0;
20852095
}
20862096

2087-
/** Provide a means for certification tests to trigger some test-plan-specific events */
2097+
/** This command SHALL be supported to provide a means for certification tests to trigger some test-plan-specific events, necessary to assist in automation of device interactions for some certification test cases. */
20882098
command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
2089-
/** Take a snapshot of system time and epoch time. */
2099+
/** This command MAY be used by a client to obtain a correlated view of both System Time, and, if currently synchronized and supported, "wall clock time" of the server. */
20902100
command TimeSnapshot(): TimeSnapshotResponse = 1;
2091-
/** Request a variable length payload response. */
2101+
/** This command provides a means for certification tests or manufacturer's internal tests to validate particular command handling and encoding constraints by generating a response of a given size. */
20922102
command access(invoke: manage) PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
20932103
}
20942104

examples/all-devices-app/all-devices-common/devices/root-node/RootNodeDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ CHIP_ERROR RootNodeDevice::Register(EndpointId endpointId, CodeDrivenDataModelPr
6868
mAdministratorCommissioningCluster.Create(endpointId, BitFlags<AdministratorCommissioning::Feature>{});
6969
ReturnErrorOnFailure(provider.AddCluster(mAdministratorCommissioningCluster.Registration()));
7070

71-
mGeneralDiagnosticsCluster.Create(GeneralDiagnosticsCluster::OptionalAttributeSet{});
71+
mGeneralDiagnosticsCluster.Create(GeneralDiagnosticsCluster::OptionalAttributeSet{}, BitFlags<GeneralDiagnostics::Feature>{});
7272
ReturnErrorOnFailure(provider.AddCluster(mGeneralDiagnosticsCluster.Registration()));
7373

7474
mGroupKeyManagementCluster.Create();

0 commit comments

Comments
 (0)