Fixed removal of LE devices on stopping LE scan 34/173034/1
authorAtul Rai <a.rai@samsung.com>
Wed, 14 Mar 2018 11:50:29 +0000 (17:20 +0530)
committerAtul Rai <a.rai@samsung.com>
Mon, 19 Mar 2018 08:35:45 +0000 (14:05 +0530)
Issue: LE connect fail with error "Device path not found".

Cause: Device flags are incorrectly updated to 0 on receiving
scan_response data. Later on stopping LE scan, the LE device
is considered non-connectable based on device flag which was
incorrectly updated to 0 during scan_response event and the
device is removed immediately. This causes LE connect to fail
with error "device path not found".

Solution: This patch fixes the issue by checking adv pkt type
before updating the device flag on device found event.

Change-Id: Id86b024dfc6c980780aef6cdda8e6dcc6b150b80
Signed-off-by: Atul Rai <a.rai@samsung.com>
src/adapter.c

index 4511a32..7382247 100644 (file)
@@ -10379,8 +10379,13 @@ static void update_found_devices(struct btd_adapter *adapter,
        if (eir_data.sd_list)
                device_set_service_data(dev, eir_data.sd_list, duplicate);
 
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+       if (bdaddr_type != BDADDR_BREDR && adv_type != ADV_TYPE_SCAN_RESPONSE)
+               device_set_flags(dev, eir_data.flags);
+#else
        if (bdaddr_type != BDADDR_BREDR)
                device_set_flags(dev, eir_data.flags);
+#endif
 
        eir_data_free(&eir_data);