From e087e9693edb72f2cec8144bd5e83080515b8bc8 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 12 Sep 2016 16:23:52 +0300 Subject: [PATCH] core/device: Load stored attributes before initializing GATT client During gatt_client_init service are requested to accept the connection which may leads the driver to check existence of attributes. --- src/device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/device.c b/src/device.c index fd928fc40..73bcc8fc1 100644 --- a/src/device.c +++ b/src/device.c @@ -4823,12 +4823,12 @@ bool device_attach_att(struct btd_device *dev, GIOChannel *io) dst = device_get_address(dev); ba2str(dst, dstaddr); - gatt_client_init(dev); - gatt_server_init(dev, btd_gatt_database_get_db(database)); - if (gatt_db_isempty(dev->db)) load_gatt_db(dev, srcaddr, dstaddr); + gatt_client_init(dev); + gatt_server_init(dev, btd_gatt_database_get_db(database)); + /* * Remove the device from the connect_list and give the passive * scanning another chance to be restarted in case there are -- 2.47.3