[Bluetooth] CSharp TCT Fixes over Latest Tizen branch 34/168734/1 accepted/tizen/unified/20180131.060538 submit/tizen/20180131.012600
authorAbhishek Chandra <abhishek.ch@samsung.com>
Tue, 30 Jan 2018 10:42:10 +0000 (16:12 +0530)
committerAbhishek Chandra <abhishek.ch@samsung.com>
Tue, 30 Jan 2018 10:42:10 +0000 (16:12 +0530)
Change-Id: I27eddaa9e1c117feb9fa4f566e7160dc134f9e10
Signed-off-by: Abhishek Chandra <abhishek.ch@samsung.com>
src/bluetooth-gatt.c

index d29df01ca7ca2b340ed4fad5fface90f01cd4adc..5761e1794d3df29e07193570ab3233b362cedd45 100644 (file)
@@ -119,14 +119,12 @@ static int __get_gatt_handle_by_uuid(GSList *list, const char *uuid,
                for (l = list; l; l = g_slist_next(l)) {
                        bt_gatt_common_s *common = (bt_gatt_common_s *)l->data;
                        bt_get_uuid_name(common->uuid, &name);
-                       BT_INFO("%s %s [%s]", common->path + 38, common->uuid, name);
                        g_free(name);
                }
                return BT_ERROR_NO_DATA;
        }
 
        *gatt_handle = l->data;
-
        return BT_ERROR_NONE;
 }
 
@@ -226,6 +224,7 @@ int _bt_gatt_client_update_services(bt_gatt_client_h client)
 
        if (client_s->services)
                g_slist_free_full(client_s->services, __bt_gatt_free_service);
+
        client_s->services = NULL;
 
        if (prim_svc.count == 0) {
@@ -1840,9 +1839,10 @@ int bt_gatt_service_add_characteristic(bt_gatt_h service,
        svc->characteristics = g_slist_append(svc->characteristics, chr);
        chr->parent = (void *)service;
 #ifdef TIZEN_FEATURE_GATT_RELAY
-       BT_INFO("Current handle count of service [%d]", svc->numhandles);
-
-       svc->numhandles += 2;
+       if (svc) {
+               BT_INFO("Current handle count of service [%d]", svc->numhandles);
+               svc->numhandles += 2;
+       }
 #endif
        return BT_ERROR_NONE;
 }
@@ -1867,9 +1867,10 @@ int bt_gatt_service_add_included_service(bt_gatt_h service,
                                                        included_svc);
        included_svc->parent = (void *)service;
 #ifdef TIZEN_FEATURE_GATT_RELAY
-       BT_INFO("Current handle count of service [%d]", svc->numhandles);
-
-       svc->numhandles = 1; /* Initalize numhandles to 1 */
+       if (svc) {
+               BT_INFO("Current handle count of service [%d]", svc->numhandles);
+               svc->numhandles = 1; /* Initalize numhandles to 1 */
+       }
 #endif
 
        return BT_ERROR_NONE;
@@ -2803,9 +2804,7 @@ int bt_gatt_server_unregister_all_services(bt_gatt_server_h server)
        g_slist_free_full(serv->services, __bt_gatt_free_service);
        serv->services = NULL;
 
-#ifdef TIZEN_FEATURE_GATT_RELAY
-       ret = bluetooth_gatt_server_unregister(instance_id);
-#else
+#ifndef TIZEN_FEATURE_GATT_RELAY
        ret = bluetooth_gatt_unregister_application();
 #endif
        is_gatt_server_started = false;