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..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 @@ -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::Missing(), EthernetNetworkDiagnostics::Id) {} + EthernetDiagnosticsAttrAccess() : AttributeAccessInterface(Optional::Missing(), EthernetNetworkDiagnostics::Id) {} CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; @@ -54,8 +54,8 @@ class EthernetDiagosticsAttrAccess : public AttributeAccessInterface }; template -CHIP_ERROR EthernetDiagosticsAttrAccess::ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(T &), - AttributeValueEncoder & aEncoder) +CHIP_ERROR EthernetDiagnosticsAttrAccess::ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(T &), + AttributeValueEncoder & aEncoder) { T data; CHIP_ERROR err = (DeviceLayer::GetDiagnosticDataProvider().*getter)(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/general-diagnostics-server/general-diagnostics-server.cpp b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp index 0face9c27d078d..69c553c1bc7dfa 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 -#include "app/server/Server.h" #include #include #include @@ -34,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -112,13 +112,13 @@ TestEventTriggerDelegate * GetTriggerDelegateOnMatchingKey(ByteSpan enableKey) return triggerDelegate; } -class GeneralDiagosticsGlobalInstance : public AttributeAccessInterface, - public CommandHandlerInterface, - public DeviceLayer::ConnectivityManagerDelegate +class GeneralDiagnosticsGlobalInstance : public AttributeAccessInterface, + public CommandHandlerInterface, + public DeviceLayer::ConnectivityManagerDelegate { public: // Register for the GeneralDiagnostics cluster on all endpoints. - GeneralDiagosticsGlobalInstance() : + GeneralDiagnosticsGlobalInstance() : AttributeAccessInterface(Optional::Missing(), GeneralDiagnostics::Id), CommandHandlerInterface(Optional::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,8 +234,8 @@ void GeneralDiagosticsGlobalInstance::InvokeCommand(HandlerContext & handlerCont } template -CHIP_ERROR GeneralDiagosticsGlobalInstance::ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(T &), - AttributeValueEncoder & aEncoder) +CHIP_ERROR GeneralDiagnosticsGlobalInstance::ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(T &), + AttributeValueEncoder & aEncoder) { T data; CHIP_ERROR err = (GetDiagnosticDataProvider().*getter)(data); @@ -252,8 +252,8 @@ CHIP_ERROR GeneralDiagosticsGlobalInstance::ReadIfSupported(CHIP_ERROR (Diagnost } template -CHIP_ERROR GeneralDiagosticsGlobalInstance::ReadListIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(T &), - AttributeValueEncoder & aEncoder) +CHIP_ERROR GeneralDiagnosticsGlobalInstance::ReadListIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(T &), + AttributeValueEncoder & aEncoder) { CHIP_ERROR err = CHIP_NO_ERROR; T faultList; @@ -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,8 +303,8 @@ CHIP_ERROR GeneralDiagosticsGlobalInstance::ReadNetworkInterfaces(AttributeValue return err; } -void GeneralDiagosticsGlobalInstance::HandleTestEventTrigger(HandlerContext & ctx, - const Commands::TestEventTrigger::DecodableType & commandData) +void GeneralDiagnosticsGlobalInstance::HandleTestEventTrigger(HandlerContext & ctx, + const Commands::TestEventTrigger::DecodableType & commandData) { auto * triggerDelegate = GetTriggerDelegateOnMatchingKey(commandData.enableKey); if (triggerDelegate == nullptr) @@ -320,8 +320,8 @@ void GeneralDiagosticsGlobalInstance::HandleTestEventTrigger(HandlerContext & ct (handleEventTriggerResult != CHIP_NO_ERROR) ? Status::InvalidCommand : Status::Success); } -void GeneralDiagosticsGlobalInstance::HandleTimeSnapshot(HandlerContext & ctx, - const Commands::TimeSnapshot::DecodableType & commandData) +void GeneralDiagnosticsGlobalInstance::HandleTimeSnapshot(HandlerContext & ctx, + const Commands::TimeSnapshot::DecodableType & commandData) { ChipLogError(Zcl, "Received TimeSnapshot command!"); @@ -353,8 +353,8 @@ void GeneralDiagosticsGlobalInstance::HandleTimeSnapshot(HandlerContext & ctx, } #ifdef GENERAL_DIAGNOSTICS_ENABLE_PAYLOAD_TEST_REQUEST_CMD -void GeneralDiagosticsGlobalInstance::HandlePayloadTestRequest(HandlerContext & ctx, - const Commands::PayloadTestRequest::DecodableType & commandData) +void GeneralDiagnosticsGlobalInstance::HandlePayloadTestRequest(HandlerContext & ctx, + const Commands::PayloadTestRequest::DecodableType & commandData) { // Max allowed is 2048. if (commandData.count > 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) { 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..6d78a13d4f6560 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::Missing(), SoftwareDiagnostics::Id) {} + SoftwareDiagnosticsAttrAccess() : AttributeAccessInterface(Optional::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,8 +103,8 @@ CHIP_ERROR SoftwareDiagosticsAttrAccess::Read(const ConcreteReadAttributePath & return CHIP_NO_ERROR; } -CHIP_ERROR SoftwareDiagosticsAttrAccess::ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(uint64_t &), - AttributeValueEncoder & aEncoder) +CHIP_ERROR SoftwareDiagnosticsAttrAccess::ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(uint64_t &), + AttributeValueEncoder & aEncoder) { uint64_t data; CHIP_ERROR err = (DeviceLayer::GetDiagnosticDataProvider().*getter)(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::Missing(), ThreadNetworkDiagnostics::Id) {} + ThreadDiagnosticsAttrAccess() : AttributeAccessInterface(Optional::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..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 @@ -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::Missing(), WiFiNetworkDiagnostics::Id), CommandHandlerInterface(Optional::Missing(), WiFiNetworkDiagnostics::Id), mDiagnosticProvider(diagnosticProvider) @@ -74,8 +74,8 @@ class WiFiDiagosticsGlobalInstance : public AttributeAccessInterface, public Com }; template -CHIP_ERROR WiFiDiagosticsGlobalInstance::ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(T &), Type & data, - AttributeValueEncoder & aEncoder) +CHIP_ERROR WiFiDiagnosticsGlobalInstance::ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(T &), Type & data, + AttributeValueEncoder & aEncoder) { T value; CHIP_ERROR err = (mDiagnosticProvider.*getter)(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,15 @@ 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 +354,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()); }