Skip to content

Commit

Permalink
Align naming in Ethernet Network Diagnostics cluster XML with the spec.
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple committed Jan 17, 2023
1 parent 9fbcf1c commit 47e37c9
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ CHIP_ERROR EthernetDiagosticsAttrAccess::ReadIfSupported(CHIP_ERROR (DiagnosticD
CHIP_ERROR EthernetDiagosticsAttrAccess::ReadPHYRate(AttributeValueEncoder & aEncoder)
{
Attributes::PHYRate::TypeInfo::Type pHYRate;
auto value = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE10_M;
auto value = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE10_M;

if (DeviceLayer::GetDiagnosticDataProvider().GetEthPHYRate(value) == CHIP_NO_ERROR)
{
Expand Down
2 changes: 1 addition & 1 deletion src/app/common/templates/weak-enum-list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
- OnOffDelayedAllOffEffectVariant
- OnOffDyingLightEffectVariant
- OnOffEffectIdentifier
- PHYRate
- PHYRateEnum
- RadioFault
- RoutingRole
- SaturationMoveMode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
-->
<configurator>
<domain name="CHIP"/>
<enum name="PHYRate" type="ENUM8">
<enum name="PHYRateEnum" type="ENUM8">
<cluster code="0x0037"/>
<item name="Rate10M" value="0x00"/>
<item name="Rate100M" value="0x01"/>
Expand All @@ -35,7 +35,7 @@ limitations under the License.
<code>0x0037</code>
<define>ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER</define>
<description>The Ethernet Network Diagnostics Cluster provides 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="PHY_RATE" type="PHYRate" writable="false" isNullable="true" optional="true">PHYRate</attribute>
<attribute side="server" code="0x00" define="PHY_RATE" type="PHYRateEnum" writable="false" isNullable="true" optional="true">PHYRate</attribute>
<attribute side="server" code="0x01" define="FULL_DUPLEX" type="BOOLEAN" min="0x00" max="0x01" writable="false" isNullable="true" optional="true">FullDuplex</attribute>
<attribute side="server" code="0x02" define="PACKET_RX_COUNT" type="INT64U" min="0x0000000000000000" max="0xFFFFFFFFFFFFFFFF" writable="false" default="0x0000000000000000" optional="true">PacketRxCount</attribute>
<attribute side="server" code="0x03" define="PACKET_TX_COUNT" type="INT64U" min="0x0000000000000000" max="0xFFFFFFFFFFFFFFFF" writable="false" default="0x0000000000000000" optional="true">PacketTxCount</attribute>
Expand Down
10 changes: 5 additions & 5 deletions src/darwin/Framework/CHIP/templates/availability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5157,7 +5157,7 @@
ThreadNetworkDiagnostics:
- ConnectionStatusEnum
EthernetNetworkDiagnostics:
- PHYRate
- PHYRateEnum
GeneralDiagnostics:
- HardwareFault
- RadioFault
Expand Down Expand Up @@ -5235,7 +5235,7 @@
- Ac
- Ax
EthernetNetworkDiagnostics:
PHYRate:
PHYRateEnum:
- Rate10M
- Rate100M
- Rate1G
Expand Down Expand Up @@ -5460,7 +5460,7 @@
- Rate100G
- Rate200G
- Rate400G
PHYRate:
PHYRateEnum:
- 10M
- 100M
- 1000M
Expand Down Expand Up @@ -5559,7 +5559,7 @@
ThreadNetworkDiagnostics:
ConnectionStatusEnum: ThreadConnectionStatus
EthernetNetworkDiagnostics:
PHYRate: PHYRateType
PHYRateEnum: PHYRateType
GeneralDiagnostics:
HardwareFault: HardwareFaultType
RadioFault: RadioFaultType
Expand All @@ -5580,7 +5580,7 @@
Ac: 80211ac
Ax: 80211ax
EthernetNetworkDiagnostics:
PHYRate:
PHYRateEnum:
Rate10M: 10M
Rate100M: 100M
Rate1G: 1000M
Expand Down
4 changes: 2 additions & 2 deletions src/include/platform/DiagnosticDataProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class DiagnosticDataProvider
/**
* Ethernet network diagnostics methods
*/
virtual CHIP_ERROR GetEthPHYRate(app::Clusters::EthernetNetworkDiagnostics::PHYRate & pHYRate);
virtual CHIP_ERROR GetEthPHYRate(app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum & pHYRate);
virtual CHIP_ERROR GetEthFullDuplex(bool & fullDuplex);
virtual CHIP_ERROR GetEthCarrierDetect(bool & carrierDetect);
virtual CHIP_ERROR GetEthTimeSinceReset(uint64_t & timeSinceReset);
Expand Down Expand Up @@ -278,7 +278,7 @@ inline CHIP_ERROR DiagnosticDataProvider::GetNetworkInterfaces(NetworkInterface

inline void DiagnosticDataProvider::ReleaseNetworkInterfaces(NetworkInterface * netifp) {}

inline CHIP_ERROR DiagnosticDataProvider::GetEthPHYRate(app::Clusters::EthernetNetworkDiagnostics::PHYRate & pHYRate)
inline CHIP_ERROR DiagnosticDataProvider::GetEthPHYRate(app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum & pHYRate)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}
Expand Down
22 changes: 11 additions & 11 deletions src/platform/Linux/ConnectivityUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ CHIP_ERROR ConnectivityUtils::GetEthInterfaceName(char * ifname, size_t bufSize)
return err;
}

CHIP_ERROR ConnectivityUtils::GetEthPHYRate(const char * ifname, app::Clusters::EthernetNetworkDiagnostics::PHYRate & pHYRate)
CHIP_ERROR ConnectivityUtils::GetEthPHYRate(const char * ifname, app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum & pHYRate)
{
CHIP_ERROR err = CHIP_NO_ERROR;

Expand Down Expand Up @@ -658,34 +658,34 @@ CHIP_ERROR ConnectivityUtils::GetEthPHYRate(const char * ifname, app::Clusters::
switch (speed)
{
case 10:
pHYRate = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE10_M;
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE10_M;
break;
case 100:
pHYRate = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE100_M;
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE100_M;
break;
case 1000:
pHYRate = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE1_G;
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE1_G;
break;
case 25000:
pHYRate = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE2_5_G;
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE2_5_G;
break;
case 5000:
pHYRate = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE5_G;
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE5_G;
break;
case 10000:
pHYRate = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE10_G;
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE10_G;
break;
case 40000:
pHYRate = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE40_G;
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE40_G;
break;
case 100000:
pHYRate = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE100_G;
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE100_G;
break;
case 200000:
pHYRate = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE200_G;
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE200_G;
break;
case 400000:
pHYRate = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE400_G;
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE400_G;
break;
default:
ChipLogError(DeviceLayer, "Undefined speed! (%d)\n", speed);
Expand Down
2 changes: 1 addition & 1 deletion src/platform/Linux/ConnectivityUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ConnectivityUtils
static CHIP_ERROR GetWiFiBeaconLostCount(const char * ifname, uint32_t & beaconLostCount);
static CHIP_ERROR GetWiFiCurrentMaxRate(const char * ifname, uint64_t & currentMaxRate);
static CHIP_ERROR GetEthInterfaceName(char * ifname, size_t bufSize);
static CHIP_ERROR GetEthPHYRate(const char * ifname, app::Clusters::EthernetNetworkDiagnostics::PHYRate & pHYRate);
static CHIP_ERROR GetEthPHYRate(const char * ifname, app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum & pHYRate);
static CHIP_ERROR GetEthFullDuplex(const char * ifname, bool & fullDuplex);

private:
Expand Down
2 changes: 1 addition & 1 deletion src/platform/Linux/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ void DiagnosticDataProviderImpl::ReleaseNetworkInterfaces(NetworkInterface * net
}
}

CHIP_ERROR DiagnosticDataProviderImpl::GetEthPHYRate(app::Clusters::EthernetNetworkDiagnostics::PHYRate & pHYRate)
CHIP_ERROR DiagnosticDataProviderImpl::GetEthPHYRate(app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum & pHYRate)
{
if (ConnectivityMgrImpl().GetEthernetIfName() == nullptr)
{
Expand Down
2 changes: 1 addition & 1 deletion src/platform/Linux/DiagnosticDataProviderImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider
CHIP_ERROR GetNetworkInterfaces(NetworkInterface ** netifpp) override;
void ReleaseNetworkInterfaces(NetworkInterface * netifp) override;

CHIP_ERROR GetEthPHYRate(app::Clusters::EthernetNetworkDiagnostics::PHYRate & pHYRate) override;
CHIP_ERROR GetEthPHYRate(app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum & pHYRate) override;
CHIP_ERROR GetEthFullDuplex(bool & fullDuplex) override;
CHIP_ERROR GetEthTimeSinceReset(uint64_t & timeSinceReset) override;
CHIP_ERROR GetEthPacketRxCount(uint64_t & packetRxCount) override;
Expand Down
2 changes: 1 addition & 1 deletion src/platform/nxp/mw320/ConnectivityUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ConnectivityUtils
static CHIP_ERROR GetWiFiBeaconLostCount(const char * ifname, uint32_t & beaconLostCount);
static CHIP_ERROR GetWiFiCurrentMaxRate(const char * ifname, uint64_t & currentMaxRate);
static CHIP_ERROR GetEthInterfaceName(char * ifname, size_t bufSize);
// static CHIP_ERROR GetEthPHYRate(const char * ifname, app::Clusters::EthernetNetworkDiagnostics::PHYRate & pHYRate);
// static CHIP_ERROR GetEthPHYRate(const char * ifname, app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum & pHYRate);
// static CHIP_ERROR GetEthFullDuplex(const char * ifname, bool & fullDuplex);

private:
Expand Down
22 changes: 11 additions & 11 deletions src/platform/webos/ConnectivityUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ CHIP_ERROR ConnectivityUtils::GetEthInterfaceName(char * ifname, size_t bufSize)
return err;
}

CHIP_ERROR ConnectivityUtils::GetEthPHYRate(const char * ifname, app::Clusters::EthernetNetworkDiagnostics::PHYRate & pHYRate)
CHIP_ERROR ConnectivityUtils::GetEthPHYRate(const char * ifname, app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum & pHYRate)
{
CHIP_ERROR err = CHIP_NO_ERROR;

Expand Down Expand Up @@ -566,34 +566,34 @@ CHIP_ERROR ConnectivityUtils::GetEthPHYRate(const char * ifname, app::Clusters::
switch (speed)
{
case 10:
pHYRate = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE10_M;
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE10_M;
break;
case 100:
pHYRate = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE100_M;
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE100_M;
break;
case 1000:
pHYRate = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE1_G;
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE1_G;
break;
case 25000:
pHYRate = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE2_5_G;
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE2_5_G;
break;
case 5000:
pHYRate = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE5_G;
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE5_G;
break;
case 10000:
pHYRate = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE10_G;
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE10_G;
break;
case 40000:
pHYRate = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE40_G;
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE40_G;
break;
case 100000:
pHYRate = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE100_G;
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE100_G;
break;
case 200000:
pHYRate = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE200_G;
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE200_G;
break;
case 400000:
pHYRate = EmberAfPHYRate::EMBER_ZCL_PHY_RATE_RATE400_G;
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE400_G;
break;
default:
ChipLogError(DeviceLayer, "Undefined speed! (%d)\n", speed);
Expand Down
2 changes: 1 addition & 1 deletion src/platform/webos/ConnectivityUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ConnectivityUtils
static CHIP_ERROR GetWiFiBeaconLostCount(const char * ifname, uint32_t & beaconLostCount);
static CHIP_ERROR GetWiFiCurrentMaxRate(const char * ifname, uint64_t & currentMaxRate);
static CHIP_ERROR GetEthInterfaceName(char * ifname, size_t bufSize);
static CHIP_ERROR GetEthPHYRate(const char * ifname, app::Clusters::EthernetNetworkDiagnostics::PHYRate & pHYRate);
static CHIP_ERROR GetEthPHYRate(const char * ifname, app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum & pHYRate);
static CHIP_ERROR GetEthFullDuplex(const char * ifname, bool & fullDuplex);

private:
Expand Down
2 changes: 1 addition & 1 deletion src/platform/webos/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ void DiagnosticDataProviderImpl::ReleaseNetworkInterfaces(NetworkInterface * net
}
}

CHIP_ERROR DiagnosticDataProviderImpl::GetEthPHYRate(app::Clusters::EthernetNetworkDiagnostics::PHYRate & pHYRate)
CHIP_ERROR DiagnosticDataProviderImpl::GetEthPHYRate(app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum & pHYRate)
{
if (ConnectivityMgrImpl().GetEthernetIfName() == nullptr)
{
Expand Down
2 changes: 1 addition & 1 deletion src/platform/webos/DiagnosticDataProviderImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider
CHIP_ERROR GetNetworkInterfaces(NetworkInterface ** netifpp) override;
void ReleaseNetworkInterfaces(NetworkInterface * netifp) override;

CHIP_ERROR GetEthPHYRate(app::Clusters::EthernetNetworkDiagnostics::PHYRate & pHYRate) override;
CHIP_ERROR GetEthPHYRate(app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum & pHYRate) override;
CHIP_ERROR GetEthFullDuplex(bool & fullDuplex) override;
CHIP_ERROR GetEthTimeSinceReset(uint64_t & timeSinceReset) override;
CHIP_ERROR GetEthPacketRxCount(uint64_t & packetRxCount) override;
Expand Down

0 comments on commit 47e37c9

Please sign in to comment.