stay with old api for now, because too much change hurts reliaiblity ;-)

pull/40/head
geeksville 2020-05-24 10:12:12 -07:00
rodzic ae72081917
commit a191dac0f4
2 zmienionych plików z 5 dodań i 4 usunięć

Wyświetl plik

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

Wyświetl plik

@ -152,7 +152,7 @@ class SafeBluetooth(private val context: Context, private val device: BluetoothD
// Our own custom BLE status codes
private val STATUS_RELIABLE_WRITE_FAILED = 4403
private val STATUS_TIMEOUT = 4403
private val STATUS_TIMEOUT = 4404
private val gattCallback = object : BluetoothGattCallback() {