From 4e969c04328f22f0ffb01fd47cf98e196d34d068 Mon Sep 17 00:00:00 2001 From: phaseloop Date: Tue, 16 Dec 2025 13:30:06 +0000 Subject: [PATCH] add BLE issue comment --- src/platform/nrf52/NRF52Bluetooth.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/platform/nrf52/NRF52Bluetooth.cpp b/src/platform/nrf52/NRF52Bluetooth.cpp index 2511d10fb..541e3b303 100644 --- a/src/platform/nrf52/NRF52Bluetooth.cpp +++ b/src/platform/nrf52/NRF52Bluetooth.cpp @@ -274,6 +274,24 @@ void NRF52Bluetooth::setup() Bluefruit.Periph.setDisconnectCallback(onDisconnect); + // Do not change Slave Latency to value other than 0 !!! + // There is probably a bug in SoftDevice + certain Apple iOS versions being + // brain damaged causing connectivity problems. + + // On one side it seems SoftDevice is using SlaveLatency value even + // if connection parameter negotation failed and phone sees it as connectivity errors. + + // On the other hand Apple can randomly refuse any parameter negotiation and shutdown connection + // even if you meet Apple Developer Guidelines for BLE devices. Because f* you, that's why. + + // While this API call sets preferred connection parameters (PPCP) - many phones ignore it (yeah) and it seems SoftDevice + // will try to renegotiate connection parameters based on those values after phone connection. + // So those are relatively safe values so Apple braindead firmware won't get angry and at least we may try + // to negotiate some longer connection interval to save battery. + + // See https://github.com/meshtastic/firmware/pull/8858 for measurements. We are dealing with microamp savings anyway so not worth + // dying on a hill here. + Bluefruit.Periph.setConnSlaveLatency(0); // 1.25 ms units - so min, max is 15, 100 ms range. Bluefruit.Periph.setConnInterval(12, 80);