diff --git a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp index 6e95ab8ff4a097..aefa7291fe42f4 100644 --- a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp +++ b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp @@ -153,7 +153,9 @@ bool emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback(app::CommandH const Commands::SetRegulatoryConfig::DecodableType & commandData) { DeviceControlServer * server = &DeviceLayer::DeviceControlServer::DeviceControlSvr(); - CheckSuccess(server->SetRegulatoryConfig(commandData.location, commandData.countryCode, commandData.breadcrumb), Failure); + + CheckSuccess(server->SetRegulatoryConfig(to_underlying(commandData.location), commandData.countryCode, commandData.breadcrumb), + Failure); Commands::SetRegulatoryConfigResponse::Type response; response.errorCode = GeneralCommissioningError::kOk; diff --git a/src/app/zap-templates/templates/app/helper.js b/src/app/zap-templates/templates/app/helper.js index cf0b90300431b9..b0cba01b38400e 100644 --- a/src/app/zap-templates/templates/app/helper.js +++ b/src/app/zap-templates/templates/app/helper.js @@ -653,7 +653,6 @@ function isWeaklyTypedEnum(label) "PHYRateType", "RadioFaultType", "RoutingRole", - "RegulatoryLocationType", "SaturationMoveMode", "SaturationStepMode", "SecurityType", diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index d2fae9c15bd373..babcc42f6ae51e 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -1745,7 +1745,7 @@ void DeviceCommissioner::PerformCommissioningStep(DeviceProxy * proxy, Commissio // TODO(cecille): Worthwhile to keep this around as part of the class? // TODO(cecille): Where is the country config actually set? ChipLogProgress(Controller, "Setting Regulatory Config"); - uint8_t regulatoryLocation = EMBER_ZCL_REGULATORY_LOCATION_TYPE_OUTDOOR; + uint8_t regulatoryLocation = to_underlying(app::Clusters::GeneralCommissioning::RegulatoryLocationType::kOutdoor); #if CONFIG_DEVICE_LAYER CHIP_ERROR status = DeviceLayer::ConfigurationMgr().GetRegulatoryLocation(regulatoryLocation); #else diff --git a/src/include/platform/ConfigurationManager.h b/src/include/platform/ConfigurationManager.h index a0ef92f3a91327..5103f6b8e4cdb6 100644 --- a/src/include/platform/ConfigurationManager.h +++ b/src/include/platform/ConfigurationManager.h @@ -26,7 +26,7 @@ #include -#include +#include #include #include #include @@ -191,7 +191,7 @@ extern void SetConfigurationMgr(ConfigurationManager * configurationManager); inline CHIP_ERROR ConfigurationManager::GetLocationCapability(uint8_t & location) { - location = EMBER_ZCL_REGULATORY_LOCATION_TYPE_INDOOR; + location = to_underlying(chip::app::Clusters::GeneralCommissioning::RegulatoryLocationType::kIndoor); return CHIP_NO_ERROR; } diff --git a/src/platform/Linux/ConfigurationManagerImpl.cpp b/src/platform/Linux/ConfigurationManagerImpl.cpp index 7b89e756fd2b5d..d536cf672a9dec 100644 --- a/src/platform/Linux/ConfigurationManagerImpl.cpp +++ b/src/platform/Linux/ConfigurationManagerImpl.cpp @@ -25,7 +25,7 @@ #include -#include +#include #include #include #include @@ -94,14 +94,14 @@ CHIP_ERROR ConfigurationManagerImpl::Init() if (!PosixConfig::ConfigValueExists(PosixConfig::kConfigKey_RegulatoryLocation)) { - uint32_t location = EMBER_ZCL_REGULATORY_LOCATION_TYPE_INDOOR; + uint32_t location = to_underlying(chip::app::Clusters::GeneralCommissioning::RegulatoryLocationType::kIndoor); err = WriteConfigValue(PosixConfig::kConfigKey_RegulatoryLocation, location); SuccessOrExit(err); } if (!PosixConfig::ConfigValueExists(PosixConfig::kConfigKey_LocationCapability)) { - uint32_t location = EMBER_ZCL_REGULATORY_LOCATION_TYPE_INDOOR; + uint32_t location = to_underlying(chip::app::Clusters::GeneralCommissioning::RegulatoryLocationType::kIndoor); err = WriteConfigValue(PosixConfig::kConfigKey_LocationCapability, location); SuccessOrExit(err); } diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 04b0682ab2b250..89f5b534549069 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -9624,9 +9624,6 @@ enum class GeneralCommissioningError : uint8_t kInvalidAuthentication = 0x02, kNotCommissioning = 0x03, }; -// Need to convert consumers to using the new enum classes, so we -// don't just have casts all over. -#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM // Enum for RegulatoryLocationType enum class RegulatoryLocationType : uint8_t { @@ -9634,9 +9631,6 @@ enum class RegulatoryLocationType : uint8_t kOutdoor = 0x01, kIndoorOutdoor = 0x02, }; -#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -using RegulatoryLocationType = EmberAfRegulatoryLocationType; -#endif namespace Structs { namespace BasicCommissioningInfoType { diff --git a/zzz_generated/app-common/app-common/zap-generated/enums.h b/zzz_generated/app-common/app-common/zap-generated/enums.h index 84b72c07624aad..e7e484c85776e0 100644 --- a/zzz_generated/app-common/app-common/zap-generated/enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/enums.h @@ -413,14 +413,6 @@ enum EmberAfRadioFaultType : uint8_t EMBER_ZCL_RADIO_FAULT_TYPE_ETHERNET_FAULT = 6, }; -// Enum for RegulatoryLocationType -enum EmberAfRegulatoryLocationType : uint8_t -{ - EMBER_ZCL_REGULATORY_LOCATION_TYPE_INDOOR = 0, - EMBER_ZCL_REGULATORY_LOCATION_TYPE_OUTDOOR = 1, - EMBER_ZCL_REGULATORY_LOCATION_TYPE_INDOOR_OUTDOOR = 2, -}; - // Enum for RoutingRole enum EmberAfRoutingRole : uint8_t {