mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
autobug - don't fail if the gatt goes away while we are connecting
This commit is contained in:
parent
3246bd6505
commit
68cc494021
1 changed files with 5 additions and 4 deletions
|
|
@ -285,10 +285,11 @@ class BluetoothInterface(val service: RadioInterfaceService, val address: String
|
|||
*/
|
||||
private fun forceServiceRefresh() {
|
||||
exceptionReporter {
|
||||
// BluetoothGatt gatt
|
||||
val gatt = safe!!.gatt!!
|
||||
val refresh: Method = gatt.javaClass.getMethod("refresh")
|
||||
refresh.invoke(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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue