updated DeviceName handling

This commit is contained in:
2024-05-31 12:49:06 +02:00
parent a22f71649a
commit 52026296f2
6 changed files with 21 additions and 11 deletions

View File

@@ -71,7 +71,7 @@ void initWebUI()
}
// Initialize mDNS and add service
MDNS.begin(globals.DeviceName);
MDNS.begin(globals.DeviceNameId);
MDNS.addService("http", "tcp", 80);
// Set up WebSocket event handler and attach to web server
@@ -342,7 +342,7 @@ void WebServerEEJSON_Callback(AsyncWebServerRequest *request)
char buffer[16];
info["DeviceName"] = globals.DeviceName;
info["DeviceNameId"] = globals.DeviceNameId;
sprintf(buffer, "%d.%02d", constants.Required_Flash_Version_major, constants.Required_Flash_Version_minor);
info["FW-Version"] = buffer;
info["FS-Version"] = globals.FlashVersion;
@@ -653,6 +653,7 @@ void Websocket_RefreshClientData_Static(uint32_t client_id, bool send_mapping)
if (send_mapping)
{
const char mapping[] = "MAPPING_STATIC:"
"devicename;"
"active_faction_on_reboot;"
"batteryType;"
"name_faction1;"
@@ -669,6 +670,7 @@ void Websocket_RefreshClientData_Static(uint32_t client_id, bool send_mapping)
String temp = "STATIC:";
temp.concat(String(globals.DeviceName) + ";");
temp.concat(String(ConfigData.active_faction_on_reboot) + ";");
temp.concat(String(ConfigData.batteryType) + ";");
temp.concat(String(ConfigData.Faction_1_Name) + ";");