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
pull/40/head
geeksville 2020-05-24 09:51:25 -07:00
rodzic 774ab65ece
commit 4efd25d009
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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