Skip to content

Commit

Permalink
[data-model] Add general diagnostics average wear count (#29285)
Browse files Browse the repository at this point in the history
* [clusters] Add AverageWearCount attribute support in GeneralDiagnostics

Signed-off-by: marius-alex-tache <marius.tache@nxp.com>

* [codegen] Regenerate generated code

Signed-off-by: marius-alex-tache <marius.tache@nxp.com>

* Add AverageWearCount to zcl data

Signed-off-by: marius-alex-tache <marius.tache@nxp.com>

* Remove AverageWearCount from Darwin availability

Signed-off-by: marius-alex-tache <marius.tache@nxp.com>

* Add API documentation for General Diagnostics interface

Signed-off-by: marius-alex-tache <marius.tache@nxp.com>

* Restyled by whitespace

* Restyled by prettier-json

* Remove redundant comments from General Diagnostics interface

Signed-off-by: marius-alex-tache <marius.tache@nxp.com>

* [codegen] Regenerate generated code

Signed-off-by: marius-alex-tache <marius.tache@nxp.com>

* Remove redundant min/max range for General Diagnostics attributes

Signed-off-by: marius-alex-tache <marius.tache@nxp.com>

---------

Signed-off-by: marius-alex-tache <marius.tache@nxp.com>
Co-authored-by: Restyled.io <commits@restyled.io>
  • Loading branch information
2 people authored and pull[bot] committed Feb 8, 2024
1 parent 1159b03 commit 04ec109
Show file tree
Hide file tree
Showing 25 changed files with 343 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ CHIP_ERROR GeneralDiagosticsAttrAccess::Read(const ConcreteReadAttributePath & a
bool isTestEventTriggersEnabled = IsTestEventTriggerEnabled();
return aEncoder.Encode(isTestEventTriggersEnabled);
}
case AverageWearCount::Id: {
return ReadIfSupported(&DiagnosticDataProvider::GetAverageWearCount, aEncoder);
}
default: {
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,15 @@ limitations under the License.
<define>GENERAL_DIAGNOSTICS_CLUSTER</define>
<description>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.</description>
<attribute side="server" code="0x00" define="NETWORK_INTERFACES" type="ARRAY" entryType="NetworkInterface" length="254" writable="false" optional="false">NetworkInterfaces</attribute>
<attribute side="server" code="0x01" define="REBOOT_COUNT" type="INT16U" min="0x0000" max="0xFFFF" writable="false" default="0x0000" optional="false">RebootCount</attribute>
<attribute side="server" code="0x02" define="UP_TIME" type="INT64U" min="0x0000000000000000" max="0xFFFFFFFFFFFFFFFF" writable="false" default="0x0000000000000000" optional="true">UpTime</attribute>
<attribute side="server" code="0x03" define="TOTAL_OPERATIONAL_HOURS" type="INT32U" min="0x00000000" max="0xFFFFFFFF" writable="false" default="0x00000000" optional="true">TotalOperationalHours</attribute>
<attribute side="server" code="0x01" define="REBOOT_COUNT" type="INT16U" writable="false" default="0x0000" optional="false">RebootCount</attribute>
<attribute side="server" code="0x02" define="UP_TIME" type="INT64U" writable="false" default="0x0000000000000000" optional="true">UpTime</attribute>
<attribute side="server" code="0x03" define="TOTAL_OPERATIONAL_HOURS" type="INT32U" writable="false" default="0x00000000" optional="true">TotalOperationalHours</attribute>
<attribute side="server" code="0x04" define="BOOT_REASONS" type="BootReasonEnum" writable="false" optional="true">BootReason</attribute>
<attribute side="server" code="0x05" define="ACTIVE_HARDWARE_FAULTS" type="ARRAY" entryType="HardwareFaultEnum" writable="false" optional="true">ActiveHardwareFaults</attribute>
<attribute side="server" code="0x06" define="ACTIVE_RADIO_FAULTS" type="ARRAY" entryType="RadioFaultEnum" writable="false" optional="true">ActiveRadioFaults</attribute>
<attribute side="server" code="0x07" define="ACTIVE_NETWORK_FAULTS" type="ARRAY" entryType="NetworkFaultEnum" writable="false" optional="true">ActiveNetworkFaults</attribute>
<attribute side="server" code="0x08" define="TEST_EVENT_TRIGGERS_ENABLED" type="BOOLEAN" writable="false" optional="false">TestEventTriggersEnabled</attribute>
<attribute side="server" code="0x09" define="AVERAGE_WEAR_COUNT" type="INT32U" writable="false" default="0x00000000" optional="true">AverageWearCount</attribute>

<command source="client" code="0x00" name="TestEventTrigger" optional="false">
<description>Provide a means for certification tests to trigger some test-plan-specific events</description>
Expand Down
3 changes: 2 additions & 1 deletion src/app/zap-templates/zcl/zcl-with-test-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@
"RebootCount",
"UpTime",
"TotalOperationalHours",
"BootReason"
"BootReason",
"AverageWearCount"
],
"Group Key Management": [
"ClusterRevision",
Expand Down
3 changes: 2 additions & 1 deletion src/app/zap-templates/zcl/zcl.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@
"RebootCount",
"UpTime",
"TotalOperationalHours",
"BootReason"
"BootReason",
"AverageWearCount"
],
"Group Key Management": [
"ClusterRevision",
Expand Down
1 change: 1 addition & 0 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1803,6 +1803,7 @@ client cluster GeneralDiagnostics = 51 {
readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6;
readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7;
readonly attribute boolean testEventTriggersEnabled = 8;
readonly attribute optional int32u averageWearCount = 9;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3746,6 +3746,7 @@ public enum Attribute {
ActiveRadioFaults(6L),
ActiveNetworkFaults(7L),
TestEventTriggersEnabled(8L),
AverageWearCount(9L),
GeneratedCommandList(65528L),
AcceptedCommandList(65529L),
EventList(65530L),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3154,6 +3154,17 @@ private static Map<String, InteractionInfo> readGeneralDiagnosticsInteractionInf
readGeneralDiagnosticsTestEventTriggersEnabledCommandParams
);
result.put("readTestEventTriggersEnabledAttribute", readGeneralDiagnosticsTestEventTriggersEnabledAttributeInteractionInfo);
Map<String, CommandParameterInfo> readGeneralDiagnosticsAverageWearCountCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readGeneralDiagnosticsAverageWearCountAttributeInteractionInfo = new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.GeneralDiagnosticsCluster) cluster).readAverageWearCountAttribute(
(ChipClusters.LongAttributeCallback) callback
);
},
() -> new ClusterInfoMapping.DelegatedLongAttributeCallback(),
readGeneralDiagnosticsAverageWearCountCommandParams
);
result.put("readAverageWearCountAttribute", readGeneralDiagnosticsAverageWearCountAttributeInteractionInfo);
Map<String, CommandParameterInfo> readGeneralDiagnosticsGeneratedCommandListCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readGeneralDiagnosticsGeneratedCommandListAttributeInteractionInfo = new InteractionInfo(
(cluster, callback, commandArguments) -> {
Expand Down
16 changes: 16 additions & 0 deletions src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/controller/python/chip/clusters/CHIPClusters.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions src/controller/python/chip/clusters/Objects.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/darwin/Framework/CHIP/zap-generated/MTRClusters.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 04ec109

Please sign in to comment.