unify advertised name for mDNS and USB, update configuration settings, and enhance setup tool prompts.

This commit is contained in:
PhosphorosVR
2025-09-06 16:25:21 +02:00
parent 8138ffa36d
commit ad7b9b8be9
8 changed files with 110 additions and 55 deletions
@@ -103,9 +103,13 @@ struct MDNSConfig_t : BaseConfigModel
void load()
{
// by default, this will be openiris
// but we can override it at compile time
std::string default_hostname = CONFIG_WIFI_MDNS_HOSTNAME;
// Default hostname comes from GENERAL_ADVERTISED_NAME (unified advertised name)
std::string default_hostname =
#ifdef CONFIG_GENERAL_ADVERTISED_NAME
CONFIG_GENERAL_ADVERTISED_NAME;
#else
"openiristracker";
#endif
if (default_hostname.empty())
{
+1 -16
View File
@@ -1,6 +1,5 @@
#include "UVCStream.hpp"
#include <cstdio> // for snprintf
#include <string>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
// no deps on main globals here; handover is performed in main before calling setup when needed
@@ -13,21 +12,7 @@ extern "C"
const char *get_uvc_device_name()
{
// 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();
return deviceConfig->getMDNSConfig().hostname.c_str();
}
const char *get_serial_number(void)