diff --git a/components/UVCStream/UVCStream/UVCStream.cpp b/components/UVCStream/UVCStream/UVCStream.cpp index 4fcc853..87b0ea2 100644 --- a/components/UVCStream/UVCStream/UVCStream.cpp +++ b/components/UVCStream/UVCStream/UVCStream.cpp @@ -1,5 +1,6 @@ #include "UVCStream.hpp" #include // for snprintf +#include #include "freertos/FreeRTOS.h" #include "freertos/task.h" // no deps on main globals here; handover is performed in main before calling setup when needed @@ -12,7 +13,21 @@ extern "C" const char *get_uvc_device_name() { - return deviceConfig->getMDNSConfig().hostname.c_str(); + // Prefer explicit UVC name from Kconfig, fallback to mDNS hostname when empty + static std::string cached_name; + if (cached_name.empty()) + { + const char *cfg_name = CONFIG_GENERAL_UVC_NAME; + if (cfg_name && cfg_name[0] != '\0') + { + cached_name = cfg_name; + } + else + { + cached_name = deviceConfig->getMDNSConfig().hostname; + } + } + return cached_name.c_str(); } const char *get_serial_number(void) diff --git a/main/Kconfig.projbuild b/main/Kconfig.projbuild index 92946c4..2436dd5 100644 --- a/main/Kconfig.projbuild +++ b/main/Kconfig.projbuild @@ -50,6 +50,13 @@ menu "OpenIris: General Configuration" help A firmware version string exposed via the get_info command. + config GENERAL_UVC_NAME + string "UVC device name" + default "openiristracker" + help + Default name reported for the UVC interface/device over USB. + This is independent from the mDNS hostname used on Wi‑Fi. + endmenu menu "OpenIris: Camera Configuration" diff --git a/sdkconfig b/sdkconfig index 4f2d28c..f64ebfb 100644 --- a/sdkconfig +++ b/sdkconfig @@ -576,6 +576,7 @@ CONFIG_GENERAL_STARTUP_DELAY=30 CONFIG_GENERAL_ENABLE_WIRELESS=y CONFIG_GENERAL_WHO_AM_I="facefocusvr_face" CONFIG_GENERAL_Version="0.0.1" +CONFIG_GENERAL_UVC_NAME="FFVR Face" # end of OpenIris: General Configuration # diff --git a/sdkconfig.board.facefocusvr_eye b/sdkconfig.board.facefocusvr_eye index 589c7d4..74e3594 100644 --- a/sdkconfig.board.facefocusvr_eye +++ b/sdkconfig.board.facefocusvr_eye @@ -76,4 +76,5 @@ CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=80 CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80=y # CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160 is not set # CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240 is not set -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=80 \ No newline at end of file +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=80 +CONFIG_GENERAL_UVC_NAME="FFVR Eye" \ No newline at end of file diff --git a/sdkconfig.board.facefocusvr_face b/sdkconfig.board.facefocusvr_face index 54c435b..6ac3a42 100644 --- a/sdkconfig.board.facefocusvr_face +++ b/sdkconfig.board.facefocusvr_face @@ -76,4 +76,5 @@ CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=80 CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80=y # CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160 is not set # CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240 is not set -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=80 \ No newline at end of file +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=80 +CONFIG_GENERAL_UVC_NAME="FFVR Face" \ No newline at end of file