mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix autobug if old work items run after gatt is destroyed
This commit is contained in:
parent
89258646b0
commit
73de2c33c2
1 changed files with 3 additions and 3 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue