From f15e6994d03c784785ef4a52e4c1d8c24f29d590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Sun, 15 Mar 2026 18:30:46 +0100 Subject: [PATCH] Self-review fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three fixes applied: BLELogInterface.h:108 — setMinPreferred(0x12) → setMaxPreferred(0x12) (bug: was clobbering the min value instead of setting max) BLELogInterface.h:42 — removed the redundant _line_len = 0 in flushLine(), collapsed the guard to a one-liner heltec_tracker/platformio.ini and sensecap_solar/platformio.ini — re-commented MESH_PACKET_LOGGING and BLE_PACKET_LOGGING --- src/helpers/esp32/BLELogInterface.h | 7 ++----- variants/heltec_tracker/platformio.ini | 4 ++-- variants/sensecap_solar/platformio.ini | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/helpers/esp32/BLELogInterface.h b/src/helpers/esp32/BLELogInterface.h index 448e5a71..8196bb4b 100644 --- a/src/helpers/esp32/BLELogInterface.h +++ b/src/helpers/esp32/BLELogInterface.h @@ -39,10 +39,7 @@ class BLELogInterface : public Print, BLEServerCallbacks { } void flushLine() { - if (_line_len == 0 || !_connected) { - _line_len = 0; - return; - } + if (_line_len == 0 || !_connected) return; const int chunk = notifyPayloadSize(); int offset = 0; while (offset < _line_len) { @@ -105,7 +102,7 @@ public: adv->addServiceUUID(NUS_SERVICE_UUID); adv->setScanResponse(true); adv->setMinPreferred(0x06); // helps iOS find and stay connected to the device - adv->setMinPreferred(0x12); + adv->setMaxPreferred(0x12); BLEDevice::startAdvertising(); } diff --git a/variants/heltec_tracker/platformio.ini b/variants/heltec_tracker/platformio.ini index a85a5b82..a57f049a 100644 --- a/variants/heltec_tracker/platformio.ini +++ b/variants/heltec_tracker/platformio.ini @@ -177,8 +177,8 @@ build_flags = -D ADVERT_LON=0.0 -D ADMIN_PASSWORD='"password"' -D ROOM_PASSWORD='"hello"' - -D MESH_PACKET_LOGGING=1 - -D BLE_PACKET_LOGGING=1 +; -D MESH_PACKET_LOGGING=1 +; -D BLE_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 build_src_filter = ${Heltec_tracker_base.build_src_filter} + diff --git a/variants/sensecap_solar/platformio.ini b/variants/sensecap_solar/platformio.ini index c452a717..c191795c 100644 --- a/variants/sensecap_solar/platformio.ini +++ b/variants/sensecap_solar/platformio.ini @@ -45,8 +45,8 @@ build_flags = -D ADVERT_LON=0.0 -D ADMIN_PASSWORD='"password"' -D MAX_NEIGHBOURS=50 - -D MESH_PACKET_LOGGING=1 - -D BLE_PACKET_LOGGING=1 +; -D MESH_PACKET_LOGGING=1 +; -D BLE_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 build_src_filter = ${SenseCap_Solar.build_src_filter} +<../examples/simple_repeater/*.cpp>