mirror of
https://github.com/MrUnknownDE/OpenIris-ESPIDF.git
synced 2026-05-04 21:26:04 +02:00
cleanup after rebasing
This commit is contained in:
@@ -138,7 +138,7 @@ CommandResult switchModeCommand(std::shared_ptr<DependencyRegistry> registry, co
|
|||||||
{
|
{
|
||||||
newMode = StreamingMode::WIFI;
|
newMode = StreamingMode::WIFI;
|
||||||
}
|
}
|
||||||
else if (modeStr == "setup" || modeStr == "auto"))
|
else if (modeStr == "setup" || modeStr == "auto")
|
||||||
{
|
{
|
||||||
newMode = StreamingMode::SETUP;
|
newMode = StreamingMode::SETUP;
|
||||||
}
|
}
|
||||||
@@ -212,8 +212,13 @@ CommandResult getLEDCurrentCommand(std::shared_ptr<DependencyRegistry> registry)
|
|||||||
return CommandResult::getErrorResult("MonitoringManager unavailable");
|
return CommandResult::getErrorResult("MonitoringManager unavailable");
|
||||||
}
|
}
|
||||||
float ma = mon->getCurrentMilliAmps();
|
float ma = mon->getCurrentMilliAmps();
|
||||||
auto result = std::format("{{ \"led_current_ma\": {:.3f} }}", static_cast<double>(ma));
|
const auto json = nlohmann::json
|
||||||
return CommandResult::getSuccessResult(result);
|
{
|
||||||
|
{
|
||||||
|
"led_current_ma", std::format("{:.3f}", static_cast<double>(ma))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return CommandResult::getSuccessResult(json);
|
||||||
#else
|
#else
|
||||||
return CommandResult::getErrorResult("Monitoring disabled");
|
return CommandResult::getErrorResult("Monitoring disabled");
|
||||||
#endif
|
#endif
|
||||||
@@ -224,8 +229,14 @@ CommandResult getInfoCommand(std::shared_ptr<DependencyRegistry> /*registry*/)
|
|||||||
const char *who = CONFIG_GENERAL_BOARD;
|
const char *who = CONFIG_GENERAL_BOARD;
|
||||||
const char *ver = CONFIG_GENERAL_VERSION;
|
const char *ver = CONFIG_GENERAL_VERSION;
|
||||||
// Ensure non-null strings
|
// Ensure non-null strings
|
||||||
if (!who) who = "";
|
if (!who)
|
||||||
if (!ver) ver = "";
|
who = "";
|
||||||
auto result = std::format("{{ \"who_am_i\": \"{}\", \"version\": \"{}\" }}", who, ver);
|
if (!ver)
|
||||||
return CommandResult::getSuccessResult(result);
|
ver = "";
|
||||||
|
|
||||||
|
const auto json = nlohmann::json{
|
||||||
|
{"who_am_i", who},
|
||||||
|
{"version", ver},
|
||||||
|
};
|
||||||
|
return CommandResult::getSuccessResult(json);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user