From d5048bff1f3f2b645239e168ee1935e9f3f48dc6 Mon Sep 17 00:00:00 2001
From: Andrei Litvin <andreilitvin@google.com>
Date: Thu, 20 Feb 2025 07:35:23 -0500
Subject: [PATCH 1/5] Fix typo: diagostics - diagNostics

---
 .../general-diagnostics-server.cpp            | 30 +++++++++----------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp
index 0face9c27d078d..f909bde0b9dd42 100644
--- a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp
+++ b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp
@@ -22,7 +22,6 @@
 
 #include <app/util/config.h>
 
-#include "app/server/Server.h"
 #include <app-common/zap-generated/attributes/Accessors.h>
 #include <app-common/zap-generated/cluster-objects.h>
 #include <app-common/zap-generated/ids/Attributes.h>
@@ -34,6 +33,7 @@
 #include <app/CommandHandlerInterfaceRegistry.h>
 #include <app/EventLogging.h>
 #include <app/reporting/reporting.h>
+#include <app/server/Server.h>
 #include <app/util/attribute-storage.h>
 #include <lib/support/ScopedBuffer.h>
 #include <platform/ConnectivityManager.h>
@@ -112,13 +112,13 @@ TestEventTriggerDelegate * GetTriggerDelegateOnMatchingKey(ByteSpan enableKey)
     return triggerDelegate;
 }
 
-class GeneralDiagosticsGlobalInstance : public AttributeAccessInterface,
+class GeneralDiagnosticsGlobalInstance : public AttributeAccessInterface,
                                         public CommandHandlerInterface,
                                         public DeviceLayer::ConnectivityManagerDelegate
 {
 public:
     // Register for the GeneralDiagnostics cluster on all endpoints.
-    GeneralDiagosticsGlobalInstance() :
+    GeneralDiagnosticsGlobalInstance() :
         AttributeAccessInterface(Optional<EndpointId>::Missing(), GeneralDiagnostics::Id),
         CommandHandlerInterface(Optional<EndpointId>::Missing(), GeneralDiagnostics::Id)
     {}
@@ -151,7 +151,7 @@ class GeneralDiagosticsGlobalInstance : public AttributeAccessInterface,
     }
 };
 
-CHIP_ERROR GeneralDiagosticsGlobalInstance::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
+CHIP_ERROR GeneralDiagnosticsGlobalInstance::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
 {
     if (aPath.mClusterId != GeneralDiagnostics::Id)
     {
@@ -210,7 +210,7 @@ CHIP_ERROR GeneralDiagosticsGlobalInstance::Read(const ConcreteReadAttributePath
     return CHIP_NO_ERROR;
 }
 
-void GeneralDiagosticsGlobalInstance::InvokeCommand(HandlerContext & handlerContext)
+void GeneralDiagnosticsGlobalInstance::InvokeCommand(HandlerContext & handlerContext)
 {
     switch (handlerContext.mRequestPath.mCommandId)
     {
@@ -234,7 +234,7 @@ void GeneralDiagosticsGlobalInstance::InvokeCommand(HandlerContext & handlerCont
 }
 
 template <typename T>
-CHIP_ERROR GeneralDiagosticsGlobalInstance::ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(T &),
+CHIP_ERROR GeneralDiagnosticsGlobalInstance::ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(T &),
                                                             AttributeValueEncoder & aEncoder)
 {
     T data;
@@ -252,7 +252,7 @@ CHIP_ERROR GeneralDiagosticsGlobalInstance::ReadIfSupported(CHIP_ERROR (Diagnost
 }
 
 template <typename T>
-CHIP_ERROR GeneralDiagosticsGlobalInstance::ReadListIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(T &),
+CHIP_ERROR GeneralDiagnosticsGlobalInstance::ReadListIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(T &),
                                                                 AttributeValueEncoder & aEncoder)
 {
     CHIP_ERROR err = CHIP_NO_ERROR;
@@ -277,7 +277,7 @@ CHIP_ERROR GeneralDiagosticsGlobalInstance::ReadListIfSupported(CHIP_ERROR (Diag
     return err;
 }
 
-CHIP_ERROR GeneralDiagosticsGlobalInstance::ReadNetworkInterfaces(AttributeValueEncoder & aEncoder)
+CHIP_ERROR GeneralDiagnosticsGlobalInstance::ReadNetworkInterfaces(AttributeValueEncoder & aEncoder)
 {
     CHIP_ERROR err = CHIP_NO_ERROR;
     DeviceLayer::NetworkInterface * netifs;
@@ -303,7 +303,7 @@ CHIP_ERROR GeneralDiagosticsGlobalInstance::ReadNetworkInterfaces(AttributeValue
     return err;
 }
 
-void GeneralDiagosticsGlobalInstance::HandleTestEventTrigger(HandlerContext & ctx,
+void GeneralDiagnosticsGlobalInstance::HandleTestEventTrigger(HandlerContext & ctx,
                                                              const Commands::TestEventTrigger::DecodableType & commandData)
 {
     auto * triggerDelegate = GetTriggerDelegateOnMatchingKey(commandData.enableKey);
@@ -320,7 +320,7 @@ void GeneralDiagosticsGlobalInstance::HandleTestEventTrigger(HandlerContext & ct
                                   (handleEventTriggerResult != CHIP_NO_ERROR) ? Status::InvalidCommand : Status::Success);
 }
 
-void GeneralDiagosticsGlobalInstance::HandleTimeSnapshot(HandlerContext & ctx,
+void GeneralDiagnosticsGlobalInstance::HandleTimeSnapshot(HandlerContext & ctx,
                                                          const Commands::TimeSnapshot::DecodableType & commandData)
 {
     ChipLogError(Zcl, "Received TimeSnapshot command!");
@@ -353,7 +353,7 @@ void GeneralDiagosticsGlobalInstance::HandleTimeSnapshot(HandlerContext & ctx,
 }
 
 #ifdef GENERAL_DIAGNOSTICS_ENABLE_PAYLOAD_TEST_REQUEST_CMD
-void GeneralDiagosticsGlobalInstance::HandlePayloadTestRequest(HandlerContext & ctx,
+void GeneralDiagnosticsGlobalInstance::HandlePayloadTestRequest(HandlerContext & ctx,
                                                                const Commands::PayloadTestRequest::DecodableType & commandData)
 {
     // Max allowed is 2048.
@@ -389,7 +389,7 @@ void GeneralDiagosticsGlobalInstance::HandlePayloadTestRequest(HandlerContext &
 }
 #endif // GENERAL_DIAGNOSTICS_ENABLE_PAYLOAD_TEST_REQUEST_CMD
 
-GeneralDiagosticsGlobalInstance gGeneralDiagosticsInstance;
+GeneralDiagnosticsGlobalInstance gGeneralDiagnosticsInstance;
 
 } // anonymous namespace
 
@@ -517,10 +517,10 @@ void MatterGeneralDiagnosticsPluginServerInitCallback()
 {
     BootReasonEnum bootReason;
 
-    AttributeAccessInterfaceRegistry::Instance().Register(&gGeneralDiagosticsInstance);
-    CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(&gGeneralDiagosticsInstance);
+    AttributeAccessInterfaceRegistry::Instance().Register(&gGeneralDiagnosticsInstance);
+    CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(&gGeneralDiagnosticsInstance);
 
-    ConnectivityMgr().SetDelegate(&gGeneralDiagosticsInstance);
+    ConnectivityMgr().SetDelegate(&gGeneralDiagnosticsInstance);
 
     if (GetDiagnosticDataProvider().GetBootReason(bootReason) == CHIP_NO_ERROR)
     {

From 90a4a76f189a610048b7ad959504830cb517d338 Mon Sep 17 00:00:00 2001
From: "Restyled.io" <commits@restyled.io>
Date: Thu, 20 Feb 2025 12:36:46 +0000
Subject: [PATCH 2/5] Restyled by clang-format

---
 .../general-diagnostics-server.cpp                 | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp
index f909bde0b9dd42..69c553c1bc7dfa 100644
--- a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp
+++ b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp
@@ -113,8 +113,8 @@ TestEventTriggerDelegate * GetTriggerDelegateOnMatchingKey(ByteSpan enableKey)
 }
 
 class GeneralDiagnosticsGlobalInstance : public AttributeAccessInterface,
-                                        public CommandHandlerInterface,
-                                        public DeviceLayer::ConnectivityManagerDelegate
+                                         public CommandHandlerInterface,
+                                         public DeviceLayer::ConnectivityManagerDelegate
 {
 public:
     // Register for the GeneralDiagnostics cluster on all endpoints.
@@ -235,7 +235,7 @@ void GeneralDiagnosticsGlobalInstance::InvokeCommand(HandlerContext & handlerCon
 
 template <typename T>
 CHIP_ERROR GeneralDiagnosticsGlobalInstance::ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(T &),
-                                                            AttributeValueEncoder & aEncoder)
+                                                             AttributeValueEncoder & aEncoder)
 {
     T data;
     CHIP_ERROR err = (GetDiagnosticDataProvider().*getter)(data);
@@ -253,7 +253,7 @@ CHIP_ERROR GeneralDiagnosticsGlobalInstance::ReadIfSupported(CHIP_ERROR (Diagnos
 
 template <typename T>
 CHIP_ERROR GeneralDiagnosticsGlobalInstance::ReadListIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(T &),
-                                                                AttributeValueEncoder & aEncoder)
+                                                                 AttributeValueEncoder & aEncoder)
 {
     CHIP_ERROR err = CHIP_NO_ERROR;
     T faultList;
@@ -304,7 +304,7 @@ CHIP_ERROR GeneralDiagnosticsGlobalInstance::ReadNetworkInterfaces(AttributeValu
 }
 
 void GeneralDiagnosticsGlobalInstance::HandleTestEventTrigger(HandlerContext & ctx,
-                                                             const Commands::TestEventTrigger::DecodableType & commandData)
+                                                              const Commands::TestEventTrigger::DecodableType & commandData)
 {
     auto * triggerDelegate = GetTriggerDelegateOnMatchingKey(commandData.enableKey);
     if (triggerDelegate == nullptr)
@@ -321,7 +321,7 @@ void GeneralDiagnosticsGlobalInstance::HandleTestEventTrigger(HandlerContext & c
 }
 
 void GeneralDiagnosticsGlobalInstance::HandleTimeSnapshot(HandlerContext & ctx,
-                                                         const Commands::TimeSnapshot::DecodableType & commandData)
+                                                          const Commands::TimeSnapshot::DecodableType & commandData)
 {
     ChipLogError(Zcl, "Received TimeSnapshot command!");
 
@@ -354,7 +354,7 @@ void GeneralDiagnosticsGlobalInstance::HandleTimeSnapshot(HandlerContext & ctx,
 
 #ifdef GENERAL_DIAGNOSTICS_ENABLE_PAYLOAD_TEST_REQUEST_CMD
 void GeneralDiagnosticsGlobalInstance::HandlePayloadTestRequest(HandlerContext & ctx,
-                                                               const Commands::PayloadTestRequest::DecodableType & commandData)
+                                                                const Commands::PayloadTestRequest::DecodableType & commandData)
 {
     // Max allowed is 2048.
     if (commandData.count > 2048)

From 5dba455738ec9dcd7a4e332be2c751a190394b64 Mon Sep 17 00:00:00 2001
From: Andrei Litvin <andreilitvin@google.com>
Date: Thu, 20 Feb 2025 14:37:59 -0500
Subject: [PATCH 3/5] Fix more typos

---
 .../ethernet-network-diagnostics-server.cpp   | 16 +++++------
 .../software-diagnostics-server.cpp           | 12 ++++----
 .../thread-network-diagnostics-server.cpp     |  8 +++---
 .../wifi-network-diagnostics-server.cpp       | 28 +++++++++----------
 4 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp b/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp
index 0e15f2f9987439..bb95e0200b8578 100644
--- a/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp
+++ b/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp
@@ -36,11 +36,11 @@ using chip::DeviceLayer::DiagnosticDataProvider;
 
 namespace {
 
-class EthernetDiagosticsAttrAccess : public AttributeAccessInterface
+class EthernetDiagnosticsAttrAccess : public AttributeAccessInterface
 {
 public:
     // Register for the EthernetNetworkDiagnostics cluster on all endpoints.
-    EthernetDiagosticsAttrAccess() : AttributeAccessInterface(Optional<EndpointId>::Missing(), EthernetNetworkDiagnostics::Id) {}
+    EthernetDiagnosticsAttrAccess() : AttributeAccessInterface(Optional<EndpointId>::Missing(), EthernetNetworkDiagnostics::Id) {}
 
     CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
 
@@ -54,7 +54,7 @@ class EthernetDiagosticsAttrAccess : public AttributeAccessInterface
 };
 
 template <typename T>
-CHIP_ERROR EthernetDiagosticsAttrAccess::ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(T &),
+CHIP_ERROR EthernetDiagnosticsAttrAccess::ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(T &),
                                                          AttributeValueEncoder & aEncoder)
 {
     T data;
@@ -71,7 +71,7 @@ CHIP_ERROR EthernetDiagosticsAttrAccess::ReadIfSupported(CHIP_ERROR (DiagnosticD
     return aEncoder.Encode(data);
 }
 
-CHIP_ERROR EthernetDiagosticsAttrAccess::ReadPHYRate(AttributeValueEncoder & aEncoder)
+CHIP_ERROR EthernetDiagnosticsAttrAccess::ReadPHYRate(AttributeValueEncoder & aEncoder)
 {
     Attributes::PHYRate::TypeInfo::Type pHYRate;
     auto value = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate10M;
@@ -90,7 +90,7 @@ CHIP_ERROR EthernetDiagosticsAttrAccess::ReadPHYRate(AttributeValueEncoder & aEn
     return aEncoder.Encode(pHYRate);
 }
 
-CHIP_ERROR EthernetDiagosticsAttrAccess::ReadFullDuplex(AttributeValueEncoder & aEncoder)
+CHIP_ERROR EthernetDiagnosticsAttrAccess::ReadFullDuplex(AttributeValueEncoder & aEncoder)
 {
     Attributes::FullDuplex::TypeInfo::Type fullDuplex;
     bool value = false;
@@ -108,7 +108,7 @@ CHIP_ERROR EthernetDiagosticsAttrAccess::ReadFullDuplex(AttributeValueEncoder &
     return aEncoder.Encode(fullDuplex);
 }
 
-CHIP_ERROR EthernetDiagosticsAttrAccess::ReadCarrierDetect(AttributeValueEncoder & aEncoder)
+CHIP_ERROR EthernetDiagnosticsAttrAccess::ReadCarrierDetect(AttributeValueEncoder & aEncoder)
 {
     Attributes::CarrierDetect::TypeInfo::Type carrierDetect;
     bool value = false;
@@ -127,9 +127,9 @@ CHIP_ERROR EthernetDiagosticsAttrAccess::ReadCarrierDetect(AttributeValueEncoder
     return aEncoder.Encode(carrierDetect);
 }
 
-EthernetDiagosticsAttrAccess gAttrAccess;
+EthernetDiagnosticsAttrAccess gAttrAccess;
 
-CHIP_ERROR EthernetDiagosticsAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
+CHIP_ERROR EthernetDiagnosticsAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
 {
     if (aPath.mClusterId != EthernetNetworkDiagnostics::Id)
     {
diff --git a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp
index d90d09d354749a..5d5807015425b1 100644
--- a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp
+++ b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp
@@ -41,11 +41,11 @@ using chip::DeviceLayer::GetDiagnosticDataProvider;
 
 namespace {
 
-class SoftwareDiagosticsAttrAccess : public AttributeAccessInterface
+class SoftwareDiagnosticsAttrAccess : public AttributeAccessInterface
 {
 public:
     // Register for the SoftwareDiagnostics cluster on all endpoints.
-    SoftwareDiagosticsAttrAccess() : AttributeAccessInterface(Optional<EndpointId>::Missing(), SoftwareDiagnostics::Id) {}
+    SoftwareDiagnosticsAttrAccess() : AttributeAccessInterface(Optional<EndpointId>::Missing(), SoftwareDiagnostics::Id) {}
 
     CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
 
@@ -65,11 +65,11 @@ class SoftwareDiagnosticsCommandHandler : public CommandHandlerInterface
     CHIP_ERROR EnumerateAcceptedCommands(const ConcreteClusterPath & cluster, CommandIdCallback callback, void * context) override;
 };
 
-SoftwareDiagosticsAttrAccess gAttrAccess;
+SoftwareDiagnosticsAttrAccess gAttrAccess;
 
 SoftwareDiagnosticsCommandHandler gCommandHandler;
 
-CHIP_ERROR SoftwareDiagosticsAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
+CHIP_ERROR SoftwareDiagnosticsAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
 {
     if (aPath.mClusterId != SoftwareDiagnostics::Id)
     {
@@ -103,7 +103,7 @@ CHIP_ERROR SoftwareDiagosticsAttrAccess::Read(const ConcreteReadAttributePath &
     return CHIP_NO_ERROR;
 }
 
-CHIP_ERROR SoftwareDiagosticsAttrAccess::ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(uint64_t &),
+CHIP_ERROR SoftwareDiagnosticsAttrAccess::ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(uint64_t &),
                                                          AttributeValueEncoder & aEncoder)
 {
     uint64_t data;
@@ -120,7 +120,7 @@ CHIP_ERROR SoftwareDiagosticsAttrAccess::ReadIfSupported(CHIP_ERROR (DiagnosticD
     return aEncoder.Encode(data);
 }
 
-CHIP_ERROR SoftwareDiagosticsAttrAccess::ReadThreadMetrics(AttributeValueEncoder & aEncoder)
+CHIP_ERROR SoftwareDiagnosticsAttrAccess::ReadThreadMetrics(AttributeValueEncoder & aEncoder)
 {
     CHIP_ERROR err = CHIP_NO_ERROR;
     DeviceLayer::ThreadMetrics * threadMetrics;
diff --git a/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp b/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp
index f4ec69e05b1fa5..b4282ceb18ff91 100644
--- a/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp
+++ b/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp
@@ -45,18 +45,18 @@ using chip::Protocols::InteractionModel::Status;
 
 namespace {
 
-class ThreadDiagosticsAttrAccess : public AttributeAccessInterface
+class ThreadDiagnosticsAttrAccess : public AttributeAccessInterface
 {
 public:
     // Register for the ThreadNetworkDiagnostics cluster on all endpoints.
-    ThreadDiagosticsAttrAccess() : AttributeAccessInterface(Optional<EndpointId>::Missing(), ThreadNetworkDiagnostics::Id) {}
+    ThreadDiagnosticsAttrAccess() : AttributeAccessInterface(Optional<EndpointId>::Missing(), ThreadNetworkDiagnostics::Id) {}
 
     CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
 };
 
-ThreadDiagosticsAttrAccess gAttrAccess;
+ThreadDiagnosticsAttrAccess gAttrAccess;
 
-CHIP_ERROR ThreadDiagosticsAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
+CHIP_ERROR ThreadDiagnosticsAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
 {
     if (aPath.mClusterId != ThreadNetworkDiagnostics::Id)
     {
diff --git a/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp b/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp
index 0c4b86c9ef80d5..b46e8cf441bee1 100644
--- a/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp
+++ b/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp
@@ -42,11 +42,11 @@ using chip::DeviceLayer::GetDiagnosticDataProvider;
 
 namespace {
 
-class WiFiDiagosticsGlobalInstance : public AttributeAccessInterface, public CommandHandlerInterface
+class WiFiDiagnosticsGlobalInstance : public AttributeAccessInterface, public CommandHandlerInterface
 {
 public:
     // Register for the WiFiNetworkDiagnostics cluster on all endpoints.
-    WiFiDiagosticsGlobalInstance(DiagnosticDataProvider & diagnosticProvider) :
+    WiFiDiagnosticsGlobalInstance(DiagnosticDataProvider & diagnosticProvider) :
         AttributeAccessInterface(Optional<EndpointId>::Missing(), WiFiNetworkDiagnostics::Id),
         CommandHandlerInterface(Optional<EndpointId>::Missing(), WiFiNetworkDiagnostics::Id),
         mDiagnosticProvider(diagnosticProvider)
@@ -74,7 +74,7 @@ class WiFiDiagosticsGlobalInstance : public AttributeAccessInterface, public Com
 };
 
 template <typename T, typename Type>
-CHIP_ERROR WiFiDiagosticsGlobalInstance::ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(T &), Type & data,
+CHIP_ERROR WiFiDiagnosticsGlobalInstance::ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(T &), Type & data,
                                                          AttributeValueEncoder & aEncoder)
 {
     T value;
@@ -92,7 +92,7 @@ CHIP_ERROR WiFiDiagosticsGlobalInstance::ReadIfSupported(CHIP_ERROR (DiagnosticD
     return aEncoder.Encode(data);
 }
 
-CHIP_ERROR WiFiDiagosticsGlobalInstance::ReadWiFiBssId(AttributeValueEncoder & aEncoder)
+CHIP_ERROR WiFiDiagnosticsGlobalInstance::ReadWiFiBssId(AttributeValueEncoder & aEncoder)
 {
     Attributes::Bssid::TypeInfo::Type bssid;
 
@@ -115,7 +115,7 @@ CHIP_ERROR WiFiDiagosticsGlobalInstance::ReadWiFiBssId(AttributeValueEncoder & a
     return aEncoder.Encode(bssid);
 }
 
-CHIP_ERROR WiFiDiagosticsGlobalInstance::ReadSecurityType(AttributeValueEncoder & aEncoder)
+CHIP_ERROR WiFiDiagnosticsGlobalInstance::ReadSecurityType(AttributeValueEncoder & aEncoder)
 {
     Attributes::SecurityType::TypeInfo::Type securityType;
     SecurityTypeEnum value = SecurityTypeEnum::kUnspecified;
@@ -133,7 +133,7 @@ CHIP_ERROR WiFiDiagosticsGlobalInstance::ReadSecurityType(AttributeValueEncoder
     return aEncoder.Encode(securityType);
 }
 
-CHIP_ERROR WiFiDiagosticsGlobalInstance::ReadWiFiVersion(AttributeValueEncoder & aEncoder)
+CHIP_ERROR WiFiDiagnosticsGlobalInstance::ReadWiFiVersion(AttributeValueEncoder & aEncoder)
 {
     Attributes::WiFiVersion::TypeInfo::Type version;
     WiFiVersionEnum value = WiFiVersionEnum::kUnknownEnumValue;
@@ -151,7 +151,7 @@ CHIP_ERROR WiFiDiagosticsGlobalInstance::ReadWiFiVersion(AttributeValueEncoder &
     return aEncoder.Encode(version);
 }
 
-CHIP_ERROR WiFiDiagosticsGlobalInstance::ReadChannelNumber(AttributeValueEncoder & aEncoder)
+CHIP_ERROR WiFiDiagnosticsGlobalInstance::ReadChannelNumber(AttributeValueEncoder & aEncoder)
 {
     Attributes::ChannelNumber::TypeInfo::Type channelNumber;
     uint16_t value = 0;
@@ -169,7 +169,7 @@ CHIP_ERROR WiFiDiagosticsGlobalInstance::ReadChannelNumber(AttributeValueEncoder
     return aEncoder.Encode(channelNumber);
 }
 
-CHIP_ERROR WiFiDiagosticsGlobalInstance::ReadWiFiRssi(AttributeValueEncoder & aEncoder)
+CHIP_ERROR WiFiDiagnosticsGlobalInstance::ReadWiFiRssi(AttributeValueEncoder & aEncoder)
 {
     Attributes::Rssi::TypeInfo::Type rssi;
     int8_t value = 0;
@@ -188,7 +188,7 @@ CHIP_ERROR WiFiDiagosticsGlobalInstance::ReadWiFiRssi(AttributeValueEncoder & aE
     return aEncoder.Encode(rssi);
 }
 
-CHIP_ERROR WiFiDiagosticsGlobalInstance::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
+CHIP_ERROR WiFiDiagnosticsGlobalInstance::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
 {
     if (aPath.mClusterId != WiFiNetworkDiagnostics::Id)
     {
@@ -252,7 +252,7 @@ CHIP_ERROR WiFiDiagosticsGlobalInstance::Read(const ConcreteReadAttributePath &
     return CHIP_NO_ERROR;
 }
 
-void WiFiDiagosticsGlobalInstance::InvokeCommand(HandlerContext & handlerContext)
+void WiFiDiagnosticsGlobalInstance::InvokeCommand(HandlerContext & handlerContext)
 {
     switch (handlerContext.mRequestPath.mCommandId)
     {
@@ -266,14 +266,14 @@ void WiFiDiagosticsGlobalInstance::InvokeCommand(HandlerContext & handlerContext
 }
 
 #ifdef WI_FI_NETWORK_DIAGNOSTICS_ENABLE_RESET_COUNTS_CMD
-void WiFiDiagosticsGlobalInstance::HandleResetCounts(HandlerContext & ctx, const Commands::ResetCounts::DecodableType & commandData)
+void WiFiDiagnosticsGlobalInstance::HandleResetCounts(HandlerContext & ctx, const Commands::ResetCounts::DecodableType & commandData)
 {
     mDiagnosticProvider.ResetWiFiNetworkDiagnosticsCounts();
     ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::Success);
 }
 #endif
 
-WiFiDiagosticsGlobalInstance gWiFiDiagosticsInstance(DeviceLayer::GetDiagnosticDataProvider());
+WiFiDiagnosticsGlobalInstance gWiFiDiagnosticsInstance(DeviceLayer::GetDiagnosticDataProvider());
 
 } // anonymous namespace
 
@@ -353,8 +353,8 @@ void WiFiDiagnosticsServer::OnConnectionStatusChanged(uint8_t connectionStatus)
 
 void MatterWiFiNetworkDiagnosticsPluginServerInitCallback()
 {
-    AttributeAccessInterfaceRegistry::Instance().Register(&gWiFiDiagosticsInstance);
-    CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(&gWiFiDiagosticsInstance);
+    AttributeAccessInterfaceRegistry::Instance().Register(&gWiFiDiagnosticsInstance);
+    CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(&gWiFiDiagnosticsInstance);
 
     GetDiagnosticDataProvider().SetWiFiDiagnosticsDelegate(&WiFiDiagnosticsServer::Instance());
 }

From 0440ed589730f00804f44a7294c819b4b601bf91 Mon Sep 17 00:00:00 2001
From: Andrei Litvin <andreilitvin@google.com>
Date: Thu, 20 Feb 2025 14:38:23 -0500
Subject: [PATCH 4/5] Restyle

---
 .../software-diagnostics-server.cpp                          | 2 +-
 .../wifi-network-diagnostics-server.cpp                      | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp
index 5d5807015425b1..6d78a13d4f6560 100644
--- a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp
+++ b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp
@@ -104,7 +104,7 @@ CHIP_ERROR SoftwareDiagnosticsAttrAccess::Read(const ConcreteReadAttributePath &
 }
 
 CHIP_ERROR SoftwareDiagnosticsAttrAccess::ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(uint64_t &),
-                                                         AttributeValueEncoder & aEncoder)
+                                                          AttributeValueEncoder & aEncoder)
 {
     uint64_t data;
     CHIP_ERROR err = (DeviceLayer::GetDiagnosticDataProvider().*getter)(data);
diff --git a/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp b/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp
index b46e8cf441bee1..4389a479e34aae 100644
--- a/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp
+++ b/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp
@@ -75,7 +75,7 @@ class WiFiDiagnosticsGlobalInstance : public AttributeAccessInterface, public Co
 
 template <typename T, typename Type>
 CHIP_ERROR WiFiDiagnosticsGlobalInstance::ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(T &), Type & data,
-                                                         AttributeValueEncoder & aEncoder)
+                                                          AttributeValueEncoder & aEncoder)
 {
     T value;
     CHIP_ERROR err = (mDiagnosticProvider.*getter)(value);
@@ -266,7 +266,8 @@ void WiFiDiagnosticsGlobalInstance::InvokeCommand(HandlerContext & handlerContex
 }
 
 #ifdef WI_FI_NETWORK_DIAGNOSTICS_ENABLE_RESET_COUNTS_CMD
-void WiFiDiagnosticsGlobalInstance::HandleResetCounts(HandlerContext & ctx, const Commands::ResetCounts::DecodableType & commandData)
+void WiFiDiagnosticsGlobalInstance::HandleResetCounts(HandlerContext & ctx,
+                                                      const Commands::ResetCounts::DecodableType & commandData)
 {
     mDiagnosticProvider.ResetWiFiNetworkDiagnosticsCounts();
     ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::Success);

From 3341acde20173632b2c7369429aa7d80332e4ed2 Mon Sep 17 00:00:00 2001
From: "Restyled.io" <commits@restyled.io>
Date: Thu, 20 Feb 2025 19:39:37 +0000
Subject: [PATCH 5/5] Restyled by clang-format

---
 .../ethernet-network-diagnostics-server.cpp                     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp b/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp
index bb95e0200b8578..6b9d3f64544d9b 100644
--- a/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp
+++ b/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp
@@ -55,7 +55,7 @@ class EthernetDiagnosticsAttrAccess : public AttributeAccessInterface
 
 template <typename T>
 CHIP_ERROR EthernetDiagnosticsAttrAccess::ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(T &),
-                                                         AttributeValueEncoder & aEncoder)
+                                                          AttributeValueEncoder & aEncoder)
 {
     T data;
     CHIP_ERROR err = (DeviceLayer::GetDiagnosticDataProvider().*getter)(data);