From 4efd25d00965efbbf97b46a9bdc1969b91df6a6e Mon Sep 17 00:00:00 2001 From: geeksville Date: Sun, 24 May 2020 09:51:25 -0700 Subject: [PATCH] Possible fix #26. It seems some phones don't quite have the services list populated at the time they say service discovery has completed. Make the nasty 500ms delay a 1000ms delay instead --- .../java/com/geeksville/mesh/service/RadioInterfaceService.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/geeksville/mesh/service/RadioInterfaceService.kt b/app/src/main/java/com/geeksville/mesh/service/RadioInterfaceService.kt index c99cd48c4..2a4b2fee4 100644 --- a/app/src/main/java/com/geeksville/mesh/service/RadioInterfaceService.kt +++ b/app/src/main/java/com/geeksville/mesh/service/RadioInterfaceService.kt @@ -433,7 +433,7 @@ class RadioInterfaceService : Service(), Logging { serviceScope.handledLaunch { try { debug("Discovered services!") - delay(500) // android BLE is buggy and needs a 500ms sleep before calling getChracteristic, or you might get back null + delay(1000) // android BLE is buggy and needs a 500ms sleep before calling getChracteristic, or you might get back null // service could be null, test this by throwing BLEException and testing it on my machine // isOldApi = service.getCharacteristic(BTM_RADIO_CHARACTER) != null