added Debug-CLI on WebUI
This commit is contained in:
@@ -424,6 +424,10 @@ void Websocket_HandleMessage(void *arg, uint8_t *data, size_t len)
|
||||
{
|
||||
Websocket_HandleSettings(data + strlen("set-"));
|
||||
}
|
||||
else if (strncmp((char *)data, "debug", strlen("debug")) == 0)
|
||||
{
|
||||
Debug_ProcessCommand(data - strlen("debug"));
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug_pushMessage("Got unknown Websocket-Message '%s' from client\n", (char *)data);
|
||||
@@ -604,44 +608,43 @@ void Websocket_RefreshClientData_DTCs(uint32_t client_id)
|
||||
*/
|
||||
void Websocket_RefreshClientData_Status(uint32_t client_id, bool send_mapping)
|
||||
{
|
||||
if (send_mapping)
|
||||
{
|
||||
const char mapping[] = "MAPPING_STATUS:"
|
||||
"batterylevel;"
|
||||
"systemstatus;"
|
||||
"activefaction;"
|
||||
"time_faction1;"
|
||||
"time_faction2;"
|
||||
"time_faction3;";
|
||||
|
||||
if (client_id > 0)
|
||||
webSocket.text(client_id, mapping);
|
||||
else
|
||||
webSocket.textAll(mapping);
|
||||
|
||||
Debug_pushMessage("send MAPPING_STATUS WS-Client Data\n");
|
||||
}
|
||||
|
||||
char dataString[200] = {0}; // Maximal 200 Zeichen für den Data-String
|
||||
|
||||
sprintf(dataString, "STATUS:%d;%s;%d;%ld;%ld;%ld;",
|
||||
globals.battery_level,
|
||||
globals.systemStatustxt,
|
||||
PersistenceData.activeFaction,
|
||||
PersistenceData.faction_1_timer,
|
||||
PersistenceData.faction_2_timer,
|
||||
PersistenceData.faction_3_timer);
|
||||
if (send_mapping)
|
||||
{
|
||||
const char mapping[] = "MAPPING_STATUS:"
|
||||
"batterylevel;"
|
||||
"systemstatus;"
|
||||
"activefaction;"
|
||||
"time_faction1;"
|
||||
"time_faction2;"
|
||||
"time_faction3;";
|
||||
|
||||
if (client_id > 0)
|
||||
{
|
||||
webSocket.text(client_id, dataString);
|
||||
}
|
||||
webSocket.text(client_id, mapping);
|
||||
else
|
||||
{
|
||||
webSocket.textAll(dataString);
|
||||
}
|
||||
}
|
||||
webSocket.textAll(mapping);
|
||||
|
||||
Debug_pushMessage("send MAPPING_STATUS WS-Client Data\n");
|
||||
}
|
||||
|
||||
char dataString[200] = {0}; // Maximal 200 Zeichen für den Data-String
|
||||
|
||||
sprintf(dataString, "STATUS:%d;%s;%d;%ld;%ld;%ld;",
|
||||
globals.battery_level,
|
||||
globals.systemStatustxt,
|
||||
PersistenceData.activeFaction,
|
||||
PersistenceData.faction_1_timer,
|
||||
PersistenceData.faction_2_timer,
|
||||
PersistenceData.faction_3_timer);
|
||||
|
||||
if (client_id > 0)
|
||||
{
|
||||
webSocket.text(client_id, dataString);
|
||||
}
|
||||
else
|
||||
{
|
||||
webSocket.textAll(dataString);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Refreshes client data related to static configuration parameters on WebSocket clients.
|
||||
|
Reference in New Issue
Block a user