kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
stay with old api for now, because too much change hurts reliaiblity ;-)
rodzic
ae72081917
commit
a191dac0f4
|
@ -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) {
|
||||
|
|
|
@ -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() {
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue