diff --git a/components/CommandManager/CommandManager/commands/scan_commands.cpp b/components/CommandManager/CommandManager/commands/scan_commands.cpp index 6844344..bd5d6f7 100644 --- a/components/CommandManager/CommandManager/commands/scan_commands.cpp +++ b/components/CommandManager/CommandManager/commands/scan_commands.cpp @@ -1,11 +1,15 @@ #include "scan_commands.hpp" +#include "sdkconfig.h" CommandResult scanNetworksCommand(std::shared_ptr registry) { +#if !CONFIG_GENERAL_ENABLE_WIRELESS + return CommandResult::getErrorResult("Not supported by current firmware"); +#endif auto wifiManager = registry->resolve(DependencyType::wifi_manager); if (!wifiManager) { - return CommandResult::getErrorResult("WiFiManager not available"); + return CommandResult::getErrorResult("Not supported by current firmware"); } auto networks = wifiManager->ScanNetworks(); diff --git a/components/CommandManager/CommandManager/commands/wifi_commands.cpp b/components/CommandManager/CommandManager/commands/wifi_commands.cpp index 8ca0fcf..6499b58 100644 --- a/components/CommandManager/CommandManager/commands/wifi_commands.cpp +++ b/components/CommandManager/CommandManager/commands/wifi_commands.cpp @@ -1,5 +1,6 @@ #include "wifi_commands.hpp" #include "esp_netif.h" +#include "sdkconfig.h" std::optional parseSetWiFiCommandPayload(std::string_view jsonPayload) { @@ -143,6 +144,9 @@ std::optional parseUpdateAPWiFiCommandPayload(const std::st CommandResult setWiFiCommand(std::shared_ptr registry, std::string_view jsonPayload) { +#if !CONFIG_GENERAL_ENABLE_WIRELESS + return CommandResult::getErrorResult("Not supported by current firmware"); +#endif const auto payload = parseSetWiFiCommandPayload(jsonPayload); if (!payload.has_value()) @@ -164,6 +168,9 @@ CommandResult setWiFiCommand(std::shared_ptr registry, std:: CommandResult deleteWiFiCommand(std::shared_ptr registry, std::string_view jsonPayload) { +#if !CONFIG_GENERAL_ENABLE_WIRELESS + return CommandResult::getErrorResult("Not supported by current firmware"); +#endif const auto payload = parseDeleteWifiCommandPayload(jsonPayload); if (!payload.has_value()) return CommandResult::getErrorResult("Invalid payload"); @@ -176,6 +183,9 @@ CommandResult deleteWiFiCommand(std::shared_ptr registry, st CommandResult updateWiFiCommand(std::shared_ptr registry, std::string_view jsonPayload) { +#if !CONFIG_GENERAL_ENABLE_WIRELESS + return CommandResult::getErrorResult("Not supported by current firmware"); +#endif const auto payload = parseUpdateWifiCommandPayload(jsonPayload); if (!payload.has_value()) { @@ -207,6 +217,9 @@ CommandResult updateWiFiCommand(std::shared_ptr registry, st CommandResult updateAPWiFiCommand(std::shared_ptr registry, std::string_view jsonPayload) { +#if !CONFIG_GENERAL_ENABLE_WIRELESS + return CommandResult::getErrorResult("Not supported by current firmware"); +#endif const auto payload = parseUpdateAPWiFiCommandPayload(jsonPayload); if (!payload.has_value()) @@ -226,7 +239,13 @@ CommandResult updateAPWiFiCommand(std::shared_ptr registry, } CommandResult getWiFiStatusCommand(std::shared_ptr registry) { - auto wifiManager = registry->resolve(DependencyType::wifi_manager); +#if !CONFIG_GENERAL_ENABLE_WIRELESS + return CommandResult::getErrorResult("Not supported by current firmware"); +#endif + auto wifiManager = registry->resolve(DependencyType::wifi_manager); + if (!wifiManager) { + return CommandResult::getErrorResult("Not supported by current firmware"); + } auto projectConfig = registry->resolve(DependencyType::project_config); // Get current WiFi state @@ -287,7 +306,13 @@ CommandResult getWiFiStatusCommand(std::shared_ptr registry) } CommandResult connectWiFiCommand(std::shared_ptr registry) { - auto wifiManager = registry->resolve(DependencyType::wifi_manager); +#if !CONFIG_GENERAL_ENABLE_WIRELESS + return CommandResult::getErrorResult("Not supported by current firmware"); +#endif + auto wifiManager = registry->resolve(DependencyType::wifi_manager); + if (!wifiManager) { + return CommandResult::getErrorResult("Not supported by current firmware"); + } auto projectConfig = registry->resolve(DependencyType::project_config); auto networks = projectConfig->getWifiConfigs(); diff --git a/sdkconfig.board.facefocusvr_eye b/sdkconfig.board.facefocusvr_eye index c7dad68..00db8c6 100644 --- a/sdkconfig.board.facefocusvr_eye +++ b/sdkconfig.board.facefocusvr_eye @@ -67,4 +67,5 @@ CONFIG_MONITORING_LED_GAIN=11 CONFIG_MONITORING_LED_SHUNT_MILLIOHM=22000 CONFIG_MONITORING_LED_SAMPLES=10 CONFIG_MONITORING_LED_INTERVAL_MS=500 -CONFIG_GENERAL_WHO_AM_I="facefocusvr_eye" \ No newline at end of file +CONFIG_GENERAL_WHO_AM_I="facefocusvr_eye" +# CONFIG_GENERAL_ENABLE_WIRELESS is not set \ No newline at end of file diff --git a/sdkconfig.board.facefocusvr_face b/sdkconfig.board.facefocusvr_face index e129199..7978757 100644 --- a/sdkconfig.board.facefocusvr_face +++ b/sdkconfig.board.facefocusvr_face @@ -67,4 +67,5 @@ CONFIG_MONITORING_LED_GAIN=11 CONFIG_MONITORING_LED_SHUNT_MILLIOHM=22000 CONFIG_MONITORING_LED_SAMPLES=10 CONFIG_MONITORING_LED_INTERVAL_MS=500 -CONFIG_GENERAL_WHO_AM_I="facefocusvr_face" \ No newline at end of file +CONFIG_GENERAL_WHO_AM_I="facefocusvr_face" +# CONFIG_GENERAL_ENABLE_WIRELESS is not set \ No newline at end of file diff --git a/sdkconfig.board.project_babble b/sdkconfig.board.project_babble index 60efadd..f67978b 100644 --- a/sdkconfig.board.project_babble +++ b/sdkconfig.board.project_babble @@ -54,4 +54,5 @@ CONFIG_CAMERA_USB_XCLK_FREQ=23000000 CONFIG_GENERAL_INCLUDE_UVC_MODE=y # CONFIG_START_IN_UVC_MODE is not set # CONFIG_MONITORING_LED_CURRENT is not set -CONFIG_GENERAL_WHO_AM_I="project_babble" \ No newline at end of file +CONFIG_GENERAL_WHO_AM_I="project_babble" +CONFIG_GENERAL_ENABLE_WIRELESS=y \ No newline at end of file diff --git a/sdkconfig.board.xiao_esp32s3 b/sdkconfig.board.xiao_esp32s3 index 802d196..ebf9085 100644 --- a/sdkconfig.board.xiao_esp32s3 +++ b/sdkconfig.board.xiao_esp32s3 @@ -59,4 +59,5 @@ CONFIG_CAMERA_USB_XCLK_FREQ=23000000 CONFIG_GENERAL_INCLUDE_UVC_MODE=y # CONFIG_START_IN_UVC_MODE is not set # CONFIG_MONITORING_LED_CURRENT is not set -CONFIG_GENERAL_WHO_AM_I="xiao_esp32s3" \ No newline at end of file +CONFIG_GENERAL_WHO_AM_I="xiao_esp32s3" +CONFIG_GENERAL_ENABLE_WIRELESS=y \ No newline at end of file diff --git a/tools/openiris_setup.py b/tools/openiris_setup.py index 5721d8f..5eb1a88 100644 --- a/tools/openiris_setup.py +++ b/tools/openiris_setup.py @@ -1204,7 +1204,7 @@ def main(): print(f"{str(2):>2} 🌐 Configure MDNS") print(f"{str(3):>2} 💻 Configure UVC Name") print(f"{str(4):>2} 🚀 Start streaming mode") - print(f"{str(5):>2} 🔄 Switch device mode (WiFi/UVC/Auto)") + print(f"{str(5):>2} 🔄 Switch device mode (WiFi/UVC/Setup)") print(f"{str(6):>2} 💡 Update PWM Duty Cycle") print(f"{str(7):>2} 📖 Monitor logs") print(f"{str(8):>2} 🧩 Get settings summary")