Skip to content

Commit

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

* restyle
  • Loading branch information
mkardous-silabs authored and pull[bot] committed Feb 13, 2024
1 parent 8aff492 commit 3867268
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/app/clusters/level-control/level-control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ 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");
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 @@ -450,12 +450,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 @@ -480,12 +480,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 @@ -509,12 +509,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 @@ -533,12 +533,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 @@ -558,13 +558,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 @@ -583,12 +583,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 @@ -603,7 +603,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 @@ -614,7 +614,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 3867268

Please sign in to comment.