LE auto connect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I checked out latest code, and found that LE auto connection does not work at all. Dug a bit in the code to see there is no relevant implementation (related to connect_list).
Here a few lines that make it work.

Best
Damjan

diff --git a/profiles/heartrate/heartrate.c b/profiles/heartrate/heartrate.c
index 5c56d3f..1788d4f 100644
--- a/profiles/heartrate/heartrate.c
+++ b/profiles/heartrate/heartrate.c
@@ -801,6 +801,8 @@ static int heartrate_device_register(struct btd_device *device,
        hr->attioid = btd_device_add_attio_callback(device, attio_connected_cb,
                                                attio_disconnected_cb, hr);

+       device_set_auto_connect(device, TRUE);
+
        return 0;
}

diff --git a/src/adapter.c b/src/adapter.c
index 43a9a3a..20667c8 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -4071,6 +4071,12 @@ static void update_found_devices(struct btd_adapter *adapter,

done:
        if (device_is_le(dev) && g_slist_find(adapter->connect_list, dev)) {
+               if (!device_is_connected(dev)) {
+                       err = device_connect_le(dev);
+                       if (err < 0) {
+                               DBG("LE auto connection failed %s (%d)", strerror(-err), -err);
+                       }
+               }
        }
}

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux