Notification was faling as Gatt serv info was NULL 71/186671/1
authorAbhishek Chandra <abhishek.ch@samsung.com>
Mon, 13 Aug 2018 09:06:49 +0000 (14:36 +0530)
committerAbhishek Chandra <abhishek.ch@samsung.com>
Mon, 13 Aug 2018 09:06:49 +0000 (14:36 +0530)
String pointer were compaired for the path in
__bt_gatt_get_service_state , which was causing the
API to return NULL.

Fix : string compairition for service path is used.

Change-Id: I5ec7d768f9a63780cbc18ef1f8b00c31542c3adc
Signed-off-by: Abhishek Chandra <abhishek.ch@samsung.com>
bt-oal/bluez_hal/src/bt-hal-gatt-server.c

index fa29c69..b95d6a4 100644 (file)
@@ -2638,11 +2638,12 @@ static gboolean __bt_gatt_get_service_state(const char *service_path)
 {
        struct gatt_service_info *svc_info = NULL;
        GSList *l = NULL;
-
        for (l = gatt_services; l; l = g_slist_next(l)) {
 
                svc_info = (struct gatt_service_info *)l->data;
-               if (svc_info->serv_path == service_path) {
+
+
+               if (!g_strcmp0(svc_info->serv_path, service_path)) {
                        DBG("Return the state of the gatt service %d",
                                        svc_info->is_svc_registered);
                        return svc_info->is_svc_registered;