Skip to content

Commit bf67d74

Browse files
restyled-commitsThirsrin
authored andcommitted
Restyled by clang-format
1 parent 71f58dc commit bf67d74

File tree

2 files changed

+91
-73
lines changed

2 files changed

+91
-73
lines changed

src/app/clusters/color-control-server/color-control-server.cpp

+75-65
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
#include <app/ConcreteCommandPath.h>
2222
#include <app/util/attribute-storage.h>
2323
#include <app/util/config.h>
24+
#include <lib/core/Optional.h>
2425
#include <platform/CHIPDeviceLayer.h>
2526
#include <platform/PlatformManager.h>
2627
#include <tracing/macros.h>
27-
#include <lib/core/Optional.h>
2828

2929
#ifdef MATTER_DM_PLUGIN_SCENES_MANAGEMENT
3030
#include <app/clusters/scenes-server/scenes-server.h>
@@ -438,7 +438,8 @@ Status ColorControlServer::stopAllColorTransitions(EndpointId endpoint)
438438
}
439439

440440
bool ColorControlServer::stopMoveStepCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
441-
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsMask, chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsOverride)
441+
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsMask,
442+
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsOverride)
442443
{
443444
EndpointId endpoint = commandPath.mEndpointId;
444445
Status status = Status::Success;
@@ -465,7 +466,9 @@ bool ColorControlServer::stopMoveStepCommand(app::CommandHandler * commandObj, c
465466
return true;
466467
}
467468

468-
bool ColorControlServer::shouldExecuteIfOff(EndpointId endpoint, chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionMask, chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionOverride)
469+
bool ColorControlServer::shouldExecuteIfOff(EndpointId endpoint,
470+
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionMask,
471+
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionOverride)
469472
{
470473
// From 5.2.2.2.1.10 of ZCL7 document 14-0129-15f-zcl-ch-5-lighting.docx:
471474
// "Command execution SHALL NOT continue beyond the Options processing if
@@ -507,7 +510,8 @@ bool ColorControlServer::shouldExecuteIfOff(EndpointId endpoint, chip::BitMask<c
507510
// ---------- The following order is important in decision making -------
508511
// -----------more readable ----------
509512
//
510-
if (optionMask == static_cast<ColorControl::OptionsBitmap>(0xFF) && optionOverride == static_cast<ColorControl::OptionsBitmap>(0xFF))
513+
if (optionMask == static_cast<ColorControl::OptionsBitmap>(0xFF) &&
514+
optionOverride == static_cast<ColorControl::OptionsBitmap>(0xFF))
511515
{
512516
// 0xFF are the default values passed to the command handler when
513517
// the payload is not present - in that case there is use of option
@@ -1329,7 +1333,9 @@ Status ColorControlServer::moveToHueAndSaturation(uint16_t hue, uint8_t saturati
13291333
* @return false Failed
13301334
*/
13311335
bool ColorControlServer::moveHueCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
1332-
MoveModeEnum moveMode, uint16_t rate, chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsMask, chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsOverride,
1336+
MoveModeEnum moveMode, uint16_t rate,
1337+
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsMask,
1338+
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsOverride,
13331339
bool isEnhanced)
13341340
{
13351341
MATTER_TRACE_SCOPE("moveHue", "ColorControl");
@@ -1435,8 +1441,10 @@ bool ColorControlServer::moveHueCommand(app::CommandHandler * commandObj, const
14351441
* @return false Failed
14361442
*/
14371443
bool ColorControlServer::moveToHueCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
1438-
uint16_t hue, DirectionEnum moveDirection, uint16_t transitionTime, chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsMask,
1439-
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsOverride, bool isEnhanced)
1444+
uint16_t hue, DirectionEnum moveDirection, uint16_t transitionTime,
1445+
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsMask,
1446+
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsOverride,
1447+
bool isEnhanced)
14401448
{
14411449
MATTER_TRACE_SCOPE("moveToHue", "ColorControl");
14421450
EndpointId endpoint = commandPath.mEndpointId;
@@ -1568,10 +1576,10 @@ bool ColorControlServer::moveToHueCommand(app::CommandHandler * commandObj, cons
15681576
* @return true Success
15691577
* @return false Failed
15701578
*/
1571-
bool ColorControlServer::moveToHueAndSaturationCommand(app::CommandHandler * commandObj,
1572-
const app::ConcreteCommandPath & commandPath, uint16_t hue,
1573-
uint8_t saturation, uint16_t transitionTime, chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsMask,
1574-
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsOverride, bool isEnhanced)
1579+
bool ColorControlServer::moveToHueAndSaturationCommand(
1580+
app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, uint16_t hue, uint8_t saturation,
1581+
uint16_t transitionTime, chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsMask,
1582+
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsOverride, bool isEnhanced)
15751583
{
15761584
MATTER_TRACE_SCOPE("moveToHueAndSaturation", "ColorControl");
15771585
// limit checking: hue and saturation are 0..254. Spec dictates we ignore
@@ -1610,8 +1618,10 @@ bool ColorControlServer::moveToHueAndSaturationCommand(app::CommandHandler * com
16101618
* @return false Failed
16111619
*/
16121620
bool ColorControlServer::stepHueCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
1613-
StepModeEnum stepMode, uint16_t stepSize, uint16_t transitionTime, chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsMask,
1614-
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsOverride, bool isEnhanced)
1621+
StepModeEnum stepMode, uint16_t stepSize, uint16_t transitionTime,
1622+
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsMask,
1623+
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsOverride,
1624+
bool isEnhanced)
16151625
{
16161626
MATTER_TRACE_SCOPE("stepHue", "ColorControl");
16171627
EndpointId endpoint = commandPath.mEndpointId;
@@ -1807,14 +1817,14 @@ bool ColorControlServer::stepSaturationCommand(app::CommandHandler * commandObj,
18071817
const Commands::StepSaturation::DecodableType & commandData)
18081818
{
18091819
MATTER_TRACE_SCOPE("stepSaturation", "ColorControl");
1810-
auto stepMode = commandData.stepMode;
1811-
uint8_t stepSize = commandData.stepSize;
1812-
uint8_t transitionTime = commandData.transitionTime;
1813-
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsMask = commandData.optionsMask;
1814-
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsOverride = commandData.optionsOverride;
1815-
EndpointId endpoint = commandPath.mEndpointId;
1816-
Status status = Status::Success;
1817-
uint8_t currentSaturation = 0;
1820+
auto stepMode = commandData.stepMode;
1821+
uint8_t stepSize = commandData.stepSize;
1822+
uint8_t transitionTime = commandData.transitionTime;
1823+
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsMask = commandData.optionsMask;
1824+
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsOverride = commandData.optionsOverride;
1825+
EndpointId endpoint = commandPath.mEndpointId;
1826+
Status status = Status::Success;
1827+
uint8_t currentSaturation = 0;
18181828

18191829
Color16uTransitionState * colorSaturationTransitionState = getSaturationTransitionState(endpoint);
18201830
VerifyOrExit(colorSaturationTransitionState != nullptr, status = Status::UnsupportedEndpoint);
@@ -1871,17 +1881,17 @@ bool ColorControlServer::colorLoopCommand(app::CommandHandler * commandObj, cons
18711881
const Commands::ColorLoopSet::DecodableType & commandData)
18721882
{
18731883
MATTER_TRACE_SCOPE("colorLoop", "ColorControl");
1874-
auto updateFlags = commandData.updateFlags;
1875-
auto action = commandData.action;
1876-
auto direction = commandData.direction;
1877-
uint16_t time = commandData.time;
1878-
uint16_t startHue = commandData.startHue;
1879-
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsMask = commandData.optionsMask;
1880-
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsOverride = commandData.optionsOverride;
1881-
EndpointId endpoint = commandPath.mEndpointId;
1882-
Status status = Status::Success;
1883-
uint8_t isColorLoopActive = 0;
1884-
uint8_t deactiveColorLoop = 0;
1884+
auto updateFlags = commandData.updateFlags;
1885+
auto action = commandData.action;
1886+
auto direction = commandData.direction;
1887+
uint16_t time = commandData.time;
1888+
uint16_t startHue = commandData.startHue;
1889+
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsMask = commandData.optionsMask;
1890+
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsOverride = commandData.optionsOverride;
1891+
EndpointId endpoint = commandPath.mEndpointId;
1892+
Status status = Status::Success;
1893+
uint8_t isColorLoopActive = 0;
1894+
uint8_t deactiveColorLoop = 0;
18851895

18861896
ColorHueTransitionState * colorHueTransitionState = getColorHueTransitionState(endpoint);
18871897
VerifyOrExit(colorHueTransitionState != nullptr, status = Status::UnsupportedEndpoint);
@@ -2202,12 +2212,12 @@ bool ColorControlServer::moveToColorCommand(app::CommandHandler * commandObj, co
22022212
bool ColorControlServer::moveColorCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
22032213
const Commands::MoveColor::DecodableType & commandData)
22042214
{
2205-
int16_t rateX = commandData.rateX;
2206-
int16_t rateY = commandData.rateY;
2215+
int16_t rateX = commandData.rateX;
2216+
int16_t rateY = commandData.rateY;
22072217
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsMask = commandData.optionsMask;
22082218
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsOverride = commandData.optionsOverride;
2209-
EndpointId endpoint = commandPath.mEndpointId;
2210-
Status status = Status::Success;
2219+
EndpointId endpoint = commandPath.mEndpointId;
2220+
Status status = Status::Success;
22112221

22122222
Color16uTransitionState * colorXTransitionState = getXTransitionState(endpoint);
22132223
Color16uTransitionState * colorYTransitionState = getYTransitionState(endpoint);
@@ -2297,16 +2307,16 @@ bool ColorControlServer::moveColorCommand(app::CommandHandler * commandObj, cons
22972307
bool ColorControlServer::stepColorCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
22982308
const Commands::StepColor::DecodableType & commandData)
22992309
{
2300-
int16_t stepX = commandData.stepX;
2301-
int16_t stepY = commandData.stepY;
2302-
uint16_t transitionTime = commandData.transitionTime;
2310+
int16_t stepX = commandData.stepX;
2311+
int16_t stepY = commandData.stepY;
2312+
uint16_t transitionTime = commandData.transitionTime;
23032313
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsMask = commandData.optionsMask;
23042314
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsOverride = commandData.optionsOverride;
2305-
EndpointId endpoint = commandPath.mEndpointId;
2306-
uint16_t currentColorX = 0;
2307-
uint16_t currentColorY = 0;
2308-
uint16_t colorX = 0;
2309-
uint16_t colorY = 0;
2315+
EndpointId endpoint = commandPath.mEndpointId;
2316+
uint16_t currentColorX = 0;
2317+
uint16_t currentColorY = 0;
2318+
uint16_t colorX = 0;
2319+
uint16_t colorY = 0;
23102320

23112321
Status status = Status::Success;
23122322

@@ -2629,16 +2639,16 @@ void ColorControlServer::updateTempCommand(EndpointId endpoint)
26292639
bool ColorControlServer::moveColorTempCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
26302640
const Commands::MoveColorTemperature::DecodableType & commandData)
26312641
{
2632-
auto moveMode = commandData.moveMode;
2633-
uint16_t rate = commandData.rate;
2634-
uint16_t colorTemperatureMinimum = commandData.colorTemperatureMinimumMireds;
2635-
uint16_t colorTemperatureMaximum = commandData.colorTemperatureMaximumMireds;
2636-
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsMask = commandData.optionsMask;
2637-
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsOverride = commandData.optionsOverride;
2638-
EndpointId endpoint = commandPath.mEndpointId;
2639-
Status status = Status::Success;
2640-
uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE;
2641-
uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE;
2642+
auto moveMode = commandData.moveMode;
2643+
uint16_t rate = commandData.rate;
2644+
uint16_t colorTemperatureMinimum = commandData.colorTemperatureMinimumMireds;
2645+
uint16_t colorTemperatureMaximum = commandData.colorTemperatureMaximumMireds;
2646+
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsMask = commandData.optionsMask;
2647+
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsOverride = commandData.optionsOverride;
2648+
EndpointId endpoint = commandPath.mEndpointId;
2649+
Status status = Status::Success;
2650+
uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE;
2651+
uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE;
26422652
uint16_t transitionTime;
26432653

26442654
Color16uTransitionState * colorTempTransitionState = getTempTransitionState(endpoint);
@@ -2751,17 +2761,17 @@ bool ColorControlServer::moveToColorTempCommand(app::CommandHandler * commandObj
27512761
bool ColorControlServer::stepColorTempCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
27522762
const Commands::StepColorTemperature::DecodableType & commandData)
27532763
{
2754-
auto stepMode = commandData.stepMode;
2755-
uint16_t stepSize = commandData.stepSize;
2756-
uint16_t transitionTime = commandData.transitionTime;
2757-
uint16_t colorTemperatureMinimum = commandData.colorTemperatureMinimumMireds;
2758-
uint16_t colorTemperatureMaximum = commandData.colorTemperatureMaximumMireds;
2759-
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsMask = commandData.optionsMask;
2760-
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsOverride = commandData.optionsOverride;
2761-
EndpointId endpoint = commandPath.mEndpointId;
2762-
Status status = Status::Success;
2763-
uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE;
2764-
uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE;
2764+
auto stepMode = commandData.stepMode;
2765+
uint16_t stepSize = commandData.stepSize;
2766+
uint16_t transitionTime = commandData.transitionTime;
2767+
uint16_t colorTemperatureMinimum = commandData.colorTemperatureMinimumMireds;
2768+
uint16_t colorTemperatureMaximum = commandData.colorTemperatureMaximumMireds;
2769+
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsMask = commandData.optionsMask;
2770+
chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> optionsOverride = commandData.optionsOverride;
2771+
EndpointId endpoint = commandPath.mEndpointId;
2772+
Status status = Status::Success;
2773+
uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE;
2774+
uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE;
27652775

27662776
Color16uTransitionState * colorTempTransitionState = getTempTransitionState(endpoint);
27672777
VerifyOrExit(colorTempTransitionState != nullptr, status = Status::UnsupportedEndpoint);

0 commit comments

Comments
 (0)