Skip to content

Commit

Permalink
Remove PHYRateEnum from the list of WeakEnums (#30530)
Browse files Browse the repository at this point in the history
* Remove ZCL for PHYRateEnum

* make it compile

* Restyle

---------

Co-authored-by: Andrei Litvin <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Feb 6, 2024
1 parent 5f210ba commit 1545541
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,13 @@ CHIP_ERROR EthernetDiagosticsAttrAccess::ReadIfSupported(CHIP_ERROR (DiagnosticD
CHIP_ERROR EthernetDiagosticsAttrAccess::ReadPHYRate(AttributeValueEncoder & aEncoder)
{
Attributes::PHYRate::TypeInfo::Type pHYRate;
auto value = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE10_M;
auto value = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate10M;

if (DeviceLayer::GetDiagnosticDataProvider().GetEthPHYRate(value) == CHIP_NO_ERROR)
{
pHYRate.SetNonNull(value);
ChipLogProgress(Zcl, "The current nominal, usable speed at the top of the physical layer of the Node: %d", value);
ChipLogProgress(Zcl, "The current nominal, usable speed at the top of the physical layer of the Node: %d",
chip::to_underlying(value));
}
else
{
Expand Down
1 change: 0 additions & 1 deletion src/app/common/templates/config-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ WeakEnums:
- ColorControlOptions
- ColorMode
- EnhancedColorMode
- PHYRateEnum

EnumsNotUsedAsTypeInXML:
# List of enums that are not used as a type in XML. By adding an enum
Expand Down
20 changes: 10 additions & 10 deletions src/platform/Linux/ConnectivityUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,34 +658,34 @@ CHIP_ERROR ConnectivityUtils::GetEthPHYRate(const char * ifname, app::Clusters::
switch (speed)
{
case 10:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE10_M;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate10M;
break;
case 100:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE100_M;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate100M;
break;
case 1000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE1_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate1G;
break;
case 25000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE2_5_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate25g;
break;
case 5000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE5_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate5G;
break;
case 10000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE10_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate10G;
break;
case 40000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE40_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate40G;
break;
case 100000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE100_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate100G;
break;
case 200000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE200_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate200G;
break;
case 400000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE400_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate400G;
break;
default:
ChipLogError(DeviceLayer, "Undefined speed! (%d)\n", speed);
Expand Down
20 changes: 10 additions & 10 deletions src/platform/Tizen/ConnectivityUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,34 +447,34 @@ CHIP_ERROR ConnectivityUtils::GetEthPHYRate(const char * ifname, PHYRateEnum & p
switch (speed)
{
case 10:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE10_M;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate10M;
break;
case 100:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE100_M;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate100M;
break;
case 1000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE1_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate1G;
break;
case 25000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE2_5_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate25g;
break;
case 5000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE5_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate5G;
break;
case 10000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE10_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate10G;
break;
case 40000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE40_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate40G;
break;
case 100000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE100_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate100G;
break;
case 200000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE200_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate200G;
break;
case 400000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE400_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate400G;
break;
default:
ChipLogError(DeviceLayer, "Undefined speed! (%d)\n", speed);
Expand Down
20 changes: 10 additions & 10 deletions src/platform/webos/ConnectivityUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -566,34 +566,34 @@ CHIP_ERROR ConnectivityUtils::GetEthPHYRate(const char * ifname, app::Clusters::
switch (speed)
{
case 10:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE10_M;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate10M;
break;
case 100:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE100_M;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate100M;
break;
case 1000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE1_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate1G;
break;
case 25000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE2_5_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate25g;
break;
case 5000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE5_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate5G;
break;
case 10000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE10_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate10G;
break;
case 40000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE40_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate40G;
break;
case 100000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE100_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate100G;
break;
case 200000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE200_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate200G;
break;
case 400000:
pHYRate = EmberAfPHYRateEnum::EMBER_ZCL_PHY_RATE_ENUM_RATE400_G;
pHYRate = app::Clusters::EthernetNetworkDiagnostics::PHYRateEnum::kRate400G;
break;
default:
ChipLogError(DeviceLayer, "Undefined speed! (%d)\n", speed);
Expand Down

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.

15 changes: 0 additions & 15 deletions zzz_generated/app-common/app-common/zap-generated/enums.h

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

0 comments on commit 1545541

Please sign in to comment.