From 203dc456ab846aed01f72a45b4eef2c61c96ace3 Mon Sep 17 00:00:00 2001 From: geeksville Date: Fri, 17 Jul 2020 11:55:36 -0700 Subject: [PATCH] NRF52 based devices don't need our forceRefresh BLE hack --- .../java/com/geeksville/mesh/service/BluetoothInterface.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/service/BluetoothInterface.kt b/app/src/main/java/com/geeksville/mesh/service/BluetoothInterface.kt index 06e86969b..b78f42af0 100644 --- a/app/src/main/java/com/geeksville/mesh/service/BluetoothInterface.kt +++ b/app/src/main/java/com/geeksville/mesh/service/BluetoothInterface.kt @@ -191,6 +191,10 @@ class BluetoothInterface(val service: RadioInterfaceService, val address: String */ private var isFirstSend = true + // NRF52 targets do not need the nasty force refresh hack that ESP32 needs (because they keep their + // BLE handles stable. So turn the hack off for these devices. FIXME - find a better way to know that the board is NRF52 based + private var needForceRefresh = !address.startsWith("FD:10:04") + init { // Note: this call does no comms, it just creates the device object (even if the // device is off/not connected) @@ -400,8 +404,6 @@ class BluetoothInterface(val service: RadioInterfaceService, val address: String } } - private var needForceRefresh = true - private fun onConnect(connRes: Result) { // This callback is invoked after we are connected