Refactor navigation to use NodeDetail route and fix radio settings (#4960)

This commit is contained in:
James Rich 2026-03-31 09:03:02 -05:00 committed by GitHub
parent c75c9b34d6
commit 6a5115b897
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 19 additions and 28 deletions

View file

@ -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) {