it has been a couple of weeks since new API rolled out, now just

always use it
pull/40/head
geeksville 2020-05-24 08:47:36 -07:00
rodzic 57bfa59476
commit bba9def20e
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -149,9 +149,9 @@ class RadioInterfaceService : Service(), Logging {
private var runningService: RadioInterfaceService? = null
/**
* Temp hack (until old API deprecated), we probe for old API at connected
* Temp hack (until old API deprecated), we now hardwire for the new API, I'll delete the old code in about a week
*/
var isOldApi: Boolean? = null
var isOldApi: Boolean? = false
/// This is public only so that SimRadio can bootstrap our message flow
fun broadcastReceivedFromRadio(context: Context, payload: ByteArray) {
@ -436,7 +436,7 @@ class RadioInterfaceService : Service(), Logging {
delay(500) // 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
// isOldApi = service.getCharacteristic(BTM_RADIO_CHARACTER) != null
warn("Use oldAPI = $isOldApi")
/* if (isFirstTime) {