diff --git a/components/CommandManager/CommandManager/commands/device_commands.cpp b/components/CommandManager/CommandManager/commands/device_commands.cpp index 1c64598..2e3aa31 100644 --- a/components/CommandManager/CommandManager/commands/device_commands.cpp +++ b/components/CommandManager/CommandManager/commands/device_commands.cpp @@ -138,7 +138,7 @@ CommandResult switchModeCommand(std::shared_ptr 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 registry) return CommandResult::getErrorResult("MonitoringManager unavailable"); } float ma = mon->getCurrentMilliAmps(); - auto result = std::format("{{ \"led_current_ma\": {:.3f} }}", static_cast(ma)); - return CommandResult::getSuccessResult(result); + const auto json = nlohmann::json + { + { + "led_current_ma", std::format("{:.3f}", static_cast(ma)) + } + } + return CommandResult::getSuccessResult(json); #else return CommandResult::getErrorResult("Monitoring disabled"); #endif @@ -221,11 +226,17 @@ CommandResult getLEDCurrentCommand(std::shared_ptr registry) CommandResult getInfoCommand(std::shared_ptr /*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); } diff --git a/main/openiris_main.cpp b/main/openiris_main.cpp index 490a6ac..eaff621 100644 --- a/main/openiris_main.cpp +++ b/main/openiris_main.cpp @@ -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 { diff --git a/tools/openiris_setup.py b/tools/openiris_setup.py deleted file mode 100644 index e69de29..0000000