diff --git a/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp b/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp index 3d21aebd6ac784..5e011c92f6eee3 100644 --- a/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp +++ b/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp @@ -21,10 +21,12 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -103,9 +105,9 @@ static void sendResponse(const char * responseName, ContentLaunchResponse launch } } -bool emberAfContentLauncherClusterLaunchContentCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - EndpointId endpoint, bool autoplay, unsigned char * data, - Commands::LaunchContent::DecodableType & fields) +bool emberAfContentLauncherClusterLaunchContentCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + bool autoplay, unsigned char * data, chip::app::Clusters::ContentLauncher::Commands::LaunchContent::DecodableType & fields) { string dataString(reinterpret_cast(data)); @@ -115,9 +117,10 @@ bool emberAfContentLauncherClusterLaunchContentCallback(app::CommandHandler * co return true; } -bool emberAfContentLauncherClusterLaunchURLCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - EndpointId endpoint, unsigned char * contentUrl, unsigned char * displayString, - Commands::LaunchURL::DecodableType & fields) +bool emberAfContentLauncherClusterLaunchURLCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + unsigned char * contentUrl, unsigned char * displayString, + chip::app::Clusters::ContentLauncher::Commands::LaunchURL::DecodableType & fields) { string contentUrlString(reinterpret_cast(contentUrl)); string displayStringString(reinterpret_cast(displayString)); diff --git a/examples/window-app/common/src/ZclCallbacks.cpp b/examples/window-app/common/src/ZclCallbacks.cpp index 49767663e205d4..c6aa27764f01f8 100644 --- a/examples/window-app/common/src/ZclCallbacks.cpp +++ b/examples/window-app/common/src/ZclCallbacks.cpp @@ -25,7 +25,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -94,8 +96,9 @@ void emberAfPostAttributeChangeCallback(chip::EndpointId endpoint, chip::Cluster /** * @brief Cluster StopMotion Command callback (from client) */ -bool emberAfWindowCoveringClusterStopMotionCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, - EndpointId endpoint, Commands::StopMotion::DecodableType & fields) +bool emberAfWindowCoveringClusterStopMotionCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + Commands::StopMotion::DecodableType & fields) { ChipLogProgress(Zcl, "StopMotion command received"); WindowApp::Instance().PostEvent(WindowApp::Event(WindowApp::EventId::StopMotion, endpoint)); diff --git a/src/app/clusters/account-login-server/account-login-server.cpp b/src/app/clusters/account-login-server/account-login-server.cpp index f3dbb3f05ea8c0..0a3ebfdd11d254 100644 --- a/src/app/clusters/account-login-server/account-login-server.cpp +++ b/src/app/clusters/account-login-server/account-login-server.cpp @@ -22,12 +22,15 @@ ******************************************************************************/ #include +#include #include #include +#include #include #include using namespace chip; +using namespace chip::app::Clusters::AccountLogin; bool accountLoginClusterIsUserLoggedIn(std::string requestTempAccountIdentifier, std::string requestSetupPin); std::string accountLoginClusterGetSetupPin(std::string requestTempAccountIdentifier, EndpointId endpoint); diff --git a/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp b/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp index 3e7f0bf0b55275..a7b17e1fc7ef36 100644 --- a/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp +++ b/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp @@ -20,7 +20,9 @@ * @brief Implementation for the Administrator Commissioning Cluster ***************************************************************************/ +#include #include +#include #include #include #include @@ -28,6 +30,7 @@ #include using namespace chip; +using namespace chip::app::Clusters::AdministratorCommissioning; // Specifications section 5.4.2.3. Announcement Duration constexpr uint32_t kMaxCommissionioningTimeoutSeconds = 15 * 60; diff --git a/src/app/clusters/application-basic-server/application-basic-server.cpp b/src/app/clusters/application-basic-server/application-basic-server.cpp index cb3b08c8c7e5f6..4799110291bb15 100644 --- a/src/app/clusters/application-basic-server/application-basic-server.cpp +++ b/src/app/clusters/application-basic-server/application-basic-server.cpp @@ -22,12 +22,15 @@ ******************************************************************************* ******************************************************************************/ +#include #include #include +#include #include #include using namespace chip; +using namespace chip::app::Clusters::ApplicationBasic; bool applicationBasicClusterChangeApplicationStatus(EmberAfApplicationBasicStatus status, EndpointId endpoint); diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.cpp b/src/app/clusters/application-launcher-server/application-launcher-server.cpp index e6544e9363de5f..c08b72f2637f8b 100644 --- a/src/app/clusters/application-launcher-server/application-launcher-server.cpp +++ b/src/app/clusters/application-launcher-server/application-launcher-server.cpp @@ -24,15 +24,18 @@ #include #include +#include #include #include #include +#include #include #include using namespace chip; +using namespace chip::app::Clusters::ApplicationLauncher; -ApplicationLauncherResponse applicationLauncherClusterLaunchApp(ApplicationLauncherApp application, std::string data); +ApplicationLauncherResponse applicationLauncherClusterLaunchApp(::ApplicationLauncherApp application, std::string data); bool emberAfApplicationLauncherClusterLaunchAppCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, EndpointId endpoint, @@ -61,11 +64,11 @@ void sendResponse(app::CommandHandler * command, ApplicationLauncherResponse res } } -ApplicationLauncherApp getApplicationFromCommand(uint16_t catalogVendorId, uint8_t * applicationId) +::ApplicationLauncherApp getApplicationFromCommand(uint16_t catalogVendorId, uint8_t * applicationId) { - ApplicationLauncherApp application = {}; - application.applicationId = applicationId; - application.catalogVendorId = catalogVendorId; + ::ApplicationLauncherApp application = {}; + application.applicationId = applicationId; + application.catalogVendorId = catalogVendorId; return application; } @@ -74,7 +77,7 @@ bool emberAfApplicationLauncherClusterLaunchAppCallback(app::CommandHandler * co uint16_t requestApplicationCatalogVendorId, uint8_t * requestApplicationId, Commands::LaunchApp::DecodableType & fields) { - ApplicationLauncherApp application = getApplicationFromCommand(requestApplicationCatalogVendorId, requestApplicationId); + ::ApplicationLauncherApp application = getApplicationFromCommand(requestApplicationCatalogVendorId, requestApplicationId); // TODO: Char is not null terminated, verify this code once #7963 gets merged. std::string reqestDataString(reinterpret_cast(requestData)); ApplicationLauncherResponse response = applicationLauncherClusterLaunchApp(application, reqestDataString); diff --git a/src/app/clusters/audio-output-server/audio-output-server.cpp b/src/app/clusters/audio-output-server/audio-output-server.cpp index 0e12d38dbccf5a..78b497d3b2374f 100644 --- a/src/app/clusters/audio-output-server/audio-output-server.cpp +++ b/src/app/clusters/audio-output-server/audio-output-server.cpp @@ -22,10 +22,13 @@ ******************************************************************************* ******************************************************************************/ +#include #include +#include #include using namespace chip; +using namespace chip::app::Clusters::AudioOutput; bool audioOutputClusterSelectOutput(uint8_t index); bool audioOutputClusterRenameOutput(uint8_t index, uint8_t * name); diff --git a/src/app/clusters/barrier-control-server/barrier-control-server.cpp b/src/app/clusters/barrier-control-server/barrier-control-server.cpp index 40a6410f73554d..832eba1c2247cf 100644 --- a/src/app/clusters/barrier-control-server/barrier-control-server.cpp +++ b/src/app/clusters/barrier-control-server/barrier-control-server.cpp @@ -41,8 +41,10 @@ #include "barrier-control-server.h" #include #include +#include #include #include +#include #include #include @@ -52,6 +54,7 @@ using namespace chip; using namespace chip::app::Clusters; +using namespace chip::app::Clusters::BarrierControl; typedef struct { @@ -85,21 +88,21 @@ void emberAfPluginBarrierControlServerInitCallback(void) {} uint8_t emAfPluginBarrierControlServerGetBarrierPosition(EndpointId endpoint) { uint8_t position; - EmberAfStatus status = BarrierControl::Attributes::BarrierPosition::Get(endpoint, &position); + EmberAfStatus status = Attributes::BarrierPosition::Get(endpoint, &position); assert(status == EMBER_ZCL_STATUS_SUCCESS); return position; } void emAfPluginBarrierControlServerSetBarrierPosition(EndpointId endpoint, uint8_t position) { - EmberAfStatus status = BarrierControl::Attributes::BarrierPosition::Set(endpoint, position); + EmberAfStatus status = Attributes::BarrierPosition::Set(endpoint, position); assert(status == EMBER_ZCL_STATUS_SUCCESS); } bool emAfPluginBarrierControlServerIsPartialBarrierSupported(EndpointId endpoint) { uint8_t bitmap; - EmberAfStatus status = BarrierControl::Attributes::BarrierCapabilities::Get(endpoint, &bitmap); + EmberAfStatus status = Attributes::BarrierCapabilities::Get(endpoint, &bitmap); assert(status == EMBER_ZCL_STATUS_SUCCESS); return READBITS(bitmap, EMBER_AF_BARRIER_CONTROL_CAPABILITIES_PARTIAL_BARRIER); } @@ -111,13 +114,13 @@ static uint16_t getOpenOrClosePeriod(EndpointId endpoint, bool open) #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_OPEN_PERIOD_ATTRIBUTE) if (open) { - status = BarrierControl::Attributes::BarrierOpenPeriod::Get(endpoint, &period); + status = Attributes::BarrierOpenPeriod::Get(endpoint, &period); } #endif #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_CLOSE_PERIOD_ATTRIBUTE) if (!open) { - status = BarrierControl::Attributes::BarrierClosePeriod::Get(endpoint, &period); + status = Attributes::BarrierClosePeriod::Get(endpoint, &period); } #endif assert(status == EMBER_ZCL_STATUS_SUCCESS); @@ -126,14 +129,14 @@ static uint16_t getOpenOrClosePeriod(EndpointId endpoint, bool open) static void setMovingState(EndpointId endpoint, uint8_t newState) { - EmberAfStatus status = BarrierControl::Attributes::BarrierMovingState::Set(endpoint, newState); + EmberAfStatus status = Attributes::BarrierMovingState::Set(endpoint, newState); assert(status == EMBER_ZCL_STATUS_SUCCESS); } uint16_t emAfPluginBarrierControlServerGetSafetyStatus(EndpointId endpoint) { uint16_t safetyStatus; - EmberAfStatus status = BarrierControl::Attributes::BarrierSafetyStatus::Get(endpoint, &safetyStatus); + EmberAfStatus status = Attributes::BarrierSafetyStatus::Get(endpoint, &safetyStatus); assert(status == EMBER_ZCL_STATUS_SUCCESS); return safetyStatus; } @@ -152,25 +155,25 @@ void emAfPluginBarrierControlServerIncrementEvents(EndpointId endpoint, bool ope #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_OPEN_EVENTS_ATTRIBUTE) if (open && !command) { - status = BarrierControl::Attributes::BarrierOpenEvents::Get(endpoint, &events); + status = Attributes::BarrierOpenEvents::Get(endpoint, &events); } #endif #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_CLOSE_EVENTS_ATTRIBUTE) if (!open && !command) { - status = BarrierControl::Attributes::BarrierCloseEvents::Get(endpoint, &events); + status = Attributes::BarrierCloseEvents::Get(endpoint, &events); } #endif #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_COMMAND_OPEN_EVENTS_ATTRIBUTE) if (open && command) { - status = BarrierControl::Attributes::BarrierCommandOpenEvents::Get(endpoint, &events); + status = Attributes::BarrierCommandOpenEvents::Get(endpoint, &events); } #endif #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_COMMAND_CLOSE_EVENTS_ATTRIBUTE) if (!open && command) { - status = BarrierControl::Attributes::BarrierCommandCloseEvents::Get(endpoint, &events); + status = Attributes::BarrierCommandCloseEvents::Get(endpoint, &events); } #endif assert(status == EMBER_ZCL_STATUS_SUCCESS); @@ -187,25 +190,25 @@ void emAfPluginBarrierControlServerIncrementEvents(EndpointId endpoint, bool ope #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_OPEN_EVENTS_ATTRIBUTE) if (open && !command) { - status = BarrierControl::Attributes::BarrierOpenEvents::Set(endpoint, events); + status = Attributes::BarrierOpenEvents::Set(endpoint, events); } #endif #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_CLOSE_EVENTS_ATTRIBUTE) if (!open && !command) { - status = BarrierControl::Attributes::BarrierCloseEvents::Set(endpoint, events); + status = Attributes::BarrierCloseEvents::Set(endpoint, events); } #endif #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_COMMAND_OPEN_EVENTS_ATTRIBUTE) if (open && command) { - status = BarrierControl::Attributes::BarrierCommandOpenEvents::Set(endpoint, events); + status = Attributes::BarrierCommandOpenEvents::Set(endpoint, events); } #endif #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_COMMAND_CLOSE_EVENTS_ATTRIBUTE) if (!open && command) { - status = BarrierControl::Attributes::BarrierCommandCloseEvents::Set(endpoint, events); + status = Attributes::BarrierCommandCloseEvents::Set(endpoint, events); } #endif assert(status == EMBER_ZCL_STATUS_SUCCESS); diff --git a/src/app/clusters/bindings/bindings.cpp b/src/app/clusters/bindings/bindings.cpp index 9a4e91bfad059c..13c9fb08c5b737 100644 --- a/src/app/clusters/bindings/bindings.cpp +++ b/src/app/clusters/bindings/bindings.cpp @@ -22,11 +22,14 @@ #include +#include #include +#include #include #include using namespace chip; +using namespace chip::app::Clusters::Binding; EmberStatus prepareBinding(EmberBindingTableEntry & binding, NodeId nodeId, GroupId groupId, EndpointId endpointId, ClusterId clusterId) 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 4fd1ee69903cd5..115c046f1295c9 100644 --- a/src/app/clusters/color-control-server/color-control-server.cpp +++ b/src/app/clusters/color-control-server/color-control-server.cpp @@ -41,12 +41,15 @@ #include #include #include +#include #include +#include #include #include using namespace chip; -using namespace app::Clusters; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::ColorControl; /********************************************************** * Attributes Definition @@ -97,7 +100,7 @@ bool ColorControlServer::shouldExecuteIfOff(EndpointId endpoint, uint8_t optionM } uint8_t options = 0x00; - ColorControl::Attributes::ColorControlOptions::Get(endpoint, &options); + Attributes::ColorControlOptions::Get(endpoint, &options); bool on = true; OnOff::Attributes::OnOff::Get(endpoint, &on); @@ -156,7 +159,7 @@ bool ColorControlServer::shouldExecuteIfOff(EndpointId endpoint, uint8_t optionM void ColorControlServer::handleModeSwitch(EndpointId endpoint, uint8_t newColorMode) { uint8_t oldColorMode = 0; - ColorControl::Attributes::ColorMode::Get(endpoint, &oldColorMode); + Attributes::ColorMode::Get(endpoint, &oldColorMode); uint8_t colorModeTransition; @@ -166,8 +169,8 @@ void ColorControlServer::handleModeSwitch(EndpointId endpoint, uint8_t newColorM } else { - ColorControl::Attributes::EnhancedColorMode::Set(endpoint, newColorMode); - ColorControl::Attributes::ColorMode::Set(endpoint, newColorMode); + Attributes::EnhancedColorMode::Set(endpoint, newColorMode); + Attributes::ColorMode::Set(endpoint, newColorMode); } colorModeTransition = static_cast((newColorMode << 4) + oldColorMode); @@ -303,7 +306,7 @@ bool ColorControlServer::computeNewColor16uValue(ColorControlServer::Color16uTra (p->stepsRemaining)--; - ColorControl::Attributes::RemainingTime::Set(p->endpoint, p->stepsRemaining); + Attributes::RemainingTime::Set(p->endpoint, p->stepsRemaining); // handle sign if (p->finalValue == p->currentValue) @@ -379,7 +382,7 @@ ColorControlServer::Color16uTransitionState * ColorControlServer::getSaturationT uint8_t ColorControlServer::getSaturation(EndpointId endpoint) { uint8_t saturation = 0; - ColorControl::Attributes::CurrentSaturation::Get(endpoint, &saturation); + Attributes::CurrentSaturation::Get(endpoint, &saturation); return saturation; } @@ -504,26 +507,26 @@ void ColorControlServer::startColorLoop(EndpointId endpoint, uint8_t startFromSt Color16uTransitionState * colorSaturationTransitionState = getSaturationTransitionState(endpoint); uint8_t direction = 0; - ColorControl::Attributes::ColorLoopDirection::Get(endpoint, &direction); + Attributes::ColorLoopDirection::Get(endpoint, &direction); uint16_t time = 0x0019; - ColorControl::Attributes::ColorLoopTime::Get(endpoint, &time); + Attributes::ColorLoopTime::Get(endpoint, &time); uint16_t currentHue = 0; - ColorControl::Attributes::EnhancedCurrentHue::Get(endpoint, ¤tHue); + Attributes::EnhancedCurrentHue::Get(endpoint, ¤tHue); u_int16_t startHue = 0x2300; if (startFromStartHue) { - ColorControl::Attributes::ColorLoopStartEnhancedHue::Get(endpoint, &startHue); + Attributes::ColorLoopStartEnhancedHue::Get(endpoint, &startHue); } else { startHue = currentHue; } - ColorControl::Attributes::ColorLoopStoredEnhancedHue::Set(endpoint, currentHue); - ColorControl::Attributes::ColorLoopActive::Set(endpoint, true); + Attributes::ColorLoopStoredEnhancedHue::Set(endpoint, currentHue); + Attributes::ColorLoopActive::Set(endpoint, true); initHueSat(endpoint, colorHueTransitionState, colorSaturationTransitionState); @@ -548,7 +551,7 @@ void ColorControlServer::startColorLoop(EndpointId endpoint, uint8_t startFromSt colorHueTransitionState->stepsTotal = static_cast(time * TRANSITION_TIME_1S); colorHueTransitionState->endpoint = endpoint; - ColorControl::Attributes::RemainingTime::Set(endpoint, MAX_INT16U_VALUE); + Attributes::RemainingTime::Set(endpoint, MAX_INT16U_VALUE); emberEventControlSetDelayMS(configureHSVEventControl(endpoint), UPDATE_TIME_MS); } @@ -564,10 +567,10 @@ void ColorControlServer::initHueSat(EndpointId endpoint, ColorControlServer::Col ColorControlServer::Color16uTransitionState * colorSatTransitionState) { colorHueTransitionState->stepsRemaining = 0; - ColorControl::Attributes::CurrentHue::Get(endpoint, &(colorHueTransitionState->currentHue)); + Attributes::CurrentHue::Get(endpoint, &(colorHueTransitionState->currentHue)); colorHueTransitionState->endpoint = endpoint; - ColorControl::Attributes::EnhancedCurrentHue::Get(endpoint, &(colorHueTransitionState->currentEnhancedHue)); + Attributes::EnhancedCurrentHue::Get(endpoint, &(colorHueTransitionState->currentEnhancedHue)); colorHueTransitionState->isEnhancedHue = false; colorSatTransitionState->stepsRemaining = 0; @@ -597,7 +600,7 @@ bool ColorControlServer::computeNewHueValue(ColorControlServer::ColorHueTransiti if (p->repeat == false) { - ColorControl::Attributes::RemainingTime::Set(p->endpoint, p->stepsRemaining); + Attributes::RemainingTime::Set(p->endpoint, p->stepsRemaining); } // are we going up or down? @@ -649,7 +652,7 @@ bool ColorControlServer::computeNewHueValue(ColorControlServer::ColorHueTransiti { // Check if we are in a color loop. If not, we are in a moveHue uint8_t isColorLoop = 0; - ColorControl::Attributes::ColorLoopActive::Get(p->endpoint, &isColorLoop); + Attributes::ColorLoopActive::Get(p->endpoint, &isColorLoop); if (isColorLoop) { @@ -766,13 +769,13 @@ bool ColorControlServer::moveHueCommand(uint8_t moveMode, uint16_t rate, uint8_t colorHueTransitionState->isEnhancedHue = isEnhanced; if (isEnhanced) { - ColorControl::Attributes::EnhancedCurrentHue::Get(endpoint, ¤tEnhancedHue); + Attributes::EnhancedCurrentHue::Get(endpoint, ¤tEnhancedHue); colorHueTransitionState->initialEnhancedHue = currentEnhancedHue; colorHueTransitionState->currentEnhancedHue = currentEnhancedHue; } else { - ColorControl::Attributes::CurrentHue::Get(endpoint, ¤tHue); + Attributes::CurrentHue::Get(endpoint, ¤tHue); colorHueTransitionState->initialHue = currentHue; colorHueTransitionState->currentHue = currentHue; } @@ -814,7 +817,7 @@ bool ColorControlServer::moveHueCommand(uint8_t moveMode, uint16_t rate, uint8_t colorHueTransitionState->repeat = true; // hue movement can last forever. Indicate this with a remaining time of maxint - ColorControl::Attributes::RemainingTime::Set(endpoint, MAX_INT16U_VALUE); + Attributes::RemainingTime::Set(endpoint, MAX_INT16U_VALUE); colorSaturationTransitionState->stepsRemaining = 0; // kick off the state machine: @@ -853,12 +856,12 @@ bool ColorControlServer::moveToHueCommand(uint16_t hue, uint8_t hueMoveMode, uin uint16_t currentHue = 0; if (isEnhanced) { - ColorControl::Attributes::EnhancedCurrentHue::Get(endpoint, ¤tHue); + Attributes::EnhancedCurrentHue::Get(endpoint, ¤tHue); } else { uint8_t current8bitHue = 0; - ColorControl::Attributes::CurrentHue::Get(endpoint, ¤t8bitHue); + Attributes::CurrentHue::Get(endpoint, ¤t8bitHue); currentHue = static_cast(current8bitHue); } @@ -928,15 +931,15 @@ bool ColorControlServer::moveToHueCommand(uint16_t hue, uint8_t hueMoveMode, uin if (isEnhanced) { - ColorControl::Attributes::EnhancedCurrentHue::Get(endpoint, &(colorHueTransitionState->initialEnhancedHue)); - ColorControl::Attributes::EnhancedCurrentHue::Get(endpoint, &(colorHueTransitionState->currentEnhancedHue)); + Attributes::EnhancedCurrentHue::Get(endpoint, &(colorHueTransitionState->initialEnhancedHue)); + Attributes::EnhancedCurrentHue::Get(endpoint, &(colorHueTransitionState->currentEnhancedHue)); colorHueTransitionState->finalEnhancedHue = hue; } else { - ColorControl::Attributes::CurrentHue::Get(endpoint, &(colorHueTransitionState->initialHue)); - ColorControl::Attributes::CurrentHue::Get(endpoint, &(colorHueTransitionState->currentHue)); + Attributes::CurrentHue::Get(endpoint, &(colorHueTransitionState->initialHue)); + Attributes::CurrentHue::Get(endpoint, &(colorHueTransitionState->currentHue)); colorHueTransitionState->finalHue = static_cast(hue); } @@ -948,7 +951,7 @@ bool ColorControlServer::moveToHueCommand(uint16_t hue, uint8_t hueMoveMode, uin colorHueTransitionState->repeat = false; colorSaturationTransitionState->stepsRemaining = 0; - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTime); + Attributes::RemainingTime::Set(endpoint, transitionTime); // kick off the state machine: emberEventControlSetDelayMS(configureHSVEventControl(endpoint), UPDATE_TIME_MS); @@ -980,12 +983,12 @@ bool ColorControlServer::moveToHueAndSaturationCommand(uint16_t hue, uint8_t sat uint16_t currentHue = 0; if (isEnhanced) { - ColorControl::Attributes::EnhancedCurrentHue::Get(endpoint, ¤tHue); + Attributes::EnhancedCurrentHue::Get(endpoint, ¤tHue); } else { uint8_t current8bitHue = 0; - ColorControl::Attributes::CurrentHue::Get(endpoint, ¤t8bitHue); + Attributes::CurrentHue::Get(endpoint, ¤t8bitHue); currentHue = static_cast(current8bitHue); } @@ -1060,7 +1063,7 @@ bool ColorControlServer::moveToHueAndSaturationCommand(uint16_t hue, uint8_t sat colorSaturationTransitionState->lowLimit = MIN_SATURATION_VALUE; colorSaturationTransitionState->highLimit = MAX_SATURATION_VALUE; - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTime); + Attributes::RemainingTime::Set(endpoint, transitionTime); // kick off the state machine: emberEventControlSetDelayMS(configureHSVEventControl(endpoint), UPDATE_TIME_MS); @@ -1118,7 +1121,7 @@ bool ColorControlServer::stepHueCommand(uint8_t stepMode, uint16_t stepSize, uin if (isEnhanced) { - ColorControl::Attributes::EnhancedCurrentHue::Get(endpoint, &(colorHueTransitionState->currentEnhancedHue)); + Attributes::EnhancedCurrentHue::Get(endpoint, &(colorHueTransitionState->currentEnhancedHue)); colorHueTransitionState->initialEnhancedHue = colorHueTransitionState->currentEnhancedHue; if (stepMode == MOVE_MODE_UP) @@ -1134,7 +1137,7 @@ bool ColorControlServer::stepHueCommand(uint8_t stepMode, uint16_t stepSize, uin } else { - ColorControl::Attributes::CurrentHue::Get(endpoint, &(colorHueTransitionState->currentHue)); + Attributes::CurrentHue::Get(endpoint, &(colorHueTransitionState->currentHue)); colorHueTransitionState->initialHue = colorHueTransitionState->currentHue; if (stepMode == MOVE_MODE_UP) @@ -1155,7 +1158,7 @@ bool ColorControlServer::stepHueCommand(uint8_t stepMode, uint16_t stepSize, uin colorHueTransitionState->repeat = false; colorSaturationTransitionState->stepsRemaining = 0; - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTime); + Attributes::RemainingTime::Set(endpoint, transitionTime); // kick off the state machine: emberEventControlSetDelayMS(configureHSVEventControl(endpoint), UPDATE_TIME_MS); @@ -1214,7 +1217,7 @@ bool ColorControlServer::moveSaturationCommand(uint8_t moveMode, uint8_t rate, u colorSaturationTransitionState->lowLimit = MIN_SATURATION_VALUE; colorSaturationTransitionState->highLimit = MAX_SATURATION_VALUE; - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTime); + Attributes::RemainingTime::Set(endpoint, transitionTime); // kick off the state machine: emberEventControlSetDelayMS(configureHSVEventControl(endpoint), UPDATE_TIME_MS); @@ -1279,7 +1282,7 @@ bool ColorControlServer::moveToSaturationCommand(uint8_t saturation, uint16_t tr colorSaturationTransitionState->lowLimit = MIN_SATURATION_VALUE; colorSaturationTransitionState->highLimit = MAX_SATURATION_VALUE; - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTime); + Attributes::RemainingTime::Set(endpoint, transitionTime); // kick off the state machine: emberEventControlSetDelayMS(configureHSVEventControl(endpoint), UPDATE_TIME_MS); @@ -1342,7 +1345,7 @@ bool ColorControlServer::stepSaturationCommand(uint8_t stepMode, uint8_t stepSiz colorSaturationTransitionState->lowLimit = MIN_SATURATION_VALUE; colorSaturationTransitionState->highLimit = MAX_SATURATION_VALUE; - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTime); + Attributes::RemainingTime::Set(endpoint, transitionTime); // kick off the state machine: emberEventControlSetDelayMS(configureHSVEventControl(endpoint), UPDATE_TIME_MS); @@ -1364,14 +1367,14 @@ bool ColorControlServer::colorLoopCommand(uint8_t updateFlags, uint8_t action, u } uint8_t isColorLoopActive = 0; - ColorControl::Attributes::ColorLoopActive::Get(endpoint, &isColorLoopActive); + Attributes::ColorLoopActive::Get(endpoint, &isColorLoopActive); uint8_t deactiveColorLoop = (updateFlags & EMBER_AF_COLOR_LOOP_UPDATE_FLAGS_UPDATE_ACTION) && (action == EMBER_ZCL_COLOR_LOOP_ACTION_DEACTIVATE); if (updateFlags & EMBER_AF_COLOR_LOOP_UPDATE_FLAGS_UPDATE_DIRECTION) { - ColorControl::Attributes::ColorLoopDirection::Set(endpoint, direction); + Attributes::ColorLoopDirection::Set(endpoint, direction); // Checks if color loop is active and stays active if (isColorLoopActive && !deactiveColorLoop) @@ -1393,7 +1396,7 @@ bool ColorControlServer::colorLoopCommand(uint8_t updateFlags, uint8_t action, u if (updateFlags & EMBER_AF_COLOR_LOOP_UPDATE_FLAGS_UPDATE_TIME) { - ColorControl::Attributes::ColorLoopTime::Set(endpoint, time); + Attributes::ColorLoopTime::Set(endpoint, time); // Checks if color loop is active and stays active if (isColorLoopActive && !deactiveColorLoop) @@ -1415,7 +1418,7 @@ bool ColorControlServer::colorLoopCommand(uint8_t updateFlags, uint8_t action, u if (updateFlags & EMBER_AF_COLOR_LOOP_UPDATE_FLAGS_UPDATE_START_HUE) { - ColorControl::Attributes::ColorLoopStartEnhancedHue::Set(endpoint, startHue); + Attributes::ColorLoopStartEnhancedHue::Set(endpoint, startHue); } if (updateFlags & EMBER_AF_COLOR_LOOP_UPDATE_FLAGS_UPDATE_ACTION) @@ -1426,11 +1429,11 @@ bool ColorControlServer::colorLoopCommand(uint8_t updateFlags, uint8_t action, u { stopAllColorTransitions(endpoint); - ColorControl::Attributes::ColorLoopActive::Set(endpoint, false); + Attributes::ColorLoopActive::Set(endpoint, false); uint16_t storedEnhancedHue = 0; - ColorControl::Attributes::ColorLoopStoredEnhancedHue::Get(endpoint, &storedEnhancedHue); - ColorControl::Attributes::EnhancedCurrentHue::Set(endpoint, storedEnhancedHue); + Attributes::ColorLoopStoredEnhancedHue::Get(endpoint, &storedEnhancedHue); + Attributes::EnhancedCurrentHue::Set(endpoint, storedEnhancedHue); } else { @@ -1482,16 +1485,16 @@ void ColorControlServer::updateHueSatCommand(EndpointId endpoint) if (colorHueTransitionState->isEnhancedHue) { - ColorControl::Attributes::EnhancedCurrentHue::Set(endpoint, colorHueTransitionState->currentEnhancedHue); - ColorControl::Attributes::CurrentHue::Set(endpoint, static_cast(colorHueTransitionState->currentEnhancedHue >> 8)); + Attributes::EnhancedCurrentHue::Set(endpoint, colorHueTransitionState->currentEnhancedHue); + Attributes::CurrentHue::Set(endpoint, static_cast(colorHueTransitionState->currentEnhancedHue >> 8)); } else { - ColorControl::Attributes::CurrentHue::Set(colorHueTransitionState->endpoint, colorHueTransitionState->currentHue); + Attributes::CurrentHue::Set(colorHueTransitionState->endpoint, colorHueTransitionState->currentHue); } - ColorControl::Attributes::CurrentSaturation::Set(colorSaturationTransitionState->endpoint, - (uint8_t) colorSaturationTransitionState->currentValue); + Attributes::CurrentSaturation::Set(colorSaturationTransitionState->endpoint, + (uint8_t) colorSaturationTransitionState->currentValue); if (colorHueTransitionState->isEnhancedHue) { emberAfColorControlClusterPrintln("Enhanced Hue %d Saturation %d endpoint %d", colorHueTransitionState->currentEnhancedHue, @@ -1596,8 +1599,8 @@ bool ColorControlServer::moveToColorCommand(uint16_t colorX, uint16_t colorY, ui handleModeSwitch(endpoint, COLOR_MODE_CIE_XY); // now, kick off the state machine. - ColorControl::Attributes::CurrentX::Get(endpoint, &(colorXTransitionState->initialValue)); - ColorControl::Attributes::CurrentX::Get(endpoint, &(colorXTransitionState->currentValue)); + Attributes::CurrentX::Get(endpoint, &(colorXTransitionState->initialValue)); + Attributes::CurrentX::Get(endpoint, &(colorXTransitionState->currentValue)); colorXTransitionState->finalValue = colorX; colorXTransitionState->stepsRemaining = transitionTime; colorXTransitionState->stepsTotal = transitionTime; @@ -1605,8 +1608,8 @@ bool ColorControlServer::moveToColorCommand(uint16_t colorX, uint16_t colorY, ui colorXTransitionState->lowLimit = MIN_CIE_XY_VALUE; colorXTransitionState->highLimit = MAX_CIE_XY_VALUE; - ColorControl::Attributes::CurrentY::Get(endpoint, &(colorYTransitionState->initialValue)); - ColorControl::Attributes::CurrentY::Get(endpoint, &(colorYTransitionState->currentValue)); + Attributes::CurrentY::Get(endpoint, &(colorYTransitionState->initialValue)); + Attributes::CurrentY::Get(endpoint, &(colorYTransitionState->currentValue)); colorYTransitionState->finalValue = colorY; colorYTransitionState->stepsRemaining = transitionTime; colorYTransitionState->stepsTotal = transitionTime; @@ -1614,7 +1617,7 @@ bool ColorControlServer::moveToColorCommand(uint16_t colorX, uint16_t colorY, ui colorYTransitionState->lowLimit = MIN_CIE_XY_VALUE; colorYTransitionState->highLimit = MAX_CIE_XY_VALUE; - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTime); + Attributes::RemainingTime::Set(endpoint, transitionTime); // kick off the state machine: emberEventControlSetDelayMS(configureXYEventControl(endpoint), UPDATE_TIME_MS); @@ -1651,7 +1654,7 @@ bool ColorControlServer::moveColorCommand(int16_t rateX, int16_t rateY, uint8_t handleModeSwitch(endpoint, COLOR_MODE_CIE_XY); // now, kick off the state machine. - ColorControl::Attributes::CurrentX::Get(endpoint, &(colorXTransitionState->initialValue)); + Attributes::CurrentX::Get(endpoint, &(colorXTransitionState->initialValue)); colorXTransitionState->currentValue = colorXTransitionState->initialValue; if (rateX > 0) { @@ -1670,7 +1673,7 @@ bool ColorControlServer::moveColorCommand(int16_t rateX, int16_t rateY, uint8_t colorXTransitionState->lowLimit = MIN_CIE_XY_VALUE; colorXTransitionState->highLimit = MAX_CIE_XY_VALUE; - ColorControl::Attributes::CurrentY::Get(endpoint, &(colorYTransitionState->initialValue)); + Attributes::CurrentY::Get(endpoint, &(colorYTransitionState->initialValue)); colorYTransitionState->currentValue = colorYTransitionState->initialValue; if (rateY > 0) { @@ -1691,11 +1694,11 @@ bool ColorControlServer::moveColorCommand(int16_t rateX, int16_t rateY, uint8_t if (transitionTimeX < transitionTimeY) { - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTimeX); + Attributes::RemainingTime::Set(endpoint, transitionTimeX); } else { - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTimeY); + Attributes::RemainingTime::Set(endpoint, transitionTimeY); } // kick off the state machine: @@ -1719,10 +1722,10 @@ bool ColorControlServer::stepColorCommand(int16_t stepX, int16_t stepY, uint16_t } uint16_t currentColorX = 0; - ColorControl::Attributes::CurrentX::Get(endpoint, ¤tColorX); + Attributes::CurrentX::Get(endpoint, ¤tColorX); uint16_t currentColorY = 0; - ColorControl::Attributes::CurrentY::Get(endpoint, ¤tColorY); + Attributes::CurrentY::Get(endpoint, ¤tColorY); uint16_t colorX = findNewColorValueFromStep(currentColorX, stepX); uint16_t colorY = findNewColorValueFromStep(currentColorY, stepY); @@ -1757,7 +1760,7 @@ bool ColorControlServer::stepColorCommand(int16_t stepX, int16_t stepY, uint16_t colorYTransitionState->lowLimit = MIN_CIE_XY_VALUE; colorYTransitionState->highLimit = MAX_CIE_XY_VALUE; - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTime); + Attributes::RemainingTime::Set(endpoint, transitionTime); // kick off the state machine: emberEventControlSetDelayMS(configureXYEventControl(endpoint), UPDATE_TIME_MS); @@ -1792,8 +1795,8 @@ void ColorControlServer::updateXYCommand(EndpointId endpoint) } // update the attributes - ColorControl::Attributes::CurrentX::Set(endpoint, colorXTransitionState->currentValue); - ColorControl::Attributes::CurrentY::Set(endpoint, colorYTransitionState->currentValue); + Attributes::CurrentX::Set(endpoint, colorXTransitionState->currentValue); + Attributes::CurrentY::Set(endpoint, colorYTransitionState->currentValue); emberAfColorControlClusterPrintln("Color X %d Color Y %d", colorXTransitionState->currentValue, colorYTransitionState->currentValue); @@ -1829,10 +1832,10 @@ void ColorControlServer::moveToColorTemp(EndpointId aEndpoint, uint16_t colorTem Color16uTransitionState * colorTempTransitionState = getTempTransitionState(endpoint); uint16_t temperatureMin = MIN_TEMPERATURE_VALUE; - ColorControl::Attributes::ColorTempPhysicalMin::Get(endpoint, &temperatureMin); + Attributes::ColorTempPhysicalMin::Get(endpoint, &temperatureMin); uint16_t temperatureMax = MAX_TEMPERATURE_VALUE; - ColorControl::Attributes::ColorTempPhysicalMax::Get(endpoint, &temperatureMax); + Attributes::ColorTempPhysicalMax::Get(endpoint, &temperatureMax); if (transitionTime == 0) { @@ -1856,8 +1859,8 @@ void ColorControlServer::moveToColorTemp(EndpointId aEndpoint, uint16_t colorTem } // now, kick off the state machine. - ColorControl::Attributes::ColorTemperature::Get(endpoint, &(colorTempTransitionState->initialValue)); - ColorControl::Attributes::ColorTemperature::Get(endpoint, &(colorTempTransitionState->currentValue)); + Attributes::ColorTemperature::Get(endpoint, &(colorTempTransitionState->initialValue)); + Attributes::ColorTemperature::Get(endpoint, &(colorTempTransitionState->currentValue)); colorTempTransitionState->finalValue = colorTemperature; colorTempTransitionState->stepsRemaining = transitionTime; @@ -1881,12 +1884,12 @@ uint16_t ColorControlServer::getTemperatureCoupleToLevelMin(EndpointId endpoint) uint16_t colorTemperatureCoupleToLevelMin; EmberAfStatus status; - status = ColorControl::Attributes::CoupleColorTempToLevelMinMireds::Get(endpoint, &colorTemperatureCoupleToLevelMin); + status = Attributes::CoupleColorTempToLevelMinMireds::Get(endpoint, &colorTemperatureCoupleToLevelMin); if (status != EMBER_ZCL_STATUS_SUCCESS) { // Not less than the physical min. - ColorControl::Attributes::ColorTempPhysicalMin::Get(endpoint, &colorTemperatureCoupleToLevelMin); + Attributes::ColorTempPhysicalMin::Get(endpoint, &colorTemperatureCoupleToLevelMin); } return colorTemperatureCoupleToLevelMin; @@ -1921,20 +1924,20 @@ void ColorControlServer::startUpColorTempCommand(EndpointId endpoint) // Initialize startUpColorTempMireds to "maintain previous value" value 0xFFFF uint16_t startUpColorTemp = 0xFFFF; - EmberAfStatus status = ColorControl::Attributes::StartUpColorTemperatureMireds::Get(endpoint, &startUpColorTemp); + EmberAfStatus status = Attributes::StartUpColorTemperatureMireds::Get(endpoint, &startUpColorTemp); if (status == EMBER_ZCL_STATUS_SUCCESS) { uint16_t updatedColorTemp = MAX_TEMPERATURE_VALUE; - status = ColorControl::Attributes::ColorTemperature::Get(endpoint, &updatedColorTemp); + status = Attributes::ColorTemperature::Get(endpoint, &updatedColorTemp); if (status == EMBER_ZCL_STATUS_SUCCESS) { uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE; - ColorControl::Attributes::ColorTempPhysicalMin::Get(endpoint, &tempPhysicalMin); + Attributes::ColorTempPhysicalMin::Get(endpoint, &tempPhysicalMin); uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE; - ColorControl::Attributes::ColorTempPhysicalMax::Get(endpoint, &tempPhysicalMax); + Attributes::ColorTempPhysicalMax::Get(endpoint, &tempPhysicalMax); if (tempPhysicalMin <= startUpColorTemp && startUpColorTemp <= tempPhysicalMax) { @@ -1943,16 +1946,16 @@ void ColorControlServer::startUpColorTempCommand(EndpointId endpoint) // existing setting of ColorTemp attribute will be left unchanged (i.e., treated as // if startup color temp was set to 0xFFFF). updatedColorTemp = startUpColorTemp; - status = ColorControl::Attributes::ColorTemperature::Set(endpoint, updatedColorTemp); + status = Attributes::ColorTemperature::Set(endpoint, updatedColorTemp); if (status == EMBER_ZCL_STATUS_SUCCESS) { // Set ColorMode attributes to reflect ColorTemperature. uint8_t updateColorMode = EMBER_ZCL_COLOR_MODE_COLOR_TEMPERATURE; - ColorControl::Attributes::ColorMode::Set(endpoint, updateColorMode); + Attributes::ColorMode::Set(endpoint, updateColorMode); updateColorMode = EMBER_ZCL_ENHANCED_COLOR_MODE_COLOR_TEMPERATURE; - ColorControl::Attributes::EnhancedColorMode::Set(endpoint, updateColorMode); + Attributes::EnhancedColorMode::Set(endpoint, updateColorMode); } } } @@ -1980,7 +1983,7 @@ void ColorControlServer::updateTempCommand(EndpointId endpoint) emberEventControlSetDelayMS(configureTempEventControl(endpoint), UPDATE_TIME_MS); } - ColorControl::Attributes::ColorTemperature::Set(endpoint, colorTempTransitionState->currentValue); + Attributes::ColorTemperature::Set(endpoint, colorTempTransitionState->currentValue); emberAfColorControlClusterPrintln("Color Temperature %d", colorTempTransitionState->currentValue); @@ -2012,10 +2015,10 @@ bool ColorControlServer::moveColorTempCommand(uint8_t moveMode, uint16_t rate, u } uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE; - ColorControl::Attributes::ColorTempPhysicalMin::Get(endpoint, &tempPhysicalMin); + Attributes::ColorTempPhysicalMin::Get(endpoint, &tempPhysicalMin); uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE; - ColorControl::Attributes::ColorTempPhysicalMax::Get(endpoint, &tempPhysicalMax); + Attributes::ColorTempPhysicalMax::Get(endpoint, &tempPhysicalMax); uint16_t transitionTime; @@ -2048,7 +2051,7 @@ bool ColorControlServer::moveColorTempCommand(uint8_t moveMode, uint16_t rate, u // now, kick off the state machine. colorTempTransitionState->initialValue = 0; - ColorControl::Attributes::ColorTemperature::Get(endpoint, &colorTempTransitionState->initialValue); + Attributes::ColorTemperature::Get(endpoint, &colorTempTransitionState->initialValue); colorTempTransitionState->currentValue = colorTempTransitionState->initialValue; if (moveMode == MOVE_MODE_UP) @@ -2080,7 +2083,7 @@ bool ColorControlServer::moveColorTempCommand(uint8_t moveMode, uint16_t rate, u colorTempTransitionState->lowLimit = colorTemperatureMinimum; colorTempTransitionState->highLimit = colorTemperatureMaximum; - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTime); + Attributes::RemainingTime::Set(endpoint, transitionTime); // kick off the state machine: emberEventControlSetDelayMS(configureTempEventControl(endpoint), UPDATE_TIME_MS); @@ -2120,10 +2123,10 @@ bool ColorControlServer::stepColorTempCommand(uint8_t stepMode, uint16_t stepSiz } uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE; - ColorControl::Attributes::ColorTempPhysicalMin::Get(endpoint, &tempPhysicalMin); + Attributes::ColorTempPhysicalMin::Get(endpoint, &tempPhysicalMin); uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE; - ColorControl::Attributes::ColorTempPhysicalMax::Get(endpoint, &tempPhysicalMax); + Attributes::ColorTempPhysicalMax::Get(endpoint, &tempPhysicalMax); if (transitionTime == 0) { @@ -2153,7 +2156,7 @@ bool ColorControlServer::stepColorTempCommand(uint8_t stepMode, uint16_t stepSiz // now, kick off the state machine. colorTempTransitionState->initialValue = 0; - ColorControl::Attributes::ColorTemperature::Get(endpoint, &colorTempTransitionState->initialValue); + Attributes::ColorTemperature::Get(endpoint, &colorTempTransitionState->initialValue); colorTempTransitionState->currentValue = colorTempTransitionState->initialValue; if (stepMode == MOVE_MODE_UP) @@ -2186,7 +2189,7 @@ bool ColorControlServer::stepColorTempCommand(uint8_t stepMode, uint16_t stepSiz colorTempTransitionState->lowLimit = colorTemperatureMinimum; colorTempTransitionState->highLimit = colorTemperatureMaximum; - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTime); + Attributes::RemainingTime::Set(endpoint, transitionTime); // kick off the state machine: emberEventControlSetDelayMS(configureTempEventControl(endpoint), UPDATE_TIME_MS); @@ -2234,7 +2237,7 @@ void ColorControlServer::levelControlColorTempChangeCommand(EndpointId endpoint) } uint8_t colorMode = 0; - ColorControl::Attributes::ColorMode::Get(endpoint, &colorMode); + Attributes::ColorMode::Get(endpoint, &colorMode); if (colorMode == COLOR_MODE_TEMPERATURE) { @@ -2244,7 +2247,7 @@ void ColorControlServer::levelControlColorTempChangeCommand(EndpointId endpoint) LevelControl::Attributes::CurrentLevel::Get(endpoint, ¤tLevel); uint16_t tempPhysMax = MAX_TEMPERATURE_VALUE; - ColorControl::Attributes::ColorTempPhysicalMax::Get(endpoint, &tempPhysMax); + Attributes::ColorTempPhysicalMax::Get(endpoint, &tempPhysMax); // Scale color temp setting between the coupling min and the physical max. // Note that mireds varies inversely with level: low level -> high mireds. diff --git a/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp b/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp index 2d3f22ced2abf8..bf8fddf18f5ca1 100644 --- a/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp +++ b/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp @@ -15,10 +15,13 @@ * limitations under the License. */ +#include #include +#include #include using namespace chip; +using namespace chip::app::Clusters::DiagnosticLogs; bool emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, EndpointId endpoint, diff --git a/src/app/clusters/door-lock-server/door-lock-server-logging.cpp b/src/app/clusters/door-lock-server/door-lock-server-logging.cpp index 32dae38f57ab34..feac4b17123672 100644 --- a/src/app/clusters/door-lock-server/door-lock-server-logging.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server-logging.cpp @@ -42,14 +42,17 @@ #include #include #include +#include #include #include #include #include +#include #include using namespace chip; +using namespace chip::app::Clusters::DoorLock; static EmberAfPluginDoorLockServerLogEntry entries[EMBER_AF_PLUGIN_DOOR_LOCK_SERVER_MAX_LOG_ENTRIES]; static uint8_t nextEntryId = 1; diff --git a/src/app/clusters/door-lock-server/door-lock-server-schedule.cpp b/src/app/clusters/door-lock-server/door-lock-server-schedule.cpp index e2796a40e894c2..0859388913d2a9 100644 --- a/src/app/clusters/door-lock-server/door-lock-server-schedule.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server-schedule.cpp @@ -40,13 +40,16 @@ #include "door-lock-server.h" #include #include +#include #include #include #include +#include #include using namespace chip; +using namespace chip::app::Clusters::DoorLock; static EmberAfPluginDoorLockServerWeekdayScheduleEntry weekdayScheduleTable[EMBER_AF_PLUGIN_DOOR_LOCK_SERVER_WEEKDAY_SCHEDULE_TABLE_SIZE]; diff --git a/src/app/clusters/door-lock-server/door-lock-server-user.cpp b/src/app/clusters/door-lock-server/door-lock-server-user.cpp index ae4a4bb5586a25..510fb59a4b9204 100644 --- a/src/app/clusters/door-lock-server/door-lock-server-user.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server-user.cpp @@ -42,15 +42,18 @@ #include #include #include +#include #include #include #include #include #include +#include #include using namespace chip; +using namespace chip::app::Clusters::DoorLock; EmberEventControl emberAfPluginDoorLockServerLockoutEventControl; EmberEventControl emberAfPluginDoorLockServerRelockEventControl; diff --git a/src/app/clusters/ethernet_network_diagnostics_server/ethernet_network_diagnostics_server.cpp b/src/app/clusters/ethernet_network_diagnostics_server/ethernet_network_diagnostics_server.cpp index 220c723f10733b..3345b319664368 100644 --- a/src/app/clusters/ethernet_network_diagnostics_server/ethernet_network_diagnostics_server.cpp +++ b/src/app/clusters/ethernet_network_diagnostics_server/ethernet_network_diagnostics_server.cpp @@ -16,10 +16,12 @@ */ #include +#include #include #include #include #include +#include #include #include #include @@ -29,6 +31,7 @@ using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; +using namespace chip::app::Clusters::EthernetNetworkDiagnostics; using namespace chip::app::Clusters::EthernetNetworkDiagnostics::Attributes; using chip::DeviceLayer::ConnectivityManager; 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 765be8ad7e8844..7e161651fa3507 100644 --- a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp +++ b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp @@ -21,13 +21,16 @@ ******************************************************************************* ******************************************************************************/ +#include #include +#include #include #include #include #include using namespace chip; +using namespace chip::app::Clusters::GeneralCommissioning; bool emberAfGeneralCommissioningClusterArmFailSafeCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, EndpointId endpoint, diff --git a/src/app/clusters/groups-server/groups-server.cpp b/src/app/clusters/groups-server/groups-server.cpp index 092ecd31eba666..32917a976c8f78 100644 --- a/src/app/clusters/groups-server/groups-server.cpp +++ b/src/app/clusters/groups-server/groups-server.cpp @@ -50,8 +50,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -60,6 +62,7 @@ #endif // EMBER_AF_PLUGIN_SCENES using namespace chip; +using namespace chip::app::Clusters::Groups; static bool isGroupPresent(EndpointId endpoint, GroupId groupId); diff --git a/src/app/clusters/ias-zone-server/ias-zone-server.cpp b/src/app/clusters/ias-zone-server/ias-zone-server.cpp index a6cb2efa5467f9..ee7b396fbf5137 100644 --- a/src/app/clusters/ias-zone-server/ias-zone-server.cpp +++ b/src/app/clusters/ias-zone-server/ias-zone-server.cpp @@ -56,14 +56,17 @@ #include #include #include +#include #include #include +#include #include #include #include #include using namespace chip; +using namespace chip::app::Clusters::IasZone; #define UNDEFINED_ZONE_ID 0xFF #define DELAY_TIMER_MS (1 * MILLISECOND_TICKS_PER_SECOND) diff --git a/src/app/clusters/identify-server/identify-server.cpp b/src/app/clusters/identify-server/identify-server.cpp index c6406eb44b0507..7c4fdc38db5383 100644 --- a/src/app/clusters/identify-server/identify-server.cpp +++ b/src/app/clusters/identify-server/identify-server.cpp @@ -38,11 +38,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include @@ -60,6 +62,7 @@ using namespace chip; using namespace chip::app; +using namespace chip::app::Clusters::Identify; static std::array instances = { 0 }; diff --git a/src/app/clusters/keypad-input-server/keypad-input-server.cpp b/src/app/clusters/keypad-input-server/keypad-input-server.cpp index 66b0b78586c542..c1c751c9fb9004 100644 --- a/src/app/clusters/keypad-input-server/keypad-input-server.cpp +++ b/src/app/clusters/keypad-input-server/keypad-input-server.cpp @@ -22,12 +22,15 @@ ******************************************************************************/ #include +#include #include #include #include +#include #include using namespace chip; +using namespace chip::app::Clusters::KeypadInput; EmberAfKeypadInputStatus keypadInputClusterSendKey(EmberAfKeypadInputCecKeyCode keyCode); diff --git a/src/app/clusters/level-control/level-control.cpp b/src/app/clusters/level-control/level-control.cpp index 7179e235a4985e..2267482958f556 100644 --- a/src/app/clusters/level-control/level-control.cpp +++ b/src/app/clusters/level-control/level-control.cpp @@ -46,8 +46,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -67,6 +69,7 @@ #include using namespace chip; +using namespace chip::app::Clusters::LevelControl; #ifdef ZCL_USING_LEVEL_CONTROL_CLUSTER_START_UP_CURRENT_LEVEL_ATTRIBUTE static bool areStartUpLevelControlServerAttributesTokenized(EndpointId endpoint); diff --git a/src/app/clusters/low-power-server/low-power-server.cpp b/src/app/clusters/low-power-server/low-power-server.cpp index 65474e71cabd21..93e5f546f791bd 100644 --- a/src/app/clusters/low-power-server/low-power-server.cpp +++ b/src/app/clusters/low-power-server/low-power-server.cpp @@ -22,10 +22,13 @@ ******************************************************************************* ******************************************************************************/ +#include #include +#include #include using namespace chip; +using namespace chip::app::Clusters::LowPower; bool lowPowerClusterSleep(); diff --git a/src/app/clusters/media-input-server/media-input-server.cpp b/src/app/clusters/media-input-server/media-input-server.cpp index 1bdfcc6084938e..ee8e05a7b06c67 100644 --- a/src/app/clusters/media-input-server/media-input-server.cpp +++ b/src/app/clusters/media-input-server/media-input-server.cpp @@ -24,12 +24,15 @@ #include #include #include +#include #include #include +#include #include #include using namespace chip; +using namespace chip::app::Clusters::MediaInput; bool mediaInputClusterSelectInput(uint8_t input); bool mediaInputClusterShowInputStatus(); diff --git a/src/app/clusters/media-playback-server/media-playback-server.cpp b/src/app/clusters/media-playback-server/media-playback-server.cpp index 5a98e5e4c9f9ef..8b23496e86cd46 100644 --- a/src/app/clusters/media-playback-server/media-playback-server.cpp +++ b/src/app/clusters/media-playback-server/media-playback-server.cpp @@ -25,13 +25,16 @@ #include #include #include +#include #include #include #include +#include #include #include using namespace chip; +using namespace chip::app::Clusters::MediaPlayback; EmberAfMediaPlaybackStatus mediaPlaybackClusterSendMediaPlaybackRequest(MediaPlaybackRequest mediaPlaybackRequest, uint64_t deltaPositionMilliseconds); diff --git a/src/app/clusters/network-commissioning/network-commissioning-ember.cpp b/src/app/clusters/network-commissioning/network-commissioning-ember.cpp index 81cd562892791d..4860bb849abc6b 100644 --- a/src/app/clusters/network-commissioning/network-commissioning-ember.cpp +++ b/src/app/clusters/network-commissioning/network-commissioning-ember.cpp @@ -25,12 +25,15 @@ #include #include #include +#include #include #include #include +#include #include using namespace chip; +using namespace chip::app::Clusters::NetworkCommissioning; bool emberAfNetworkCommissioningClusterAddThreadNetworkCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, EndpointId endpoint, diff --git a/src/app/clusters/on-off-server/on-off-server.cpp b/src/app/clusters/on-off-server/on-off-server.cpp index e823a891a1427c..5537e4ea86e575 100644 --- a/src/app/clusters/on-off-server/on-off-server.cpp +++ b/src/app/clusters/on-off-server/on-off-server.cpp @@ -44,10 +44,12 @@ #include #include #include +#include #include #include #include +#include #include #ifdef EMBER_AF_PLUGIN_SCENES @@ -63,6 +65,7 @@ #endif using namespace chip; +using namespace chip::app::Clusters::OnOff; #ifdef ZCL_USING_ON_OFF_CLUSTER_START_UP_ON_OFF_ATTRIBUTE static bool areStartUpOnOffServerAttributesTokenized(EndpointId endpoint); 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 2496048f49f667..83cfe2969c255a 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -25,9 +25,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -48,6 +50,7 @@ using namespace chip; using namespace ::chip::DeviceLayer; using namespace ::chip::Transport; +using namespace chip::app::Clusters::OperationalCredentials; namespace { @@ -101,7 +104,7 @@ EmberAfStatus writeFabric(FabricIndex fabricIndex, FabricId fabricId, NodeId nod { EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; - FabricDescriptor * fabricDescriptor = chip::Platform::New(); + auto * fabricDescriptor = chip::Platform::New<::FabricDescriptor>(); VerifyOrReturnError(fabricDescriptor != nullptr, EMBER_ZCL_STATUS_FAILURE); fabricDescriptor->FabricIndex = fabricIndex; @@ -169,17 +172,14 @@ CHIP_ERROR writeFabricsIntoFabricsListAttribute() err = CHIP_ERROR_PERSISTED_STORAGE_FAILED; } - if (err == CHIP_NO_ERROR && - app::Clusters::OperationalCredentials::Attributes::CommissionedFabrics::Set(0, fabricIndex) != EMBER_ZCL_STATUS_SUCCESS) + if (err == CHIP_NO_ERROR && Attributes::CommissionedFabrics::Set(0, fabricIndex) != EMBER_ZCL_STATUS_SUCCESS) { emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: Failed to write fabrics count %" PRIu8 " in commissioned fabrics", fabricIndex); err = CHIP_ERROR_PERSISTED_STORAGE_FAILED; } - if (err == CHIP_NO_ERROR && - app::Clusters::OperationalCredentials::Attributes::SupportedFabrics::Set(0, CHIP_CONFIG_MAX_DEVICE_ADMINS) != - EMBER_ZCL_STATUS_SUCCESS) + if (err == CHIP_NO_ERROR && Attributes::SupportedFabrics::Set(0, CHIP_CONFIG_MAX_DEVICE_ADMINS) != EMBER_ZCL_STATUS_SUCCESS) { emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: Failed to write %" PRIu8 " in supported fabrics count attribute", CHIP_CONFIG_MAX_DEVICE_ADMINS); diff --git a/src/app/clusters/ota-provider/ota-provider.cpp b/src/app/clusters/ota-provider/ota-provider.cpp index 7282b77257b748..4a5b228122f56e 100644 --- a/src/app/clusters/ota-provider/ota-provider.cpp +++ b/src/app/clusters/ota-provider/ota-provider.cpp @@ -21,9 +21,11 @@ #include #include #include +#include #include #include #include +#include #include #include @@ -32,6 +34,7 @@ #include "ota-provider.h" using namespace chip; +using namespace chip::app::Clusters::OtaSoftwareUpdateProvider; using chip::app::Clusters::OTAProviderDelegate; namespace { diff --git a/src/app/clusters/scenes/scenes.cpp b/src/app/clusters/scenes/scenes.cpp index 195bc5b54fc4e5..999f98d9ebcc93 100644 --- a/src/app/clusters/scenes/scenes.cpp +++ b/src/app/clusters/scenes/scenes.cpp @@ -43,8 +43,10 @@ #include #include #include +#include #include #include +#include #include #ifdef EMBER_AF_PLUGIN_GROUPS_SERVER @@ -56,6 +58,7 @@ #endif using namespace chip; +using namespace chip::app::Clusters::Scenes; uint8_t emberAfPluginScenesServerEntriesInUse = 0; #if !defined(EMBER_AF_PLUGIN_SCENES_USE_TOKENS) || defined(EZSP_HOST) diff --git a/src/app/clusters/software_diagnostics_server/software_diagnostics_server.cpp b/src/app/clusters/software_diagnostics_server/software_diagnostics_server.cpp index 5788bd92d506e7..44eeee1f822e21 100644 --- a/src/app/clusters/software_diagnostics_server/software_diagnostics_server.cpp +++ b/src/app/clusters/software_diagnostics_server/software_diagnostics_server.cpp @@ -16,10 +16,12 @@ */ #include +#include #include #include #include #include +#include #include #include #include @@ -29,6 +31,7 @@ using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; +using namespace chip::app::Clusters::SoftwareDiagnostics; using namespace chip::app::Clusters::SoftwareDiagnostics::Attributes; using chip::DeviceLayer::PlatformManager; diff --git a/src/app/clusters/target-navigator-server/target-navigator-server.cpp b/src/app/clusters/target-navigator-server/target-navigator-server.cpp index f80ff075f973aa..09f6a808f667fe 100644 --- a/src/app/clusters/target-navigator-server/target-navigator-server.cpp +++ b/src/app/clusters/target-navigator-server/target-navigator-server.cpp @@ -24,13 +24,16 @@ #include #include +#include #include #include #include +#include #include #include using namespace chip; +using namespace chip::app::Clusters::TargetNavigator; TargetNavigatorResponse targetNavigatorClusterNavigateTarget(uint8_t target, std::string data); diff --git a/src/app/clusters/test-cluster-server/test-cluster-server.cpp b/src/app/clusters/test-cluster-server/test-cluster-server.cpp index 0ef124dc66a297..0a5066e2c4ab2b 100644 --- a/src/app/clusters/test-cluster-server/test-cluster-server.cpp +++ b/src/app/clusters/test-cluster-server/test-cluster-server.cpp @@ -24,9 +24,11 @@ #include #include #include +#include #include #include #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 0b4161a95f1bf7..c9a4e9dabf6a58 100644 --- a/src/app/clusters/thermostat-server/thermostat-server.cpp +++ b/src/app/clusters/thermostat-server/thermostat-server.cpp @@ -25,13 +25,16 @@ #include #include #include +#include #include #include #include #include +#include #include using namespace chip; +using namespace chip::app::Clusters::Thermostat; using namespace chip::app::Clusters::Thermostat::Attributes; constexpr int16_t kDefaultAbsMinHeatSetpointLimit = 700; // 7C (44.5 F) is the default diff --git a/src/app/clusters/thread_network_diagnostics_server/thread_network_diagnostics_server.cpp b/src/app/clusters/thread_network_diagnostics_server/thread_network_diagnostics_server.cpp index 1b3ef9546ba8da..874b0285804c89 100644 --- a/src/app/clusters/thread_network_diagnostics_server/thread_network_diagnostics_server.cpp +++ b/src/app/clusters/thread_network_diagnostics_server/thread_network_diagnostics_server.cpp @@ -16,10 +16,12 @@ */ #include +#include #include #include #include #include +#include #include #include #include @@ -33,6 +35,7 @@ using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; +using namespace chip::app::Clusters::ThreadNetworkDiagnostics; using namespace chip::app::Clusters::ThreadNetworkDiagnostics::Attributes; using namespace chip::DeviceLayer; diff --git a/src/app/clusters/tv-channel-server/tv-channel-server.cpp b/src/app/clusters/tv-channel-server/tv-channel-server.cpp index 7e3a9935ce10ff..577188e374ae05 100644 --- a/src/app/clusters/tv-channel-server/tv-channel-server.cpp +++ b/src/app/clusters/tv-channel-server/tv-channel-server.cpp @@ -40,17 +40,20 @@ #include #include +#include #include #include +#include #include using namespace chip; +using namespace chip::app::Clusters::TvChannel; -TvChannelInfo tvChannelClusterChangeChannel(std::string match); +::TvChannelInfo tvChannelClusterChangeChannel(std::string match); bool tvChannelClusterChangeChannelByNumber(uint16_t majorNumer, uint16_t minorNumber); bool tvChannelClusterSkipChannel(uint16_t count); -void sendResponse(app::CommandHandler * command, TvChannelInfo channelInfo) +void sendResponse(app::CommandHandler * command, ::TvChannelInfo channelInfo) { CHIP_ERROR err = CHIP_NO_ERROR; app::CommandPathParams cmdParams = { emberAfCurrentEndpoint(), /* group id */ 0, ZCL_TV_CHANNEL_CLUSTER_ID, diff --git a/src/app/clusters/wifi_network_diagnostics_server/wifi_network_diagnostics_server.cpp b/src/app/clusters/wifi_network_diagnostics_server/wifi_network_diagnostics_server.cpp index 2a96a372762354..b9fd508bf996e5 100644 --- a/src/app/clusters/wifi_network_diagnostics_server/wifi_network_diagnostics_server.cpp +++ b/src/app/clusters/wifi_network_diagnostics_server/wifi_network_diagnostics_server.cpp @@ -16,10 +16,12 @@ */ #include +#include #include #include #include #include +#include #include #include #include @@ -29,6 +31,7 @@ using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; +using namespace chip::app::Clusters::WiFiNetworkDiagnostics; using namespace chip::app::Clusters::WiFiNetworkDiagnostics::Attributes; using chip::DeviceLayer::ConnectivityManager; @@ -78,7 +81,7 @@ CHIP_ERROR WiFiDiagosticsAttrAccess::Read(ClusterInfo & aClusterInfo, const Attr *aDataRead = true; switch (aClusterInfo.mFieldId) { - case SecurityType::Id: { + case Attributes::SecurityType::Id: { return ReadIfSupported(&ConnectivityManager::GetWiFiSecurityType, aEncoder); } case WiFiVersion::Id: { diff --git a/src/app/clusters/window-covering-server/window-covering-server.cpp b/src/app/clusters/window-covering-server/window-covering-server.cpp index 040d2d199816ad..aa842a17c5dbf6 100644 --- a/src/app/clusters/window-covering-server/window-covering-server.cpp +++ b/src/app/clusters/window-covering-server/window-covering-server.cpp @@ -37,8 +37,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -51,6 +53,7 @@ #include #endif // EMBER_AF_PLUGIN_SCENES +using namespace chip; using namespace chip::app::Clusters::WindowCovering; #define WC_PERCENT100THS_MAX 10000 @@ -417,7 +420,8 @@ bool emberAfWindowCoveringClusterDownOrCloseCallback(app::CommandHandler * comma * @brief Cluster StopMotion Command callback (from client) */ bool __attribute__((weak)) -emberAfWindowCoveringClusterStopMotionCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj) +emberAfWindowCoveringClusterStopMotionCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::StopMotion::DecodableType & fields) { emberAfWindowCoveringClusterPrint("StopMotion command received");