* LE auto connect
@ 2013-01-28 12:09 Damjan Cvetko
2013-01-28 18:23 ` Johan Hedberg
0 siblings, 1 reply; 3+ messages in thread
From: Damjan Cvetko @ 2013-01-28 12:09 UTC (permalink / raw)
To: linux-bluetooth@vger.kernel.org
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);
+ }
+ }
}
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: LE auto connect
2013-01-28 12:09 LE auto connect Damjan Cvetko
@ 2013-01-28 18:23 ` Johan Hedberg
2013-01-28 21:43 ` Damjan Cvetko
0 siblings, 1 reply; 3+ messages in thread
From: Johan Hedberg @ 2013-01-28 18:23 UTC (permalink / raw)
To: Damjan Cvetko; +Cc: linux-bluetooth@vger.kernel.org
Hi Damjan,
On Mon, Jan 28, 2013, Damjan Cvetko wrote:
> 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.
Thanks. I pushed a cleaned up version of the adapter.c changes since
that needs to be in a separate patch anyway. Could you create a proper
git patch (git format-patch & git send-email) from the first part of the
patch and resend it?
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: LE auto connect
2013-01-28 18:23 ` Johan Hedberg
@ 2013-01-28 21:43 ` Damjan Cvetko
0 siblings, 0 replies; 3+ messages in thread
From: Damjan Cvetko @ 2013-01-28 21:43 UTC (permalink / raw)
To: Johan Hedberg; +Cc: linux-bluetooth@vger.kernel.org
Hey Johan.
> Thanks. I pushed a cleaned up version of the adapter.c changes since that needs to be in a separate patch anyway. Could you create a proper git patch (git format-patch & git send-email) from the first part of the patch and resend it?
Sent a patch to the list, hope it's ok now.
BR.
Damjan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-01-28 21:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-28 12:09 LE auto connect Damjan Cvetko
2013-01-28 18:23 ` Johan Hedberg
2013-01-28 21:43 ` Damjan Cvetko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).