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 24, 2024
1 parent a8a7dcd commit ccee61f
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 @@ -462,8 +462,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 Down Expand Up @@ -502,8 +501,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 @@ -1369,10 +1367,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 @@ -1479,8 +1475,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 @@ -1613,10 +1608,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 @@ -1656,8 +1652,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 @@ -1855,14 +1850,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 @@ -1919,17 +1914,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 @@ -2254,12 +2249,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 @@ -2350,16 +2345,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 @@ -2688,16 +2683,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 @@ -2811,17 +2806,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 ccee61f

Please sign in to comment.