mirror of
https://github.com/MrUnknownDE/OpenIris-ESPIDF.git
synced 2026-05-05 05:26:05 +02:00
Add UVC device name configuration and update device name retrieval logic
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
#include "UVCStream.hpp"
|
#include "UVCStream.hpp"
|
||||||
#include <cstdio> // for snprintf
|
#include <cstdio> // for snprintf
|
||||||
|
#include <string>
|
||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
#include "freertos/task.h"
|
#include "freertos/task.h"
|
||||||
// no deps on main globals here; handover is performed in main before calling setup when needed
|
// 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()
|
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)
|
const char *get_serial_number(void)
|
||||||
|
|||||||
@@ -50,6 +50,13 @@ menu "OpenIris: General Configuration"
|
|||||||
help
|
help
|
||||||
A firmware version string exposed via the get_info command.
|
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
|
endmenu
|
||||||
|
|
||||||
menu "OpenIris: Camera Configuration"
|
menu "OpenIris: Camera Configuration"
|
||||||
|
|||||||
@@ -576,6 +576,7 @@ CONFIG_GENERAL_STARTUP_DELAY=30
|
|||||||
CONFIG_GENERAL_ENABLE_WIRELESS=y
|
CONFIG_GENERAL_ENABLE_WIRELESS=y
|
||||||
CONFIG_GENERAL_WHO_AM_I="facefocusvr_face"
|
CONFIG_GENERAL_WHO_AM_I="facefocusvr_face"
|
||||||
CONFIG_GENERAL_Version="0.0.1"
|
CONFIG_GENERAL_Version="0.0.1"
|
||||||
|
CONFIG_GENERAL_UVC_NAME="FFVR Face"
|
||||||
# end of OpenIris: General Configuration
|
# end of OpenIris: General Configuration
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -76,4 +76,5 @@ CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=80
|
|||||||
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80=y
|
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80=y
|
||||||
# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160 is not set
|
# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160 is not set
|
||||||
# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240 is not set
|
# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240 is not set
|
||||||
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=80
|
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=80
|
||||||
|
CONFIG_GENERAL_UVC_NAME="FFVR Eye"
|
||||||
@@ -76,4 +76,5 @@ CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=80
|
|||||||
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80=y
|
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80=y
|
||||||
# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160 is not set
|
# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160 is not set
|
||||||
# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240 is not set
|
# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240 is not set
|
||||||
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=80
|
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=80
|
||||||
|
CONFIG_GENERAL_UVC_NAME="FFVR Face"
|
||||||
Reference in New Issue
Block a user