kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
Fix #67, see that issue for writeup. gatt needs to be @Volatile
rodzic
2780a08931
commit
1fd80c06d8
|
@ -322,7 +322,8 @@ class BluetoothInterface(val service: RadioInterfaceService, val address: String
|
||||||
val s = safe
|
val s = safe
|
||||||
if (s != null) {
|
if (s != null) {
|
||||||
warn("Forcing disconnect and hopefully device will comeback (disabling forced refresh)")
|
warn("Forcing disconnect and hopefully device will comeback (disabling forced refresh)")
|
||||||
hasForcedRefresh = true
|
hasForcedRefresh =
|
||||||
|
true // We've already tossed any old service caches, no need to do it again
|
||||||
ignoreException {
|
ignoreException {
|
||||||
s.closeConnection()
|
s.closeConnection()
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@ class SafeBluetooth(private val context: Context, private val device: BluetoothD
|
||||||
var timeoutMsec = 15 * 1000L
|
var timeoutMsec = 15 * 1000L
|
||||||
|
|
||||||
/// Users can access the GATT directly as needed
|
/// Users can access the GATT directly as needed
|
||||||
|
@Volatile
|
||||||
var gatt: BluetoothGatt? = null
|
var gatt: BluetoothGatt? = null
|
||||||
|
|
||||||
@Volatile
|
@Volatile
|
||||||
|
|
Ładowanie…
Reference in New Issue