mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Refactor navigation to use NodeDetail route and fix radio settings (#4960)
This commit is contained in:
parent
c75c9b34d6
commit
6a5115b897
7 changed files with 19 additions and 28 deletions
|
|
@ -445,18 +445,6 @@ class BleRadioInterface(
|
|||
// onDisconnect is handled by SharedRadioInterfaceService.stopInterfaceLocked() directly.
|
||||
serviceScope.launch {
|
||||
withContext(NonCancellable) {
|
||||
// Send ToRadio.disconnect before dropping the BLE link. The firmware calls its
|
||||
// own close() immediately on receipt, resetting the PhoneAPI state machine
|
||||
// (config nonce, packet queue, observers) without waiting for the 6-second BLE
|
||||
// supervision timeout. Best-effort: if the write fails we still disconnect below.
|
||||
val currentService = radioService
|
||||
if (currentService != null) {
|
||||
try {
|
||||
withTimeoutOrNull(2_000L) { currentService.sendToRadio(ToRadio(disconnect = true).encode()) }
|
||||
} catch (@Suppress("TooGenericExceptionCaught") e: Exception) {
|
||||
Logger.w(e) { "[$address] Failed to send disconnect signal" }
|
||||
}
|
||||
}
|
||||
try {
|
||||
bleConnection.disconnect()
|
||||
} catch (@Suppress("TooGenericExceptionCaught") e: Exception) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue