fixed Bug in Battery-Type-Setting and disabled WiFiClient
This commit is contained in:
@@ -497,7 +497,6 @@ void Websocket_HandleSettings(uint8_t *data)
|
||||
{
|
||||
ConfigData.active_faction_on_reboot = value[0] == '1' ? true : false;
|
||||
}
|
||||
|
||||
else if (strcmp(identifier, "name_faction1") == 0)
|
||||
{
|
||||
strncpy(ConfigData.Faction_1_Name, value, sizeof(ConfigData.Faction_1_Name));
|
||||
@@ -511,10 +510,6 @@ void Websocket_HandleSettings(uint8_t *data)
|
||||
strncpy(ConfigData.Faction_3_Name, value, sizeof(ConfigData.Faction_3_Name));
|
||||
}
|
||||
else if (strcmp(identifier, "batterytype") == 0)
|
||||
{
|
||||
strncpy(ConfigData.wifi_client_ssid, value, sizeof(ConfigData.wifi_client_ssid));
|
||||
}
|
||||
else if (strcmp(identifier, "batterytype") == 0)
|
||||
{
|
||||
int index = findIndexByString(value, BatteryString, BatteryString_Elements);
|
||||
batterytypePreselect = (batteryType_t)index;
|
||||
@@ -660,7 +655,10 @@ void Websocket_RefreshClientData_Static(uint32_t client_id, bool send_mapping)
|
||||
"name_faction2;"
|
||||
"name_faction3;"
|
||||
"wifi-ssid;"
|
||||
"wifi-pass;";
|
||||
"wifi-pass;"
|
||||
"fw-version;"
|
||||
"flash-version;"
|
||||
"git-revison;";
|
||||
|
||||
if (client_id > 0)
|
||||
webSocket.text(client_id, mapping);
|
||||
@@ -668,24 +666,31 @@ void Websocket_RefreshClientData_Static(uint32_t client_id, bool send_mapping)
|
||||
webSocket.textAll(mapping);
|
||||
}
|
||||
|
||||
String temp = "STATIC:";
|
||||
char dataString[200]; // Maximal 200 Zeichen für den Data-String
|
||||
char flash_version[6];
|
||||
GetFlashVersion(flash_version, sizeof(flash_version));
|
||||
|
||||
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) + ";");
|
||||
temp.concat(String(ConfigData.Faction_2_Name) + ";");
|
||||
temp.concat(String(ConfigData.Faction_3_Name) + ";");
|
||||
temp.concat(String(ConfigData.wifi_client_ssid) + ";");
|
||||
temp.concat(String(ConfigData.wifi_client_password) + ";");
|
||||
sprintf(dataString, "STATIC:%s;%d;%d;%s;%s;%s;%s;%s;%d.%02d;%s;%s;",
|
||||
globals.DeviceName,
|
||||
ConfigData.active_faction_on_reboot,
|
||||
ConfigData.batteryType,
|
||||
ConfigData.Faction_1_Name,
|
||||
ConfigData.Faction_2_Name,
|
||||
ConfigData.Faction_3_Name,
|
||||
ConfigData.wifi_client_ssid,
|
||||
ConfigData.wifi_client_password,
|
||||
constants.FW_Version_major,
|
||||
constants.FW_Version_minor,
|
||||
flash_version,
|
||||
constants.GitHash);
|
||||
|
||||
if (client_id > 0)
|
||||
{
|
||||
webSocket.text(client_id, temp);
|
||||
webSocket.text(client_id, dataString);
|
||||
}
|
||||
else
|
||||
{
|
||||
webSocket.textAll(temp);
|
||||
webSocket.textAll(dataString);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user