mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
update ble scan GUI if bond state changes
This commit is contained in:
parent
81a1283148
commit
f1681582ed
1 changed files with 4 additions and 2 deletions
|
|
@ -89,11 +89,13 @@ fun BTScanScreen() {
|
|||
|
||||
val addr = result.device.address
|
||||
// prevent logspam because weill get get lots of redundant scan results
|
||||
if (!ScanUIState.devices.contains(addr)) {
|
||||
val isBonded = result.device.bondState == BluetoothDevice.BOND_BONDED
|
||||
val oldEntry = ScanUIState.devices[addr]
|
||||
if (oldEntry == null || oldEntry.bonded != isBonded) {
|
||||
val entry = BTScanEntry(
|
||||
result.device.name,
|
||||
addr,
|
||||
result.device.bondState == BluetoothDevice.BOND_BONDED
|
||||
isBonded
|
||||
)
|
||||
ScanState.debug("onScanResult ${entry}")
|
||||
ScanUIState.devices[addr] = entry
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue