Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo: diagostics - diagNostics #37689

Merged
merged 7 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -54,8 +54,8 @@ class EthernetDiagosticsAttrAccess : public AttributeAccessInterface
};

template <typename T>
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);
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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<EndpointId>::Missing(), GeneralDiagnostics::Id),
CommandHandlerInterface(Optional<EndpointId>::Missing(), GeneralDiagnostics::Id)
{}
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand All @@ -234,8 +234,8 @@ void GeneralDiagosticsGlobalInstance::InvokeCommand(HandlerContext & handlerCont
}

template <typename T>
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);
Expand All @@ -252,8 +252,8 @@ CHIP_ERROR GeneralDiagosticsGlobalInstance::ReadIfSupported(CHIP_ERROR (Diagnost
}

template <typename T>
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;
Expand All @@ -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;
Expand All @@ -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)
Expand All @@ -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!");

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -389,7 +389,7 @@ void GeneralDiagosticsGlobalInstance::HandlePayloadTestRequest(HandlerContext &
}
#endif // GENERAL_DIAGNOSTICS_ENABLE_PAYLOAD_TEST_REQUEST_CMD

GeneralDiagosticsGlobalInstance gGeneralDiagosticsInstance;
GeneralDiagnosticsGlobalInstance gGeneralDiagnosticsInstance;

} // anonymous namespace

Expand Down Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)
{
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -74,8 +74,8 @@ class WiFiDiagosticsGlobalInstance : public AttributeAccessInterface, public Com
};

template <typename T, typename Type>
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);
Expand All @@ -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;

Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand All @@ -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

Expand Down Expand Up @@ -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());
}
Loading