summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@gmail.com>2009-10-02 10:16:01 +0200
committerLuiz Augusto von Dentz <luiz.dentz@gmail.com>2009-10-02 16:48:30 +0200
commit5e9a226c6f6149e0116f1d5e4e287ed084bfd886 (patch)
tree10631557af5c7d614b63417e3d2b786b1ede0f31
parent698d7a0f39db8ee1f7af3186a70ce1bea32a068c (diff)
Fix updating out of range list when rssi haven't change.
Device should be removed from the out of range list as soon as it is found, even if the rssi haven't changed and DeviceFound won't be emitted, otherwise we may emit DeviceDisappeared for a device that is actually in range.
-rw-r--r--src/adapter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/adapter.c b/src/adapter.c
index 70d31e86d..a45962f1e 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2662,13 +2662,13 @@ void adapter_update_found_devices(struct btd_adapter *adapter, bdaddr_t *bdaddr,
dev = adapter_search_found_devices(adapter, &match);
if (dev) {
- if (rssi == dev->rssi)
- return;
-
/* Out of range list update */
adapter->oor_devices = g_slist_remove(adapter->oor_devices,
dev);
+ if (rssi == dev->rssi)
+ return;
+
goto done;
}