From 4b515e854667e135a18d73b2422669f64e56b055 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 17 Nov 2023 13:37:17 -0500 Subject: [PATCH] Remove WeakEnums for `Color Control Cluster` (and all weakenum handling as a result) (#30524) * Remove color control types as they are not spec defined currently. Remove them from weak enums * zap regen * make it compile * Restyle * Fix imgui compilation. Had to have separate constants unfortunately * Fix compilation * Fix tizen compilation * Restyle * fix another tizen build error * Remove include of enums.h * Remove WeakEnumHandling * Zap regen all * Restyle * Remove one more reference --------- Co-authored-by: Andrei Litvin --- examples/common/imgui_ui/windows/light.cpp | 14 +-- examples/common/imgui_ui/windows/light.h | 7 +- .../lighting-app/tizen/src/DBusInterface.cpp | 4 +- examples/lighting-app/tizen/src/main.cpp | 4 +- examples/thermostat/silabs/src/AppTask.cpp | 1 - examples/tv-app/android/java/AppImpl.h | 1 - examples/tv-app/tv-common/include/AppTv.h | 1 - .../window-app/silabs/include/LcdPainter.h | 3 - src/app/app-platform/ContentApp.h | 1 - src/app/app-platform/ContentAppPlatform.h | 1 - .../access-control-server.cpp | 1 - .../color-control-server.cpp | 111 +++++++++++------- .../color-control-server.h | 10 +- .../fan-control-server/fan-control-server.h | 1 - .../laundry-washer-controls-server.cpp | 1 - .../occupancy-sensor-server.cpp | 1 - .../operational-credentials-server.cpp | 1 - .../ota-provider/ota-provider-delegate.h | 1 - .../thermostat-server/thermostat-server.cpp | 1 - .../window-covering-server.h | 1 - src/app/common/templates/config-data.yaml | 7 -- src/app/common/templates/templates.json | 5 - .../templates/app/cluster-enums-check.zapt | 12 -- .../templates/app/cluster-enums.zapt | 12 -- .../templates/app/cluster-objects.zapt | 1 - .../zap-templates/templates/app/enums.zapt | 20 ---- .../data-model/draft/types/color-control.xml | 28 ----- .../zcl/zcl-with-test-extensions.json | 1 - src/app/zap-templates/zcl/zcl.json | 1 - src/controller/CHIPDeviceController.cpp | 3 - .../ESP32/DiagnosticDataProviderImpl.cpp | 1 - src/platform/ESP32/PlatformManagerImpl.cpp | 1 - src/platform/Linux/ConnectivityUtils.cpp | 1 - .../Linux/DiagnosticDataProviderImpl.cpp | 1 - src/platform/Linux/PlatformManagerImpl.cpp | 1 - src/platform/Tizen/ConnectivityUtils.cpp | 1 - .../nxp/common/DiagnosticDataProviderImpl.cpp | 1 - src/platform/nxp/mw320/ConnectivityUtils.cpp | 1 - .../nxp/mw320/DiagnosticDataProviderImpl.cpp | 1 - src/platform/webos/ConnectivityUtils.cpp | 1 - .../webos/DiagnosticDataProviderImpl.cpp | 1 - src/platform/webos/PlatformManagerImpl.cpp | 1 - .../zap-generated/cluster-enums-check.h | 8 -- .../app-common/zap-generated/cluster-enums.h | 9 -- .../zap-generated/cluster-objects.h | 1 - .../app-common/zap-generated/enums.h | 48 -------- 46 files changed, 91 insertions(+), 243 deletions(-) delete mode 100644 src/app/zap-templates/templates/app/enums.zapt delete mode 100644 src/app/zap-templates/zcl/data-model/draft/types/color-control.xml delete mode 100644 zzz_generated/app-common/app-common/zap-generated/enums.h diff --git a/examples/common/imgui_ui/windows/light.cpp b/examples/common/imgui_ui/windows/light.cpp index 1fe6032281a2c6..24f88212ae23a1 100644 --- a/examples/common/imgui_ui/windows/light.cpp +++ b/examples/common/imgui_ui/windows/light.cpp @@ -155,14 +155,14 @@ void Light::Render() ImGui::Text("Color Control:"); ImGui::Indent(); const char * mode = // based on ColorMode attribute: spec 3.2.7.9 - (mColorMode == EMBER_ZCL_COLOR_MODE_CURRENT_HUE_AND_CURRENT_SATURATION) ? "Hue/Saturation" - : (mColorMode == EMBER_ZCL_COLOR_MODE_CURRENT_X_AND_CURRENT_Y) ? "X/Y" - : (mColorMode == EMBER_ZCL_COLOR_MODE_COLOR_TEMPERATURE) ? "Temperature/Mireds" - : "UNKNOWN"; + (mColorMode == kColorModeCurrentHueAndCurrentSaturation) ? "Hue/Saturation" + : (mColorMode == kColorModeCurrentXAndCurrentY) ? "X/Y" + : (mColorMode == kColorModeColorTemperature) ? "Temperature/Mireds" + : "UNKNOWN"; ImGui::Text("Mode: %s", mode); - if (mColorMode == EMBER_ZCL_COLOR_MODE_CURRENT_HUE_AND_CURRENT_SATURATION) + if (mColorMode == kColorModeCurrentHueAndCurrentSaturation) { const float hueDegrees = (mColorHue * 360.0f) / 254.0f; const float saturationPercent = 100.0f * (mColorSaturation / 254.0f); @@ -173,12 +173,12 @@ void Light::Render() ImGui::ColorButton("LightColor", HueSaturationToColor(hueDegrees, saturationPercent), 0 /* ImGuiColorEditFlags_* */, ImVec2(80, 80)); } - else if (mColorMode == EMBER_ZCL_COLOR_MODE_CURRENT_X_AND_CURRENT_Y) + else if (mColorMode == kColorModeCurrentXAndCurrentY) { ImGui::Text("Current X: %d", mColorX); ImGui::Text("Current Y: %d", mColorY); } - else if (mColorMode == EMBER_ZCL_COLOR_MODE_COLOR_TEMPERATURE) + else if (mColorMode == kColorModeColorTemperature) { ImGui::Text("Color Temperature Mireds: %d", mColorTemperatureMireds); } diff --git a/examples/common/imgui_ui/windows/light.h b/examples/common/imgui_ui/windows/light.h index 68d9cebb945da5..20942373d3111c 100644 --- a/examples/common/imgui_ui/windows/light.h +++ b/examples/common/imgui_ui/windows/light.h @@ -44,6 +44,11 @@ class Light : public Window private: const chip::EndpointId mEndpointId; + static constexpr uint8_t kColorModeCurrentHueAndCurrentSaturation = 0; + static constexpr uint8_t kColorModeCurrentXAndCurrentY = 1; + static constexpr uint8_t kColorModeColorTemperature = 2; + static constexpr uint8_t kColorModeEnhancedCurrentHueAndCurrentSaturation = 3; + // OnOff bool mLightIsOn = false; chip::Optional mTargetLightIsOn; // allow UI control of this @@ -57,7 +62,7 @@ class Light : public Window uint16_t mLevelRemainingTime10sOfSec = 0; // Color control - uint8_t mColorMode = EMBER_ZCL_COLOR_MODE_CURRENT_HUE_AND_CURRENT_SATURATION; + uint8_t mColorMode = kColorModeCurrentHueAndCurrentSaturation; uint8_t mColorHue = 0; uint8_t mColorSaturation = 0; uint16_t mColorX = 0; diff --git a/examples/lighting-app/tizen/src/DBusInterface.cpp b/examples/lighting-app/tizen/src/DBusInterface.cpp index e33f5f086f670c..7c6e29d6a1cc38 100644 --- a/examples/lighting-app/tizen/src/DBusInterface.cpp +++ b/examples/lighting-app/tizen/src/DBusInterface.cpp @@ -94,8 +94,8 @@ void DBusInterface::SetCurrentLevel(uint8_t value) void DBusInterface::SetColorMode(chip::app::Clusters::ColorControl::ColorMode colorMode) { InternalSetGuard guard(this); - if (light_app_color_control_get_color_mode(mIfaceColorControl) != colorMode) - light_app_color_control_set_color_mode(mIfaceColorControl, colorMode); + if (light_app_color_control_get_color_mode(mIfaceColorControl) != chip::to_underlying(colorMode)) + light_app_color_control_set_color_mode(mIfaceColorControl, chip::to_underlying(colorMode)); } void DBusInterface::SetColorTemperature(uint16_t value) diff --git a/examples/lighting-app/tizen/src/main.cpp b/examples/lighting-app/tizen/src/main.cpp index 6a32e84b50cb6c..c1cda62a2378d5 100644 --- a/examples/lighting-app/tizen/src/main.cpp +++ b/examples/lighting-app/tizen/src/main.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -122,8 +123,7 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & void emberAfColorControlClusterInitCallback(EndpointId endpoint) { // Set the color mode to color temperature. - Clusters::ColorControl::Attributes::ColorMode::Set(endpoint, - Clusters::ColorControl::ColorMode::EMBER_ZCL_COLOR_MODE_COLOR_TEMPERATURE); + Clusters::ColorControl::Attributes::ColorMode::Set(endpoint, ColorControlServer::EnhancedColorMode::kColorTemperature); // Preserve the state of the color temperature attribute across reboots. Clusters::ColorControl::Attributes::StartUpColorTemperatureMireds::SetNull(endpoint); } diff --git a/examples/thermostat/silabs/src/AppTask.cpp b/examples/thermostat/silabs/src/AppTask.cpp index 22d0bb3010b9ab..b58ad0a288a99e 100644 --- a/examples/thermostat/silabs/src/AppTask.cpp +++ b/examples/thermostat/silabs/src/AppTask.cpp @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/tv-app/android/java/AppImpl.h b/examples/tv-app/android/java/AppImpl.h index a68c60a05ce6d0..657d7e92c0299a 100644 --- a/examples/tv-app/android/java/AppImpl.h +++ b/examples/tv-app/android/java/AppImpl.h @@ -22,7 +22,6 @@ #pragma once -#include #include #include #include diff --git a/examples/tv-app/tv-common/include/AppTv.h b/examples/tv-app/tv-common/include/AppTv.h index e81a9e02568465..5f02536b3b86d0 100644 --- a/examples/tv-app/tv-common/include/AppTv.h +++ b/examples/tv-app/tv-common/include/AppTv.h @@ -22,7 +22,6 @@ #pragma once -#include #include #include #include diff --git a/examples/window-app/silabs/include/LcdPainter.h b/examples/window-app/silabs/include/LcdPainter.h index d0740167bdd06c..adc5775afa7c43 100644 --- a/examples/window-app/silabs/include/LcdPainter.h +++ b/examples/window-app/silabs/include/LcdPainter.h @@ -18,10 +18,7 @@ #pragma once -// clang-format off -#include "app-common/zap-generated/enums.h" #include "app-common/zap-generated/cluster-enums.h" -// clang-format on #include diff --git a/src/app/app-platform/ContentApp.h b/src/app/app-platform/ContentApp.h index bfb45f08b49942..e5eb99a5a701bd 100644 --- a/src/app/app-platform/ContentApp.h +++ b/src/app/app-platform/ContentApp.h @@ -23,7 +23,6 @@ #pragma once #include -#include #include #include #include diff --git a/src/app/app-platform/ContentAppPlatform.h b/src/app/app-platform/ContentAppPlatform.h index 593ec0706a5a15..f05a94ceda7613 100644 --- a/src/app/app-platform/ContentAppPlatform.h +++ b/src/app/app-platform/ContentAppPlatform.h @@ -22,7 +22,6 @@ #pragma once -#include #include #include #include diff --git a/src/app/clusters/access-control-server/access-control-server.cpp b/src/app/clusters/access-control-server/access-control-server.cpp index 81e3f5f1b92157..a5f49cb7c39aa1 100644 --- a/src/app/clusters/access-control-server/access-control-server.cpp +++ b/src/app/clusters/access-control-server/access-control-server.cpp @@ -18,7 +18,6 @@ #include #include -#include #include #include diff --git a/src/app/clusters/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp index b826351b791731..e3645681cb5c4a 100644 --- a/src/app/clusters/color-control-server/color-control-server.cpp +++ b/src/app/clusters/color-control-server/color-control-server.cpp @@ -34,6 +34,31 @@ using namespace chip::app::Clusters; using namespace chip::app::Clusters::ColorControl; using chip::Protocols::InteractionModel::Status; +// These constants are NOT currently spec compliant +// These should be changed once we have real specification enumeration +// names. +namespace chip { +namespace app { +namespace Clusters { +namespace ColorControl { + +namespace EnhancedColorMode { +constexpr uint8_t kCurrentHueAndCurrentSaturation = ColorControlServer::EnhancedColorMode::kCurrentHueAndCurrentSaturation; +constexpr uint8_t kCurrentXAndCurrentY = ColorControlServer::EnhancedColorMode::kCurrentXAndCurrentY; +constexpr uint8_t kColorTemperature = ColorControlServer::EnhancedColorMode::kColorTemperature; +constexpr uint8_t kEnhancedCurrentHueAndCurrentSaturation = + ColorControlServer::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation; +} // namespace EnhancedColorMode + +namespace Options { +constexpr uint8_t kExecuteIfOff = 1; +} // namespace Options + +} // namespace ColorControl +} // namespace Clusters +} // namespace app +} // namespace chip + #ifdef EMBER_AF_PLUGIN_SCENES class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl { @@ -151,7 +176,7 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl uint8_t modeValue; if (EMBER_ZCL_STATUS_SUCCESS != Attributes::EnhancedColorMode::Get(endpoint, &modeValue)) { - modeValue = ColorControlServer::ColorMode::COLOR_MODE_CIE_XY; // Default mode value according to spec + modeValue = ColorControl::EnhancedColorMode::kCurrentXAndCurrentY; // Default mode value according to spec } AddAttributeValuePair(pairs, Attributes::EnhancedColorMode::Id, modeValue, attributeCount); @@ -210,7 +235,7 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl switch (decodePair.attributeID) { case Attributes::CurrentX::Id: - if (SupportsColorMode(endpoint, EMBER_ZCL_ENHANCED_COLOR_MODE_CURRENT_X_AND_CURRENT_Y)) + if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kCurrentXAndCurrentY)) { if (decodePair.attributeValue) colorXTransitionState->finalValue = @@ -218,20 +243,20 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl } break; case Attributes::CurrentY::Id: - if (SupportsColorMode(endpoint, EMBER_ZCL_ENHANCED_COLOR_MODE_CURRENT_X_AND_CURRENT_Y)) + if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kCurrentXAndCurrentY)) { colorYTransitionState->finalValue = std::min(static_cast(decodePair.attributeValue), colorYTransitionState->highLimit); } break; case Attributes::EnhancedCurrentHue::Id: - if (SupportsColorMode(endpoint, EMBER_ZCL_ENHANCED_COLOR_MODE_ENHANCED_CURRENT_HUE_AND_CURRENT_SATURATION)) + if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation)) { colorHueTransitionState->finalEnhancedHue = static_cast(decodePair.attributeValue); } break; case Attributes::CurrentSaturation::Id: - if (SupportsColorMode(endpoint, EMBER_ZCL_ENHANCED_COLOR_MODE_CURRENT_HUE_AND_CURRENT_SATURATION)) + if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation)) { colorSaturationTransitionState->finalValue = std::min(static_cast(decodePair.attributeValue), colorSaturationTransitionState->highLimit); @@ -247,14 +272,15 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl loopTimeValue = static_cast(decodePair.attributeValue); break; case Attributes::ColorTemperatureMireds::Id: - if (SupportsColorMode(endpoint, EMBER_ZCL_ENHANCED_COLOR_MODE_COLOR_TEMPERATURE)) + if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kColorTemperature)) { colorTempTransitionState->finalValue = std::min(static_cast(decodePair.attributeValue), colorTempTransitionState->highLimit); } break; case Attributes::EnhancedColorMode::Id: - if (decodePair.attributeValue <= static_cast(ColorControlServer::ColorMode::COLOR_MODE_EHSV)) + if (decodePair.attributeValue <= + static_cast(ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation)) { targetColorMode = static_cast(decodePair.attributeValue); } @@ -291,25 +317,25 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl // Execute movement to value depending on the mode in the saved scene switch (targetColorMode) { - case ColorControlServer::ColorMode::COLOR_MODE_HSV: + case ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation: #ifdef EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_HSV ColorControlServer::Instance().moveToSaturation(static_cast(colorSaturationTransitionState->finalValue), transitionTime10th, endpoint); #endif // EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_HSV break; - case ColorControlServer::ColorMode::COLOR_MODE_CIE_XY: + case ColorControl::EnhancedColorMode::kCurrentXAndCurrentY: #ifdef EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_XY ColorControlServer::Instance().moveToColor(colorXTransitionState->finalValue, colorYTransitionState->finalValue, transitionTime10th, endpoint); #endif // EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_XY break; - case ColorControlServer::ColorMode::COLOR_MODE_TEMPERATURE: + case ColorControl::EnhancedColorMode::kColorTemperature: #ifdef EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP ColorControlServer::Instance().moveToColorTemp( endpoint, static_cast(colorTempTransitionState->finalValue), transitionTime10th); #endif // EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP break; - case ColorControlServer::ColorMode::COLOR_MODE_EHSV: + case ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation: #ifdef EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_HSV ColorControlServer::Instance().moveToHueAndSaturation( colorHueTransitionState->finalEnhancedHue, static_cast(colorSaturationTransitionState->finalValue), @@ -328,16 +354,16 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl { switch (mode) { - case EMBER_ZCL_ENHANCED_COLOR_MODE_CURRENT_HUE_AND_CURRENT_SATURATION: + case ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation: return ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kHueAndSaturation); break; - case EMBER_ZCL_ENHANCED_COLOR_MODE_CURRENT_X_AND_CURRENT_Y: + case ColorControl::EnhancedColorMode::kCurrentXAndCurrentY: return ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kXy); break; - case EMBER_ZCL_ENHANCED_COLOR_MODE_COLOR_TEMPERATURE: + case ColorControl::EnhancedColorMode::kColorTemperature: return ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kColorTemperature); break; - case EMBER_ZCL_ENHANCED_COLOR_MODE_ENHANCED_CURRENT_HUE_AND_CURRENT_SATURATION: + case ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation: return ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kEnhancedHue); break; default: @@ -508,18 +534,18 @@ bool ColorControlServer::shouldExecuteIfOff(EndpointId endpoint, uint8_t optionM // 0xFF are the default values passed to the command handler when // the payload is not present - in that case there is use of option // attribute to decide execution of the command - return READBITS(options, EMBER_ZCL_COLOR_CONTROL_OPTIONS_EXECUTE_IF_OFF); + return READBITS(options, ColorControl::Options::kExecuteIfOff); } // ---------- The above is to distinguish if the payload is present or not - if (READBITS(optionMask, EMBER_ZCL_COLOR_CONTROL_OPTIONS_EXECUTE_IF_OFF)) + if (READBITS(optionMask, ColorControl::Options::kExecuteIfOff)) { // Mask is present and set in the command payload, this indicates // use the override as temporary option - return READBITS(optionOverride, EMBER_ZCL_COLOR_CONTROL_OPTIONS_EXECUTE_IF_OFF); + return READBITS(optionOverride, ColorControl::Options::kExecuteIfOff); } // if we are here - use the option attribute bits - return (READBITS(options, EMBER_ZCL_COLOR_CONTROL_OPTIONS_EXECUTE_IF_OFF)); + return (READBITS(options, ColorControl::Options::kExecuteIfOff)); } /** @@ -546,10 +572,11 @@ void ColorControlServer::handleModeSwitch(EndpointId endpoint, uint8_t newColorM } Attributes::EnhancedColorMode::Set(endpoint, newColorMode); - if (newColorMode == ColorControlServer::ColorMode::COLOR_MODE_EHSV) + if (newColorMode == ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation) { - // Transpose COLOR_MODE_EHSV to COLOR_MODE_HSV after setting EnhancedColorMode - newColorMode = ColorControlServer::ColorMode::COLOR_MODE_HSV; + // Transpose COLOR_MODE_EHSV to ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation after setting + // EnhancedColorMode + newColorMode = ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation; } Attributes::ColorMode::Set(endpoint, newColorMode); @@ -1204,7 +1231,7 @@ Status ColorControlServer::moveToSaturation(uint8_t saturation, uint16_t transit stopAllColorTransitions(endpoint); // Handle color mode transition, if necessary. - handleModeSwitch(endpoint, COLOR_MODE_HSV); + handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation); // now, kick off the state machine. initSaturationTransitionState(endpoint, colorSaturationTransitionState); @@ -1255,11 +1282,11 @@ Status ColorControlServer::moveToHueAndSaturation(uint16_t hue, uint8_t saturati // Handle color mode transition, if necessary. if (isEnhanced) { - handleModeSwitch(endpoint, ColorMode::COLOR_MODE_EHSV); + handleModeSwitch(endpoint, EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation); } else { - handleModeSwitch(endpoint, ColorMode::COLOR_MODE_HSV); + handleModeSwitch(endpoint, EnhancedColorMode::kCurrentHueAndCurrentSaturation); } // now, kick off the state machine. @@ -1363,11 +1390,11 @@ bool ColorControlServer::moveHueCommand(app::CommandHandler * commandObj, const // Handle color mode transition, if necessary. if (isEnhanced) { - handleModeSwitch(endpoint, ColorControlServer::ColorMode::COLOR_MODE_EHSV); + handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation); } else { - handleModeSwitch(endpoint, ColorControlServer::ColorMode::COLOR_MODE_HSV); + handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation); } if (moveMode == HueMoveMode::kUp) @@ -1510,11 +1537,11 @@ bool ColorControlServer::moveToHueCommand(app::CommandHandler * commandObj, cons // Handle color mode transition, if necessary. if (isEnhanced) { - handleModeSwitch(endpoint, ColorControlServer::ColorMode::COLOR_MODE_EHSV); + handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation); } else { - handleModeSwitch(endpoint, ColorControlServer::ColorMode::COLOR_MODE_HSV); + handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation); } // now, kick off the state machine. @@ -1631,11 +1658,11 @@ bool ColorControlServer::stepHueCommand(app::CommandHandler * commandObj, const // Handle color mode transition, if necessary. if (isEnhanced) { - handleModeSwitch(endpoint, ColorControlServer::ColorMode::COLOR_MODE_EHSV); + handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation); } else { - handleModeSwitch(endpoint, ColorControlServer::ColorMode::COLOR_MODE_HSV); + handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation); } // now, kick off the state machine. @@ -1729,7 +1756,7 @@ bool ColorControlServer::moveSaturationCommand(app::CommandHandler * commandObj, } // Handle color mode transition, if necessary. - handleModeSwitch(endpoint, COLOR_MODE_HSV); + handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation); if (moveMode == SaturationMoveMode::kUp) { @@ -1824,7 +1851,7 @@ bool ColorControlServer::stepSaturationCommand(app::CommandHandler * commandObj, stopAllColorTransitions(endpoint); // Handle color mode transition, if necessary. - handleModeSwitch(endpoint, COLOR_MODE_HSV); + handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation); // now, kick off the state machine. initSaturationTransitionState(endpoint, colorSaturationTransitionState); @@ -2137,7 +2164,7 @@ Status ColorControlServer::moveToColor(uint16_t colorX, uint16_t colorY, uint16_ stopAllColorTransitions(endpoint); // Handle color mode transition, if necessary. - handleModeSwitch(endpoint, ColorMode::COLOR_MODE_CIE_XY); + handleModeSwitch(endpoint, EnhancedColorMode::kCurrentXAndCurrentY); // now, kick off the state machine. Attributes::CurrentX::Get(endpoint, &(colorXTransitionState->initialValue)); @@ -2220,7 +2247,7 @@ bool ColorControlServer::moveColorCommand(app::CommandHandler * commandObj, cons } // Handle color mode transition, if necessary. - handleModeSwitch(endpoint, COLOR_MODE_CIE_XY); + handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kCurrentXAndCurrentY); // now, kick off the state machine. Attributes::CurrentX::Get(endpoint, &(colorXTransitionState->initialValue)); @@ -2318,7 +2345,7 @@ bool ColorControlServer::stepColorCommand(app::CommandHandler * commandObj, cons stopAllColorTransitions(endpoint); // Handle color mode transition, if necessary. - handleModeSwitch(endpoint, COLOR_MODE_CIE_XY); + handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kCurrentXAndCurrentY); // now, kick off the state machine. colorXTransitionState->initialValue = currentColorX; @@ -2434,7 +2461,7 @@ Status ColorControlServer::moveToColorTemp(EndpointId aEndpoint, uint16_t colorT stopAllColorTransitions(endpoint); // Handle color mode transition, if necessary. - handleModeSwitch(endpoint, COLOR_MODE_TEMPERATURE); + handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kColorTemperature); if (colorTemperature < temperatureMin) { @@ -2542,10 +2569,10 @@ void ColorControlServer::startUpColorTempCommand(EndpointId endpoint) if (status == EMBER_ZCL_STATUS_SUCCESS) { // Set ColorMode attributes to reflect ColorTemperature. - uint8_t updateColorMode = EMBER_ZCL_COLOR_MODE_COLOR_TEMPERATURE; + uint8_t updateColorMode = ColorControl::EnhancedColorMode::kColorTemperature; Attributes::ColorMode::Set(endpoint, updateColorMode); - updateColorMode = EMBER_ZCL_ENHANCED_COLOR_MODE_COLOR_TEMPERATURE; + updateColorMode = ColorControl::EnhancedColorMode::kColorTemperature; Attributes::EnhancedColorMode::Set(endpoint, updateColorMode); } } @@ -2648,7 +2675,7 @@ bool ColorControlServer::moveColorTempCommand(app::CommandHandler * commandObj, } // Handle color mode transition, if necessary. - handleModeSwitch(endpoint, COLOR_MODE_TEMPERATURE); + handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kColorTemperature); // now, kick off the state machine. colorTempTransitionState->initialValue = 0; @@ -2759,7 +2786,7 @@ bool ColorControlServer::stepColorTempCommand(app::CommandHandler * commandObj, } // Handle color mode transition, if necessary. - handleModeSwitch(endpoint, COLOR_MODE_TEMPERATURE); + handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kColorTemperature); // now, kick off the state machine. colorTempTransitionState->initialValue = 0; @@ -2848,7 +2875,7 @@ void ColorControlServer::levelControlColorTempChangeCommand(EndpointId endpoint) uint8_t colorMode = 0; Attributes::ColorMode::Get(endpoint, &colorMode); - if (colorMode == COLOR_MODE_TEMPERATURE) + if (colorMode == ColorControl::EnhancedColorMode::kColorTemperature) { app::DataModel::Nullable currentLevel; EmberAfStatus status = LevelControl::Attributes::CurrentLevel::Get(endpoint, currentLevel); diff --git a/src/app/clusters/color-control-server/color-control-server.h b/src/app/clusters/color-control-server/color-control-server.h index 2ec0f5e63b4a3f..56110a33373f8d 100644 --- a/src/app/clusters/color-control-server/color-control-server.h +++ b/src/app/clusters/color-control-server/color-control-server.h @@ -71,12 +71,12 @@ class ColorControlServer using HueDirection = chip::app::Clusters::ColorControl::HueDirection; using Feature = chip::app::Clusters::ColorControl::Feature; - enum ColorMode + enum EnhancedColorMode : uint8_t { - COLOR_MODE_HSV = 0x00, - COLOR_MODE_CIE_XY = 0x01, - COLOR_MODE_TEMPERATURE = 0x02, - COLOR_MODE_EHSV = 0x03 + kCurrentHueAndCurrentSaturation = 0, + kCurrentXAndCurrentY = 1, + kColorTemperature = 2, + kEnhancedCurrentHueAndCurrentSaturation = 3, }; enum Conversion diff --git a/src/app/clusters/fan-control-server/fan-control-server.h b/src/app/clusters/fan-control-server/fan-control-server.h index ff5fcb549d4086..5721e34b4eba90 100644 --- a/src/app/clusters/fan-control-server/fan-control-server.h +++ b/src/app/clusters/fan-control-server/fan-control-server.h @@ -19,7 +19,6 @@ #include "fan-control-delegate.h" #include -#include #include namespace chip { diff --git a/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp b/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp index 156d181a15931e..a22e86ffe2e108 100644 --- a/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp +++ b/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff --git a/src/app/clusters/occupancy-sensor-server/occupancy-sensor-server.cpp b/src/app/clusters/occupancy-sensor-server/occupancy-sensor-server.cpp index a64c749ae3070b..51cc04b0f4ec24 100644 --- a/src/app/clusters/occupancy-sensor-server/occupancy-sensor-server.cpp +++ b/src/app/clusters/occupancy-sensor-server/occupancy-sensor-server.cpp @@ -20,7 +20,6 @@ #include #include -#include #include "occupancy-hal.h" diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index 04a01371af92f3..4ed4f681d211d4 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include diff --git a/src/app/clusters/ota-provider/ota-provider-delegate.h b/src/app/clusters/ota-provider/ota-provider-delegate.h index 3d7426ea4fd14e..3da8668908064c 100644 --- a/src/app/clusters/ota-provider/ota-provider-delegate.h +++ b/src/app/clusters/ota-provider/ota-provider-delegate.h @@ -19,7 +19,6 @@ #pragma once #include -#include #include #include #include diff --git a/src/app/clusters/thermostat-server/thermostat-server.cpp b/src/app/clusters/thermostat-server/thermostat-server.cpp index 85fa7c7a035322..6c3504c6bea270 100644 --- a/src/app/clusters/thermostat-server/thermostat-server.cpp +++ b/src/app/clusters/thermostat-server/thermostat-server.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include diff --git a/src/app/clusters/window-covering-server/window-covering-server.h b/src/app/clusters/window-covering-server/window-covering-server.h index 1622de77a1de4a..d70fbe921a80e2 100644 --- a/src/app/clusters/window-covering-server/window-covering-server.h +++ b/src/app/clusters/window-covering-server/window-covering-server.h @@ -19,7 +19,6 @@ #include "window-covering-delegate.h" #include -#include #include #include diff --git a/src/app/common/templates/config-data.yaml b/src/app/common/templates/config-data.yaml index d26d067f852802..810decc84dfab8 100644 --- a/src/app/common/templates/config-data.yaml +++ b/src/app/common/templates/config-data.yaml @@ -5,13 +5,6 @@ DarwinForceWritable: - ContentLauncher::SupportedStreamingProtocols - FanControl::FanModeSequence -WeakEnums: - # Allow-list of enums that we generate as enums, not enum classes. - # The goal is to drive this down to 0. - - ColorControlOptions - - ColorMode - - EnhancedColorMode - EnumsNotUsedAsTypeInXML: # List of enums that are not used as a type in XML. By adding an enum # to this list you prevent incorrectly assuming from code that you are diff --git a/src/app/common/templates/templates.json b/src/app/common/templates/templates.json index d8159493bc925b..6d253d5e1b2d6f 100644 --- a/src/app/common/templates/templates.json +++ b/src/app/common/templates/templates.json @@ -41,11 +41,6 @@ "name": "ZCL callback header", "output": "callback.h" }, - { - "path": "../../zap-templates/templates/app/enums.zapt", - "name": "ZCL enums header", - "output": "enums.h" - }, { "path": "../../zap-templates/templates/app/print-cluster.zapt", "name": "ZCL print-cluster header", diff --git a/src/app/zap-templates/templates/app/cluster-enums-check.zapt b/src/app/zap-templates/templates/app/cluster-enums-check.zapt index cf66cef8a3d5c2..cb263c05153db1 100644 --- a/src/app/zap-templates/templates/app/cluster-enums-check.zapt +++ b/src/app/zap-templates/templates/app/cluster-enums-check.zapt @@ -14,21 +14,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue({{asUpperCamelCase ../n { using EnumType = {{asUpperCamelCase ../name}}::{{asType label}}; switch (val) { -{{#if (isInConfigList label "WeakEnums")}} -// 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 -{{/if}} {{#zcl_enum_items}} case EnumType::k{{asUpperCamelCase label}}: {{/zcl_enum_items}} -{{#if (isInConfigList label "WeakEnums")}} -#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM - {{#zcl_enum_items}} - case EMBER_ZCL_{{asDelimitedMacro parent.label}}_{{asDelimitedMacro label}}: - {{/zcl_enum_items}} -#endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -{{/if}} return val; default: return static_cast({{first_unused_enum_value mode="first_unused"}}); diff --git a/src/app/zap-templates/templates/app/cluster-enums.zapt b/src/app/zap-templates/templates/app/cluster-enums.zapt index 2f4ba955abbf89..34092a124f519e 100644 --- a/src/app/zap-templates/templates/app/cluster-enums.zapt +++ b/src/app/zap-templates/templates/app/cluster-enums.zapt @@ -4,7 +4,6 @@ #include -#include namespace chip { namespace app { @@ -14,11 +13,6 @@ namespace Clusters { namespace {{asUpperCamelCase name}} { {{#zcl_enums}} -{{#if (isInConfigList label "WeakEnums")}} -// 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 -{{/if}} // Enum for {{label}} enum class {{asType label}} : {{asUnderlyingZclType name}} { {{#zcl_enum_items}} @@ -38,12 +32,6 @@ kUnknownEnumValue = {{first_unused_enum_value mode="first_unused"}}, // src/app/common/templates/config-data.yaml. {{/unless}} }; -{{#if (isInConfigList label "WeakEnums")}} -#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -using {{asType label}} = EmberAf{{asType label}}; -static {{asType label}} __attribute__((unused)) k{{asType label}}kUnknownEnumValue = static_cast<{{asType label}}>({{first_unused_enum_value mode="first_unused"}}); -#endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -{{/if}} {{/zcl_enums}} {{#zcl_bitmaps}} diff --git a/src/app/zap-templates/templates/app/cluster-objects.zapt b/src/app/zap-templates/templates/app/cluster-objects.zapt index 9b4fe04b4341a9..4e17d227629f34 100644 --- a/src/app/zap-templates/templates/app/cluster-objects.zapt +++ b/src/app/zap-templates/templates/app/cluster-objects.zapt @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include diff --git a/src/app/zap-templates/templates/app/enums.zapt b/src/app/zap-templates/templates/app/enums.zapt deleted file mode 100644 index d0e95a7df2b75f..00000000000000 --- a/src/app/zap-templates/templates/app/enums.zapt +++ /dev/null @@ -1,20 +0,0 @@ -{{> header}} - -// Prevent multiple inclusion -#pragma once - -#include - -// ZCL enums - -{{#zcl_enums}} -{{#if (isInConfigList label "WeakEnums")}} - -// Enum for {{label}} -enum EmberAf{{asType label}} : {{asUnderlyingZclType name}} { -{{#zcl_enum_items}} -{{ident}}EMBER_ZCL_{{asDelimitedMacro parent.label}}_{{asDelimitedMacro label}} = {{value}}, -{{/zcl_enum_items}} -}; -{{/if}} -{{/zcl_enums}} diff --git a/src/app/zap-templates/zcl/data-model/draft/types/color-control.xml b/src/app/zap-templates/zcl/data-model/draft/types/color-control.xml deleted file mode 100644 index 9e3523063eb7c3..00000000000000 --- a/src/app/zap-templates/zcl/data-model/draft/types/color-control.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index e7809fe26417bb..87d0686dec2967 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -113,7 +113,6 @@ "window-covering.xml", "matter-devices.xml", "sample-mei-cluster.xml", - "types/color-control.xml", "types/door-lock.xml", "types/occupancy-sensing.xml", "types/thermostat-user-interface-configuration.xml" diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 44e19cee93c18e..5a672e41398fee 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -111,7 +111,6 @@ "window-covering.xml", "matter-devices.xml", "sample-mei-cluster.xml", - "types/color-control.xml", "types/door-lock.xml", "types/occupancy-sensing.xml", "types/thermostat-user-interface-configuration.xml" diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 135812979d16aa..29c6cabb72184e 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -35,7 +35,6 @@ // module header, comes first #include -#include #include #include @@ -74,8 +73,6 @@ #include #endif -#include - #include #include #include diff --git a/src/platform/ESP32/DiagnosticDataProviderImpl.cpp b/src/platform/ESP32/DiagnosticDataProviderImpl.cpp index 6180eb77a9e37b..ff36ca21662152 100644 --- a/src/platform/ESP32/DiagnosticDataProviderImpl.cpp +++ b/src/platform/ESP32/DiagnosticDataProviderImpl.cpp @@ -23,7 +23,6 @@ #include -#include #include #include #include diff --git a/src/platform/ESP32/PlatformManagerImpl.cpp b/src/platform/ESP32/PlatformManagerImpl.cpp index 81bc561cddc667..ed9f6aca7128c9 100644 --- a/src/platform/ESP32/PlatformManagerImpl.cpp +++ b/src/platform/ESP32/PlatformManagerImpl.cpp @@ -25,7 +25,6 @@ /* this file behaves like a config.h, comes first */ #include -#include #include #include #include diff --git a/src/platform/Linux/ConnectivityUtils.cpp b/src/platform/Linux/ConnectivityUtils.cpp index 01e41af7c583bd..8084ceca43b55a 100644 --- a/src/platform/Linux/ConnectivityUtils.cpp +++ b/src/platform/Linux/ConnectivityUtils.cpp @@ -21,7 +21,6 @@ * statistics(extracted from /proc/net/wireless) on Linux platforms. */ -#include #include #include diff --git a/src/platform/Linux/DiagnosticDataProviderImpl.cpp b/src/platform/Linux/DiagnosticDataProviderImpl.cpp index f102b47b65ca6e..b363fa652a6cf2 100644 --- a/src/platform/Linux/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Linux/DiagnosticDataProviderImpl.cpp @@ -23,7 +23,6 @@ #include -#include #include #include #include diff --git a/src/platform/Linux/PlatformManagerImpl.cpp b/src/platform/Linux/PlatformManagerImpl.cpp index a1c83faf299389..0098eb01ae96eb 100644 --- a/src/platform/Linux/PlatformManagerImpl.cpp +++ b/src/platform/Linux/PlatformManagerImpl.cpp @@ -35,7 +35,6 @@ #include -#include #include #include #include diff --git a/src/platform/Tizen/ConnectivityUtils.cpp b/src/platform/Tizen/ConnectivityUtils.cpp index 0ceab55fbd3335..15a8ec60fd3a06 100644 --- a/src/platform/Tizen/ConnectivityUtils.cpp +++ b/src/platform/Tizen/ConnectivityUtils.cpp @@ -17,7 +17,6 @@ #include "ConnectivityUtils.h" -#include #include #include diff --git a/src/platform/nxp/common/DiagnosticDataProviderImpl.cpp b/src/platform/nxp/common/DiagnosticDataProviderImpl.cpp index 92ef8c0c310d29..10e9f8d528b12f 100644 --- a/src/platform/nxp/common/DiagnosticDataProviderImpl.cpp +++ b/src/platform/nxp/common/DiagnosticDataProviderImpl.cpp @@ -22,7 +22,6 @@ * for nxp platform. */ -#include #include #include "DiagnosticDataProviderImpl.h" diff --git a/src/platform/nxp/mw320/ConnectivityUtils.cpp b/src/platform/nxp/mw320/ConnectivityUtils.cpp index 4756dc85065c84..a4e881c1e96df0 100644 --- a/src/platform/nxp/mw320/ConnectivityUtils.cpp +++ b/src/platform/nxp/mw320/ConnectivityUtils.cpp @@ -22,7 +22,6 @@ */ #include "ConnectivityUtils.h" -#include #include #include diff --git a/src/platform/nxp/mw320/DiagnosticDataProviderImpl.cpp b/src/platform/nxp/mw320/DiagnosticDataProviderImpl.cpp index 3b357371b0c03a..f669ce4b937751 100644 --- a/src/platform/nxp/mw320/DiagnosticDataProviderImpl.cpp +++ b/src/platform/nxp/mw320/DiagnosticDataProviderImpl.cpp @@ -21,7 +21,6 @@ * for k32w0 platform. */ -#include #include #include diff --git a/src/platform/webos/ConnectivityUtils.cpp b/src/platform/webos/ConnectivityUtils.cpp index 646dc209c36ff2..f137ac8de2019a 100644 --- a/src/platform/webos/ConnectivityUtils.cpp +++ b/src/platform/webos/ConnectivityUtils.cpp @@ -21,7 +21,6 @@ * statistics(extracted from /proc/net/wireless) on webOS platforms. */ -#include #include #include diff --git a/src/platform/webos/DiagnosticDataProviderImpl.cpp b/src/platform/webos/DiagnosticDataProviderImpl.cpp index 0c6136e8f0f584..22f90ed72e3bd6 100644 --- a/src/platform/webos/DiagnosticDataProviderImpl.cpp +++ b/src/platform/webos/DiagnosticDataProviderImpl.cpp @@ -23,7 +23,6 @@ #include -#include #include #include #include diff --git a/src/platform/webos/PlatformManagerImpl.cpp b/src/platform/webos/PlatformManagerImpl.cpp index fb353702ad622f..55995248caa5f0 100644 --- a/src/platform/webos/PlatformManagerImpl.cpp +++ b/src/platform/webos/PlatformManagerImpl.cpp @@ -35,7 +35,6 @@ #include -#include #include #include #include diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index 4b287c6e70abc8..383a16441e6ace 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -2186,17 +2186,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::ColorMode using EnumType = ColorControl::ColorMode; switch (val) { -// 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 case EnumType::kCurrentHueAndCurrentSaturation: case EnumType::kCurrentXAndCurrentY: case EnumType::kColorTemperature: -#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM - case EMBER_ZCL_COLOR_MODE_CURRENT_HUE_AND_CURRENT_SATURATION: - case EMBER_ZCL_COLOR_MODE_CURRENT_X_AND_CURRENT_Y: - case EMBER_ZCL_COLOR_MODE_COLOR_TEMPERATURE: -#endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM return val; default: return static_cast(3); diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 7712c63d297961..d617ae40832737 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -21,8 +21,6 @@ #include -#include - namespace chip { namespace app { namespace Clusters { @@ -3228,9 +3226,6 @@ enum class ColorLoopDirection : uint8_t kUnknownEnumValue = 2, }; -// 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 ColorMode enum class ColorMode : uint8_t { @@ -3243,10 +3238,6 @@ enum class ColorMode : uint8_t // enum value. This specific should never be transmitted. kUnknownEnumValue = 3, }; -#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -using ColorMode = EmberAfColorMode; -static ColorMode __attribute__((unused)) kColorModekUnknownEnumValue = static_cast(3); -#endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM // Enum for HueDirection enum class HueDirection : uint8_t 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 70cb1a47187f9f..9809bd9f0e36d9 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 @@ -19,7 +19,6 @@ #pragma once -#include #include #include #include diff --git a/zzz_generated/app-common/app-common/zap-generated/enums.h b/zzz_generated/app-common/app-common/zap-generated/enums.h deleted file mode 100644 index faaf79f8abc47b..00000000000000 --- a/zzz_generated/app-common/app-common/zap-generated/enums.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// THIS FILE IS GENERATED BY ZAP - -// Prevent multiple inclusion -#pragma once - -#include - -// ZCL enums - -// Enum for ColorControlOptions -enum EmberAfColorControlOptions : uint8_t -{ - EMBER_ZCL_COLOR_CONTROL_OPTIONS_EXECUTE_IF_OFF = 1, -}; - -// Enum for ColorMode -enum EmberAfColorMode : uint8_t -{ - EMBER_ZCL_COLOR_MODE_CURRENT_HUE_AND_CURRENT_SATURATION = 0, - EMBER_ZCL_COLOR_MODE_CURRENT_X_AND_CURRENT_Y = 1, - EMBER_ZCL_COLOR_MODE_COLOR_TEMPERATURE = 2, -}; - -// Enum for EnhancedColorMode -enum EmberAfEnhancedColorMode : uint8_t -{ - EMBER_ZCL_ENHANCED_COLOR_MODE_CURRENT_HUE_AND_CURRENT_SATURATION = 0, - EMBER_ZCL_ENHANCED_COLOR_MODE_CURRENT_X_AND_CURRENT_Y = 1, - EMBER_ZCL_ENHANCED_COLOR_MODE_COLOR_TEMPERATURE = 2, - EMBER_ZCL_ENHANCED_COLOR_MODE_ENHANCED_CURRENT_HUE_AND_CURRENT_SATURATION = 3, -};