summaryrefslogtreecommitdiff
path: root/src/device.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2021-08-25 14:03:50 -0700
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2021-08-25 15:10:42 -0700
commitcb85f71b0dfd508947d3756626cd1d44add38884 (patch)
tree425d7068f20354f0aa6021bb93074a2831005793 /src/device.c
parente6f2ce8a05a76538cadc8e7477f400fce03d095a (diff)
downloadbluez-cb85f71b0dfd508947d3756626cd1d44add38884.tar.gz
gatt: Do not always attempt to connect EATT immediately
Wait the bt_gatt_client becomes ready (has performed service discovery) before attempting to connect EATT when acting as peripheral/acceptor since the central/initiator might actually attempt to connect EATT channels in the same way which can potentially cause a collisions.
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c
index 998485be7..40fd826ba 100644
--- a/src/device.c
+++ b/src/device.c
@@ -5304,6 +5304,13 @@ static void gatt_client_init(struct btd_device *device)
}
btd_gatt_client_connected(device->client_dbus);
+
+ /* Only initiate EATT connection when acting as initiator, as acceptor
+ * it shall be triggered only when ready to avoid possible clashes where
+ * both sides attempt to connection at same time.
+ */
+ if (device->connect)
+ btd_gatt_client_eatt_connect(device->client_dbus);
}
static void gatt_server_init(struct btd_device *device,