Modify the GattConnected signal emit sequence 89/68889/1
authorHyuk Lee <hyuk0512.lee@samsung.com>
Tue, 10 May 2016 07:59:02 +0000 (16:59 +0900)
committerHyuk Lee <hyuk0512.lee@samsung.com>
Tue, 10 May 2016 07:59:02 +0000 (16:59 +0900)
Change-Id: I275000a51c92aebfed484019238d7666e961312b
Signed-off-by: Hyuk Lee <hyuk0512.lee@samsung.com>
src/device.c
src/gatt-client.c

index 06f582d..b5b9bc2 100644 (file)
@@ -6454,10 +6454,6 @@ static void gatt_client_init(struct btd_device *device)
                gatt_client_cleanup(device);
                return;
        }
-
-       device->gatt_cache_used = !gatt_db_isempty(device->db);
-
-       btd_gatt_client_connected(device->client_dbus);
 }
 
 static void gatt_server_init(struct btd_device *device, struct gatt_db *db)
index 38435ec..71b4c2d 100644 (file)
@@ -2183,14 +2183,19 @@ static gboolean check_all_chrcs_ready(gpointer user_data)
 
 void btd_gatt_client_ready(struct btd_gatt_client *client)
 {
+       struct bt_gatt_client *gatt;
+
        if (!client)
                return;
 
-       if (!client->gatt) {
+       gatt = btd_device_get_gatt_client(client->device);
+       if (!gatt) {
                error("GATT client not initialized");
                return;
        }
 
+       bt_gatt_client_unref(client->gatt);
+       client->gatt = bt_gatt_client_ref(gatt);
        client->ready = true;
 
        DBG("GATT client ready");