mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-30 03:33:50 -04:00
fix autobug if old work items run after gatt is destroyed
This commit is contained in:
@@ -608,7 +608,7 @@ class SafeBluetooth(private val context: Context, private val device: BluetoothD
|
||||
cont: Continuation<Unit>
|
||||
) = queueWork("reqMtu", cont, 5 * 1000) {
|
||||
isSettingMtu = true
|
||||
gatt!!.requestMtu(len)
|
||||
gatt?.requestMtu(len) ?: false
|
||||
}
|
||||
|
||||
fun asyncRequestMtu(
|
||||
@@ -629,7 +629,7 @@ class SafeBluetooth(private val context: Context, private val device: BluetoothD
|
||||
) = queueWork("writeC ${c.uuid}", cont) {
|
||||
currentReliableWrite = null
|
||||
c.value = v
|
||||
gatt!!.writeCharacteristic(c)
|
||||
gatt?.writeCharacteristic(c) ?: false
|
||||
}
|
||||
|
||||
fun asyncWriteCharacteristic(
|
||||
@@ -653,7 +653,7 @@ class SafeBluetooth(private val context: Context, private val device: BluetoothD
|
||||
) = queueWork("rwriteC ${c.uuid}", cont) {
|
||||
logAssert(gatt!!.beginReliableWrite())
|
||||
currentReliableWrite = c.value.clone()
|
||||
gatt!!.writeCharacteristic(c)
|
||||
gatt?.writeCharacteristic(c) ?: false
|
||||
}
|
||||
|
||||
/* fun asyncWriteReliable(
|
||||
|
||||
Reference in New Issue
Block a user