Add BLE mesh logging

Made with Claude AI.
This commit is contained in:
Sybren A. Stüvel 2026-03-14 19:00:00 +01:00
parent aedc00e16a
commit 9f7d644a0c
9 changed files with 217 additions and 18 deletions

View file

@ -2,6 +2,11 @@
#include <Mesh.h>
#include "MyMesh.h"
#include <helpers/BLELogInterface.h>
#if MESH_PACKET_LOGGING && BLE_PACKET_LOGGING && (defined(NRF52_PLATFORM) || defined(ESP32))
static BLELogInterface ble_log;
#endif
#ifdef DISPLAY_CLASS
#include "UITask.h"
@ -72,6 +77,11 @@ void setup() {
the_mesh.begin(fs);
#if MESH_PACKET_LOGGING && BLE_PACKET_LOGGING && (defined(NRF52_PLATFORM) || defined(ESP32))
ble_log.begin(the_mesh.getNodeName());
the_mesh.setPacketLogStream(&ble_log);
#endif
#ifdef DISPLAY_CLASS
ui_task.begin(the_mesh.getNodePrefs(), FIRMWARE_BUILD_DATE, FIRMWARE_VERSION);
#endif
@ -113,4 +123,7 @@ void loop() {
ui_task.loop();
#endif
rtc_clock.tick();
#if MESH_PACKET_LOGGING && BLE_PACKET_LOGGING && defined(ESP32)
ble_log.loop();
#endif
}