Add print log functionality and device name handling

- Introduced functions to capture and manage incoming print logs.
- Added a download link for the incoming print log in the web interface.
- Updated device name prefix for BLE and added device name building logic.
- Enhanced SerialCommand class with line handler support.
- Implemented WiFi reconnect logic and status tracking.
This commit is contained in:
2026-02-28 22:36:12 +01:00
parent 3580e32142
commit 83a55fcc47
9 changed files with 216 additions and 20 deletions

View File

@@ -6,7 +6,7 @@
namespace
{
constexpr char kBleDeviceNamePrefix[] = "EggDuino_";
constexpr char kBleDeviceNamePrefix[] = "EggBot_";
constexpr char kBleServiceUuid[] = "6e400001-b5a3-f393-e0a9-e50e24dcca9e";
constexpr char kBleRxCharUuid[] = "6e400002-b5a3-f393-e0a9-e50e24dcca9e";
constexpr char kBleTxCharUuid[] = "6e400003-b5a3-f393-e0a9-e50e24dcca9e";
@@ -30,18 +30,6 @@ void logBleDiag(const String &message)
Log(message);
}
void buildBleDeviceName(char *nameBuffer, size_t bufferSize)
{
if ((nameBuffer == NULL) || (bufferSize == 0))
{
return;
}
// Tasmota-style chip ID uses the lower 24 bits of the ESP32 efuse MAC.
const uint32_t chipId = static_cast<uint32_t>(ESP.getEfuseMac() & 0xFFFFFFULL);
snprintf(nameBuffer, bufferSize, "%s%06X", kBleDeviceNamePrefix, chipId);
}
bool queueBleByte(uint8_t value)
{
bool queued = false;
@@ -112,7 +100,7 @@ class EggDuinoBleRxCallbacks : public NimBLECharacteristicCallbacks
void startBleInterface()
{
char bleDeviceName[32] = {0};
buildBleDeviceName(bleDeviceName, sizeof(bleDeviceName));
buildDeviceName(bleDeviceName, sizeof(bleDeviceName));
if (bleDeviceName[0] == '\0')
{
snprintf(bleDeviceName, sizeof(bleDeviceName), "%sUNKNOWN", kBleDeviceNamePrefix);