From 16072709d18d3820b6c8ca0579e7c7c383c86b52 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Wed, 6 Jul 2011 18:24:00 -0300 Subject: [PATCH] Try to connect when registering the first callback If the device is disconnected and the first ATT connection callback is registered, the first connection attempt can be triggered instead of waiting the timer. --- src/device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index 571a287e0..d624b4643 100644 --- a/src/device.c +++ b/src/device.c @@ -2571,10 +2571,12 @@ guint btd_device_add_attio_callback(struct btd_device *device, if (device->attrib && cfunc) cfunc(device->attrib, user_data); - if (device->attioid == 0 && device->attrib == NULL) + if (device->attioid == 0 && device->attrib == NULL) { + att_auto_connect(device); device->attioid = g_timeout_add_seconds(AUTOCONNECT_INTERVAL, att_auto_connect, device); + } return attio->id; } -- 2.47.3