mirror of
https://github.com/MrUnknownDE/OpenIris-ESPIDF.git
synced 2026-04-17 13:33:44 +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;
|
||||
}
|
||||
else if (modeStr == "setup" || modeStr == "auto"))
|
||||
else if (modeStr == "setup" || modeStr == "auto")
|
||||
{
|
||||
newMode = StreamingMode::SETUP;
|
||||
}
|
||||
@@ -212,8 +212,13 @@ CommandResult getLEDCurrentCommand(std::shared_ptr<DependencyRegistry> registry)
|
||||
return CommandResult::getErrorResult("MonitoringManager unavailable");
|
||||
}
|
||||
float ma = mon->getCurrentMilliAmps();
|
||||
auto result = std::format("{{ \"led_current_ma\": {:.3f} }}", static_cast<double>(ma));
|
||||
return CommandResult::getSuccessResult(result);
|
||||
const auto json = nlohmann::json
|
||||
{
|
||||
{
|
||||
"led_current_ma", std::format("{:.3f}", static_cast<double>(ma))
|
||||
}
|
||||
}
|
||||
return CommandResult::getSuccessResult(json);
|
||||
#else
|
||||
return CommandResult::getErrorResult("Monitoring disabled");
|
||||
#endif
|
||||
@@ -221,11 +226,17 @@ CommandResult getLEDCurrentCommand(std::shared_ptr<DependencyRegistry> registry)
|
||||
|
||||
CommandResult getInfoCommand(std::shared_ptr<DependencyRegistry> /*registry*/)
|
||||
{
|
||||
const char* who = CONFIG_GENERAL_BOARD;
|
||||
const char* ver = CONFIG_GENERAL_VERSION;
|
||||
const char *who = CONFIG_GENERAL_BOARD;
|
||||
const char *ver = CONFIG_GENERAL_VERSION;
|
||||
// Ensure non-null strings
|
||||
if (!who) who = "";
|
||||
if (!ver) ver = "";
|
||||
auto result = std::format("{{ \"who_am_i\": \"{}\", \"version\": \"{}\" }}", who, ver);
|
||||
return CommandResult::getSuccessResult(result);
|
||||
if (!who)
|
||||
who = "";
|
||||
if (!ver)
|
||||
ver = "";
|
||||
|
||||
const auto json = nlohmann::json{
|
||||
{"who_am_i", who},
|
||||
{"version", ver},
|
||||
};
|
||||
return CommandResult::getSuccessResult(json);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#define BLINK_GPIO (gpio_num_t) CONFIG_LED_DEBUG_GPIO
|
||||
#else
|
||||
// Use an invalid / unused GPIO when debug LED disabled to avoid accidental toggles
|
||||
#define BLINK_GPIO (gpio_num_t) -1
|
||||
#define BLINK_GPIO (gpio_num_t) - 1
|
||||
#endif
|
||||
#define CONFIG_LED_C_PIN_GPIO (gpio_num_t) CONFIG_LED_EXTERNAL_GPIO
|
||||
|
||||
@@ -112,8 +112,8 @@ void launch_streaming()
|
||||
}
|
||||
else if (deviceMode == StreamingMode::SETUP)
|
||||
{
|
||||
// we're still in setup, the user didn't select anything yet, let's give a bit of time for them to make a choice
|
||||
ESP_LOGI("[MAIN]", "No mode was selected, staying in SETUP mode. WiFi streaming will be enabled still. \nPlease select another mode if you'd like.");
|
||||
// we're still in setup, the user didn't select anything yet, let's give a bit of time for them to make a choice
|
||||
ESP_LOGI("[MAIN]", "No mode was selected, staying in SETUP mode. WiFi streaming will be enabled still. \nPlease select another mode if you'd like.");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user