aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2012-05-15 16:41:25 -0300
committerJoão Paulo Rechi Vita <jprvita@openbossa.org>2012-06-21 18:00:18 -0300
commit66c23ab8cfc5a0989416691f450d0151d0f1695c (patch)
tree0d917ded0bbe21e3a9ef7cdad40fc5e876aac289
parent2e561d0ad2a2c69b86f3fb2d98a4f1d35a2e2163 (diff)
downloadbluez-66c23ab8cfc5a0989416691f450d0151d0f1695c.tar.gz
bluez-66c23ab8cfc5a0989416691f450d0151d0f1695c.tar.xz
bluez-66c23ab8cfc5a0989416691f450d0151d0f1695c.zip
core: Re-connect if error number is ECONNRESET
For remote initiated disconnection, the automatic connection mechanism should stay active. Use case: The HID over GATT Device may perform the GAP Terminate Connection procedure if the connection is idle for a time period, which is implementation specific.
-rw-r--r--src/device.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/device.c b/src/device.c
index 8bf59276..967685dd 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1822,7 +1822,10 @@ static gboolean attrib_disconnected_cb(GIOChannel *io, GIOCondition cond,
g_slist_foreach(device->attios, attio_disconnected, NULL);
- if (device->auto_connect == FALSE || err != ETIMEDOUT)
+ if (device->auto_connect == FALSE)
+ goto done;
+
+ if (err != ETIMEDOUT && err != ECONNRESET)
goto done;
device->auto_id = g_timeout_add_seconds_full(G_PRIORITY_DEFAULT_IDLE,