kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
autobug - don't fail if the gatt goes away while we are connecting
rodzic
3246bd6505
commit
68cc494021
|
@ -285,12 +285,13 @@ class BluetoothInterface(val service: RadioInterfaceService, val address: String
|
|||
*/
|
||||
private fun forceServiceRefresh() {
|
||||
exceptionReporter {
|
||||
// BluetoothGatt gatt
|
||||
val gatt = safe!!.gatt!!
|
||||
// If the gatt has been destroyed, skip the refresh attempt
|
||||
safe?.gatt?.let { gatt ->
|
||||
val refresh: Method = gatt.javaClass.getMethod("refresh")
|
||||
refresh.invoke(gatt)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// We only force service refresh the _first_ time we connect to the device. Thereafter it is assumed the firmware didn't change
|
||||
private var hasForcedRefresh = false
|
||||
|
|
Ładowanie…
Reference in New Issue