some Bugfixes in WebUI and debugger

This commit is contained in:
2024-06-06 20:28:04 +02:00
parent 25f05ed832
commit 2fea8cfdd6
4 changed files with 32 additions and 21 deletions

View File

@@ -12,6 +12,8 @@
*/
#include "debugger.h"
#include "utilities.h"
#include <pgmspace.h>
DebugStatus_t DebuggerStatus[dbg_cntElements];
@@ -117,8 +119,7 @@ const char helpText[][64] PROGMEM = {
"notify_error - Send error notification",
"notify_warning - Send warning notification",
"notify_success - Send success notification",
"notify_info - Send info notification"
};
"notify_info - Send info notification"};
const size_t NUM_HELP_LINES = sizeof(helpText) / sizeof(helpText[0]);
@@ -326,7 +327,7 @@ void Debug_formatPersistence()
*/
void Debug_printSystemInfo()
{
Debug_pushMessage("Hostname: %s\n", globals.DeviceName);
Debug_pushMessage("Hostname: %s\n", globals.DeviceNameId);
FlashMode_t ideMode = ESP.getFlashChipMode();
Debug_pushMessage("Sdk version: %s\n", ESP.getSdkVersion());
@@ -508,10 +509,9 @@ void Debug_printHelp()
char buffer[64];
for (size_t i = 0; i < NUM_HELP_LINES; ++i)
{
strcpy_P(buffer, (PGM_P)pgm_read_word(&(helpText[i])));
// Display the help command
Debug_pushMessage(buffer);
strncpy_P(buffer, helpText[i], sizeof(buffer));
buffer[sizeof(buffer) - 1] = '\0'; // Sicherstellen, dass der String nullterminiert ist
Serial.println(buffer);
}
}

View File

@@ -472,6 +472,18 @@ void Websocket_HandleButtons(uint8_t *data)
{
globals.systemStatus = sysStat_Shutdown;
}
else if (strcmp(identifier, "set-faction1") == 0)
{
PersistenceData.activeFaction = FACTION_1;
}
else if (strcmp(identifier, "set-faction2") == 0)
{
PersistenceData.activeFaction = FACTION_2;
}
else if (strcmp(identifier, "set-faction3") == 0)
{
PersistenceData.activeFaction = FACTION_3;
}
else
{
Debug_pushMessage("Got unknown Button-id '%s' from ws-client\n", identifier);
@@ -660,7 +672,7 @@ void Websocket_RefreshClientData_Static(uint32_t client_id, bool send_mapping)
"wifi-pass;"
"fw-version;"
"flash-version;"
"git-revison;";
"git-revision;";
if (client_id > 0)
webSocket.text(client_id, mapping);