Skip to content

Commit

Permalink
Fix level control print out for strings (project-chip#24949)
Browse files Browse the repository at this point in the history
* fix level control logs

* restyle
  • Loading branch information
mkardous-silabs authored and David Lechner committed Mar 22, 2023
1 parent ee7172c commit 211a360
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/app/clusters/level-control/level-control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,8 @@ static void setOnOffValue(EndpointId endpoint, bool onOff)
#ifdef EMBER_AF_PLUGIN_ON_OFF
if (emberAfContainsServer(endpoint, OnOff::Id))
{
emberAfLevelControlClusterPrintln("Setting on/off to %p due to level change", onOff ? "ON" : "OFF");
OnOffServer::Instance().setOnOffValue(endpoint, (uint8_t)(onOff ? OnOff::Commands::On::Id : OnOff::Commands::Off::Id), true);
emberAfLevelControlClusterPrintln("Setting on/off to %s due to level change", onOff ? "ON" : "OFF");
OnOffServer::Instance().setOnOffValue(endpoint, (onOff ? OnOff::Commands::On::Id : OnOff::Commands::Off::Id), true);
}
#endif // EMBER_AF_PLUGIN_ON_OFF
}
Expand Down Expand Up @@ -543,12 +543,12 @@ bool emberAfLevelControlClusterMoveToLevelCallback(app::CommandHandler * command

if (transitionTime.IsNull())
{
emberAfLevelControlClusterPrintln("%pMOVE_TO_LEVEL %x null %x %x", "RX level-control:", level, optionsMask.Raw(),
emberAfLevelControlClusterPrintln("%s MOVE_TO_LEVEL %x null %x %x", "RX level-control:", level, optionsMask.Raw(),
optionsOverride.Raw());
}
else
{
emberAfLevelControlClusterPrintln("%pMOVE_TO_LEVEL %x %2x %x %x", "RX level-control:", level, transitionTime.Value(),
emberAfLevelControlClusterPrintln("%s MOVE_TO_LEVEL %x %2x %x %x", "RX level-control:", level, transitionTime.Value(),
optionsMask.Raw(), optionsOverride.Raw());
}

Expand All @@ -573,12 +573,12 @@ bool emberAfLevelControlClusterMoveToLevelWithOnOffCallback(app::CommandHandler

if (transitionTime.IsNull())
{
emberAfLevelControlClusterPrintln("%pMOVE_TO_LEVEL_WITH_ON_OFF %x null %x %x", "RX level-control:", level,
emberAfLevelControlClusterPrintln("%s MOVE_TO_LEVEL_WITH_ON_OFF %x null %x %x", "RX level-control:", level,
optionsMask.Raw(), optionsOverride.Raw());
}
else
{
emberAfLevelControlClusterPrintln("%pMOVE_TO_LEVEL_WITH_ON_OFF %x %2x %x %x", "RX level-control:", level,
emberAfLevelControlClusterPrintln("%s MOVE_TO_LEVEL_WITH_ON_OFF %x %2x %x %x", "RX level-control:", level,
transitionTime.Value(), optionsMask.Raw(), optionsOverride.Raw());
}

Expand All @@ -602,12 +602,12 @@ bool emberAfLevelControlClusterMoveCallback(app::CommandHandler * commandObj, co

if (rate.IsNull())
{
emberAfLevelControlClusterPrintln("%pMOVE %x null %x %x", "RX level-control:", moveMode, optionsMask.Raw(),
emberAfLevelControlClusterPrintln("%s MOVE %x null %x %x", "RX level-control:", moveMode, optionsMask.Raw(),
optionsOverride.Raw());
}
else
{
emberAfLevelControlClusterPrintln("%pMOVE %x %u %x %x", "RX level-control:", moveMode, rate.Value(), optionsMask.Raw(),
emberAfLevelControlClusterPrintln("%s MOVE %x %u %x %x", "RX level-control:", moveMode, rate.Value(), optionsMask.Raw(),
optionsOverride.Raw());
}

Expand All @@ -626,12 +626,12 @@ bool emberAfLevelControlClusterMoveWithOnOffCallback(app::CommandHandler * comma

if (rate.IsNull())
{
emberAfLevelControlClusterPrintln("%pMOVE_WITH_ON_OFF %x null %x %x", "RX level-control:", moveMode, optionsMask.Raw(),
emberAfLevelControlClusterPrintln("%s MOVE_WITH_ON_OFF %x null %x %x", "RX level-control:", moveMode, optionsMask.Raw(),
optionsOverride.Raw());
}
else
{
emberAfLevelControlClusterPrintln("%pMOVE_WITH_ON_OFF %u %2x %x %x", "RX level-control:", moveMode, rate.Value(),
emberAfLevelControlClusterPrintln("%s MOVE_WITH_ON_OFF %u %2x %x %x", "RX level-control:", moveMode, rate.Value(),
optionsMask.Raw(), optionsOverride.Raw());
}

Expand All @@ -651,13 +651,13 @@ bool emberAfLevelControlClusterStepCallback(app::CommandHandler * commandObj, co

if (transitionTime.IsNull())
{
emberAfLevelControlClusterPrintln("%pSTEP %x %x null %x %x", "RX level-control:", stepMode, stepSize, optionsMask.Raw(),
emberAfLevelControlClusterPrintln("%s STEP %x %x null %x %x", "RX level-control:", stepMode, stepSize, optionsMask.Raw(),
optionsOverride.Raw());
}
else
{
emberAfLevelControlClusterPrintln("%pSTEP %x %x %2x %x %x", "RX level-control:", stepMode, stepSize, transitionTime.Value(),
optionsMask.Raw(), optionsOverride.Raw());
emberAfLevelControlClusterPrintln("%s STEP %x %x %2x %x %x", "RX level-control:", stepMode, stepSize,
transitionTime.Value(), optionsMask.Raw(), optionsOverride.Raw());
}

stepHandler(commandPath.mEndpointId, Commands::Step::Id, stepMode, stepSize, transitionTime,
Expand All @@ -676,12 +676,12 @@ bool emberAfLevelControlClusterStepWithOnOffCallback(app::CommandHandler * comma

if (transitionTime.IsNull())
{
emberAfLevelControlClusterPrintln("%pSTEP_WITH_ON_OFF %x %x null %x %x", "RX level-control:", stepMode, stepSize,
emberAfLevelControlClusterPrintln("%s STEP_WITH_ON_OFF %x %x null %x %x", "RX level-control:", stepMode, stepSize,
optionsMask.Raw(), optionsOverride.Raw());
}
else
{
emberAfLevelControlClusterPrintln("%pSTEP_WITH_ON_OFF %x %x %2x %x %x", "RX level-control:", stepMode, stepSize,
emberAfLevelControlClusterPrintln("%s STEP_WITH_ON_OFF %x %x %2x %x %x", "RX level-control:", stepMode, stepSize,
transitionTime.Value(), optionsMask.Raw(), optionsOverride.Raw());
}

Expand All @@ -696,7 +696,7 @@ bool emberAfLevelControlClusterStopCallback(app::CommandHandler * commandObj, co
auto & optionsMask = commandData.optionsMask;
auto & optionsOverride = commandData.optionsOverride;

emberAfLevelControlClusterPrintln("%pSTOP", "RX level-control:");
emberAfLevelControlClusterPrintln("%s STOP", "RX level-control:");
stopHandler(commandPath.mEndpointId, Commands::Stop::Id, Optional<BitMask<LevelControlOptions>>(optionsMask),
Optional<BitMask<LevelControlOptions>>(optionsOverride));
return true;
Expand All @@ -707,7 +707,7 @@ bool emberAfLevelControlClusterStopWithOnOffCallback(app::CommandHandler * comma
{
auto & optionsMask = commandData.optionsMask;
auto & optionsOverride = commandData.optionsOverride;
emberAfLevelControlClusterPrintln("%pSTOP_WITH_ON_OFF", "RX level-control:");
emberAfLevelControlClusterPrintln("%s STOP_WITH_ON_OFF", "RX level-control:");
stopHandler(commandPath.mEndpointId, Commands::StopWithOnOff::Id, Optional<BitMask<LevelControlOptions>>(optionsMask),
Optional<BitMask<LevelControlOptions>>(optionsOverride));
return true;
Expand Down

0 comments on commit 211a360

Please sign in to comment.