fix(transport): improve BLE / TCP / USB reconnect and handshake resilience (#5196)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
James Rich 2026-04-20 12:34:16 -05:00 committed by GitHub
parent a90cb2d89e
commit f21d8af9ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 124 additions and 46 deletions

View file

@ -60,7 +60,14 @@ class AndroidGetDiscoveredDevicesUseCase(
override fun invoke(showMock: Boolean): Flow<DiscoveredDevices> {
val nodeDb = nodeRepository.nodeDBbyNum
val bondedBleFlow = bluetoothRepository.state.map { ble -> ble.bondedDevices.map { DeviceListEntry.Ble(it) } }
// Filter out non-Meshtastic peripherals (headphones, cars, watches, etc.).
// BluetoothAdapter.bondedDevices returns every bonded device on the phone, so we
// must restrict the picker to entries whose advertised name matches the
// Meshtastic firmware pattern (see MeshtasticBleConstants.BLE_NAME_PATTERN).
val bondedBleFlow =
bluetoothRepository.state.map { ble ->
ble.bondedDevices.filter { it.getMeshtasticShortName() != null }.map { DeviceListEntry.Ble(it) }
}
val processedTcpFlow =
combine(networkRepository.resolvedList, recentAddressesDataSource.recentAddresses) {