Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and Thirsrin committed Jul 5, 2024
1 parent f8f1d2d commit 8341883
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 64 deletions.
2 changes: 1 addition & 1 deletion examples/common/imgui_ui/windows/light.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void Light::Render()
(mColorMode == ColorControl::ColorModeEnum::kCurrentHueAndCurrentSaturation) ? "Hue/Saturation"
: (mColorMode == ColorControl::ColorModeEnum::kCurrentXAndCurrentY) ? "X/Y"
: (mColorMode == ColorControl::ColorModeEnum::kColorTemperatureMireds) ? "Temperature/Mireds"
: "UNKNOWN";
: "UNKNOWN";

ImGui::Text("Mode: %s", mode);

Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/tizen/src/DBusInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void DBusInterface::InitOnOff()
void DBusInterface::InitColor()
{
{
auto value = 0;
auto value = 0;
auto status = Clusters::ColorControl::Attributes::ColorMode::Get(mEndpointId, &value);
VerifyOrReturn(status == Protocols::InteractionModel::Status::Success,
ChipLogError(NotSpecified, "Error getting ColorMode: 0x%x", to_underlying(status)));
Expand Down
119 changes: 57 additions & 62 deletions src/app/clusters/color-control-server/color-control-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,7 @@ Status ColorControlServer::stopAllColorTransitions(EndpointId endpoint)
}

bool ColorControlServer::stopMoveStepCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
chip::BitMask<OptionsBitmap> optionsMask,
chip::BitMask<OptionsBitmap> optionsOverride)
chip::BitMask<OptionsBitmap> optionsMask, chip::BitMask<OptionsBitmap> optionsOverride)
{
EndpointId endpoint = commandPath.mEndpointId;
Status status = Status::Success;
Expand All @@ -466,8 +465,7 @@ bool ColorControlServer::stopMoveStepCommand(app::CommandHandler * commandObj, c
return true;
}

bool ColorControlServer::shouldExecuteIfOff(EndpointId endpoint,
chip::BitMask<OptionsBitmap> optionMask,
bool ColorControlServer::shouldExecuteIfOff(EndpointId endpoint, chip::BitMask<OptionsBitmap> optionMask,
chip::BitMask<OptionsBitmap> optionOverride)
{
// From 5.2.2.2.1.10 of ZCL7 document 14-0129-15f-zcl-ch-5-lighting.docx:
Expand Down Expand Up @@ -1333,10 +1331,8 @@ Status ColorControlServer::moveToHueAndSaturation(uint16_t hue, uint8_t saturati
* @return false Failed
*/
bool ColorControlServer::moveHueCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
MoveModeEnum moveMode, uint16_t rate,
chip::BitMask<OptionsBitmap> optionsMask,
chip::BitMask<OptionsBitmap> optionsOverride,
bool isEnhanced)
MoveModeEnum moveMode, uint16_t rate, chip::BitMask<OptionsBitmap> optionsMask,
chip::BitMask<OptionsBitmap> optionsOverride, bool isEnhanced)
{
MATTER_TRACE_SCOPE("moveHue", "ColorControl");
EndpointId endpoint = commandPath.mEndpointId;
Expand Down Expand Up @@ -1442,8 +1438,7 @@ bool ColorControlServer::moveHueCommand(app::CommandHandler * commandObj, const
*/
bool ColorControlServer::moveToHueCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
uint16_t hue, DirectionEnum moveDirection, uint16_t transitionTime,
chip::BitMask<OptionsBitmap> optionsMask,
chip::BitMask<OptionsBitmap> optionsOverride,
chip::BitMask<OptionsBitmap> optionsMask, chip::BitMask<OptionsBitmap> optionsOverride,
bool isEnhanced)
{
MATTER_TRACE_SCOPE("moveToHue", "ColorControl");
Expand Down Expand Up @@ -1576,10 +1571,11 @@ bool ColorControlServer::moveToHueCommand(app::CommandHandler * commandObj, cons
* @return true Success
* @return false Failed
*/
bool ColorControlServer::moveToHueAndSaturationCommand(
app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, uint16_t hue, uint8_t saturation,
uint16_t transitionTime, chip::BitMask<OptionsBitmap> optionsMask,
chip::BitMask<OptionsBitmap> optionsOverride, bool isEnhanced)
bool ColorControlServer::moveToHueAndSaturationCommand(app::CommandHandler * commandObj,
const app::ConcreteCommandPath & commandPath, uint16_t hue,
uint8_t saturation, uint16_t transitionTime,
chip::BitMask<OptionsBitmap> optionsMask,
chip::BitMask<OptionsBitmap> optionsOverride, bool isEnhanced)
{
MATTER_TRACE_SCOPE("moveToHueAndSaturation", "ColorControl");
// limit checking: hue and saturation are 0..254. Spec dictates we ignore
Expand Down Expand Up @@ -1619,8 +1615,7 @@ bool ColorControlServer::moveToHueAndSaturationCommand(
*/
bool ColorControlServer::stepHueCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
StepModeEnum stepMode, uint16_t stepSize, uint16_t transitionTime,
chip::BitMask<OptionsBitmap> optionsMask,
chip::BitMask<OptionsBitmap> optionsOverride,
chip::BitMask<OptionsBitmap> optionsMask, chip::BitMask<OptionsBitmap> optionsOverride,
bool isEnhanced)
{
MATTER_TRACE_SCOPE("stepHue", "ColorControl");
Expand Down Expand Up @@ -1817,14 +1812,14 @@ bool ColorControlServer::stepSaturationCommand(app::CommandHandler * commandObj,
const Commands::StepSaturation::DecodableType & commandData)
{
MATTER_TRACE_SCOPE("stepSaturation", "ColorControl");
auto stepMode = commandData.stepMode;
uint8_t stepSize = commandData.stepSize;
uint8_t transitionTime = commandData.transitionTime;
chip::BitMask<OptionsBitmap> optionsMask = commandData.optionsMask;
chip::BitMask<OptionsBitmap> optionsOverride = commandData.optionsOverride;
EndpointId endpoint = commandPath.mEndpointId;
Status status = Status::Success;
uint8_t currentSaturation = 0;
auto stepMode = commandData.stepMode;
uint8_t stepSize = commandData.stepSize;
uint8_t transitionTime = commandData.transitionTime;
chip::BitMask<OptionsBitmap> optionsMask = commandData.optionsMask;
chip::BitMask<OptionsBitmap> optionsOverride = commandData.optionsOverride;
EndpointId endpoint = commandPath.mEndpointId;
Status status = Status::Success;
uint8_t currentSaturation = 0;

Color16uTransitionState * colorSaturationTransitionState = getSaturationTransitionState(endpoint);
VerifyOrExit(colorSaturationTransitionState != nullptr, status = Status::UnsupportedEndpoint);
Expand Down Expand Up @@ -1881,17 +1876,17 @@ bool ColorControlServer::colorLoopCommand(app::CommandHandler * commandObj, cons
const Commands::ColorLoopSet::DecodableType & commandData)
{
MATTER_TRACE_SCOPE("colorLoop", "ColorControl");
auto updateFlags = commandData.updateFlags;
auto action = commandData.action;
auto direction = commandData.direction;
uint16_t time = commandData.time;
uint16_t startHue = commandData.startHue;
auto updateFlags = commandData.updateFlags;
auto action = commandData.action;
auto direction = commandData.direction;
uint16_t time = commandData.time;
uint16_t startHue = commandData.startHue;
chip::BitMask<OptionsBitmap> optionsMask = commandData.optionsMask;
chip::BitMask<OptionsBitmap> optionsOverride = commandData.optionsOverride;
EndpointId endpoint = commandPath.mEndpointId;
Status status = Status::Success;
uint8_t isColorLoopActive = 0;
uint8_t deactiveColorLoop = 0;
EndpointId endpoint = commandPath.mEndpointId;
Status status = Status::Success;
uint8_t isColorLoopActive = 0;
uint8_t deactiveColorLoop = 0;

ColorHueTransitionState * colorHueTransitionState = getColorHueTransitionState(endpoint);
VerifyOrExit(colorHueTransitionState != nullptr, status = Status::UnsupportedEndpoint);
Expand Down Expand Up @@ -2212,12 +2207,12 @@ bool ColorControlServer::moveToColorCommand(app::CommandHandler * commandObj, co
bool ColorControlServer::moveColorCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
const Commands::MoveColor::DecodableType & commandData)
{
int16_t rateX = commandData.rateX;
int16_t rateY = commandData.rateY;
int16_t rateX = commandData.rateX;
int16_t rateY = commandData.rateY;
chip::BitMask<OptionsBitmap> optionsMask = commandData.optionsMask;
chip::BitMask<OptionsBitmap> optionsOverride = commandData.optionsOverride;
EndpointId endpoint = commandPath.mEndpointId;
Status status = Status::Success;
EndpointId endpoint = commandPath.mEndpointId;
Status status = Status::Success;

Color16uTransitionState * colorXTransitionState = getXTransitionState(endpoint);
Color16uTransitionState * colorYTransitionState = getYTransitionState(endpoint);
Expand Down Expand Up @@ -2307,16 +2302,16 @@ bool ColorControlServer::moveColorCommand(app::CommandHandler * commandObj, cons
bool ColorControlServer::stepColorCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
const Commands::StepColor::DecodableType & commandData)
{
int16_t stepX = commandData.stepX;
int16_t stepY = commandData.stepY;
uint16_t transitionTime = commandData.transitionTime;
int16_t stepX = commandData.stepX;
int16_t stepY = commandData.stepY;
uint16_t transitionTime = commandData.transitionTime;
chip::BitMask<OptionsBitmap> optionsMask = commandData.optionsMask;
chip::BitMask<OptionsBitmap> optionsOverride = commandData.optionsOverride;
EndpointId endpoint = commandPath.mEndpointId;
uint16_t currentColorX = 0;
uint16_t currentColorY = 0;
uint16_t colorX = 0;
uint16_t colorY = 0;
EndpointId endpoint = commandPath.mEndpointId;
uint16_t currentColorX = 0;
uint16_t currentColorY = 0;
uint16_t colorX = 0;
uint16_t colorY = 0;

Status status = Status::Success;

Expand Down Expand Up @@ -2639,16 +2634,16 @@ void ColorControlServer::updateTempCommand(EndpointId endpoint)
bool ColorControlServer::moveColorTempCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
const Commands::MoveColorTemperature::DecodableType & commandData)
{
auto moveMode = commandData.moveMode;
uint16_t rate = commandData.rate;
uint16_t colorTemperatureMinimum = commandData.colorTemperatureMinimumMireds;
uint16_t colorTemperatureMaximum = commandData.colorTemperatureMaximumMireds;
auto moveMode = commandData.moveMode;
uint16_t rate = commandData.rate;
uint16_t colorTemperatureMinimum = commandData.colorTemperatureMinimumMireds;
uint16_t colorTemperatureMaximum = commandData.colorTemperatureMaximumMireds;
chip::BitMask<OptionsBitmap> optionsMask = commandData.optionsMask;
chip::BitMask<OptionsBitmap> optionsOverride = commandData.optionsOverride;
EndpointId endpoint = commandPath.mEndpointId;
Status status = Status::Success;
uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE;
uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE;
EndpointId endpoint = commandPath.mEndpointId;
Status status = Status::Success;
uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE;
uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE;
uint16_t transitionTime;

Color16uTransitionState * colorTempTransitionState = getTempTransitionState(endpoint);
Expand Down Expand Up @@ -2761,17 +2756,17 @@ bool ColorControlServer::moveToColorTempCommand(app::CommandHandler * commandObj
bool ColorControlServer::stepColorTempCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
const Commands::StepColorTemperature::DecodableType & commandData)
{
auto stepMode = commandData.stepMode;
uint16_t stepSize = commandData.stepSize;
uint16_t transitionTime = commandData.transitionTime;
uint16_t colorTemperatureMinimum = commandData.colorTemperatureMinimumMireds;
uint16_t colorTemperatureMaximum = commandData.colorTemperatureMaximumMireds;
auto stepMode = commandData.stepMode;
uint16_t stepSize = commandData.stepSize;
uint16_t transitionTime = commandData.transitionTime;
uint16_t colorTemperatureMinimum = commandData.colorTemperatureMinimumMireds;
uint16_t colorTemperatureMaximum = commandData.colorTemperatureMaximumMireds;
chip::BitMask<OptionsBitmap> optionsMask = commandData.optionsMask;
chip::BitMask<OptionsBitmap> optionsOverride = commandData.optionsOverride;
EndpointId endpoint = commandPath.mEndpointId;
Status status = Status::Success;
uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE;
uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE;
EndpointId endpoint = commandPath.mEndpointId;
Status status = Status::Success;
uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE;
uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE;

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

0 comments on commit 8341883

Please sign in to comment.