GattConnected signal emitted after all the services are ready 10/68710/1 accepted/tizen/common/20160510.051011 accepted/tizen/ivi/20160510.002752 accepted/tizen/mobile/20160510.002749 accepted/tizen/tv/20160510.002745 accepted/tizen/wearable/20160510.002739 submit/tizen/20160509.112434
authorHyuk Lee <hyuk0512.lee@samsung.com>
Mon, 9 May 2016 11:12:21 +0000 (20:12 +0900)
committerHyuk Lee <hyuk0512.lee@samsung.com>
Mon, 9 May 2016 11:12:21 +0000 (20:12 +0900)
Change-Id: I26b93373c5b39e8a06997e8f9624fd1418929634
Signed-off-by: Hyuk Lee <hyuk0512.lee@samsung.com>
src/gatt-client.c

index 8c1e145..38435ec 100644 (file)
@@ -2194,6 +2194,10 @@ void btd_gatt_client_ready(struct btd_gatt_client *client)
        client->ready = true;
 
        DBG("GATT client ready");
+#ifdef __TIZEN_PATCH__
+       if (queue_isempty(client->services)) {
+               DBG("Exporting services");
+#endif
 
        create_services(client);
 #ifdef __TIZEN_PATCH__
@@ -2209,7 +2213,17 @@ void btd_gatt_client_ready(struct btd_gatt_client *client)
 
        client->wait_charcs_id = g_timeout_add(100,
                        check_all_chrcs_ready, client);
+       return;
+       }
+
+       /*
+        * Services have already been created before. Re-enable notifications
+        * for any pre-registered notification sessions.
+        */
+       queue_foreach(client->all_notify_clients, register_notify, client);
+       device_set_gatt_connected(client->device, TRUE);
 #endif
+
 }
 
 void btd_gatt_client_connected(struct btd_gatt_client *client)