From 2d518420aa351659249de8cfeeaa259cbed76d33 Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Wed, 16 Sep 2026 09:27:15 -0500 Subject: [PATCH] Brace the nRF52 CCCD callback so it compiles everSubscribed was updated outside the if that declares the pointer, which is out of scope there, so 783e3a497 broke the rak4631_blemesh build and every nRF52 mesh env with it. The ESP32 copy in that same commit braces both statements; this is the nRF52 half catching up. rak4631_blemesh builds again: flash 92.2%, RAM 41.1%. --- src/platform/nrf52/NRF52BLEGattMesh.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/platform/nrf52/NRF52BLEGattMesh.cpp b/src/platform/nrf52/NRF52BLEGattMesh.cpp index f14a413a26..e5d26012d4 100644 --- a/src/platform/nrf52/NRF52BLEGattMesh.cpp +++ b/src/platform/nrf52/NRF52BLEGattMesh.cpp @@ -117,9 +117,10 @@ void onCccd(uint16_t conn, BLECharacteristic *, uint16_t value) const bool subscribed = (value & 0x0001) != 0; { concurrency::LockGuard guard(&lock); - if (Link *l = addLink(conn)) + if (Link *l = addLink(conn)) { l->subscribed = subscribed; - l->everSubscribed |= subscribed; + l->everSubscribed |= subscribed; + } } LOG_INFO("BLE GATT mesh: conn %u %s (chunk %u)", conn, subscribed ? "subscribed" : "unsubscribed", chunkFor(conn)); if (bleGattMeshHandler)