Add GATT Service handlers to GATT handle list 48/248948/2
authorAyush Garg <ayush.garg@samsung.com>
Thu, 3 Dec 2020 11:16:44 +0000 (16:46 +0530)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 7 Dec 2020 03:38:45 +0000 (09:08 +0530)
At present, The validation check logic for GATT service handler is
returning error in some GATT client role's APIs (ex. bt_gatt_get_uuid)
because their handlers were not maintained in the 'gatt_handle_list'.
This change will maintain such handlers.

Change-Id: I39e35f6df7a5de7ea0e574d3ef4a71f1c67c074b
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/bluetooth-gatt.c

index 0f07527..da55e30 100644 (file)
@@ -273,6 +273,9 @@ bt_gatt_h _bt_gatt_client_add_service(bt_gatt_client_h client,
 
        client_s->services = g_slist_append(client_s->services, svc);
 
+       /* Add service to list of GATT handles */
+       gatt_handle_list = g_slist_append(gatt_handle_list, (gpointer)svc);
+
        return svc;
 }
 #else
@@ -489,6 +492,9 @@ int _bt_gatt_client_update_include_services(bt_gatt_h service)
                sec_property.char_handle.handle = NULL;
 
                include_list = g_slist_append(include_list, sec_svc);
+
+               /* Add included service to list of GATT handles */
+               gatt_handle_list = g_slist_append(gatt_handle_list, (gpointer)sec_svc);
 next:
                bluetooth_gatt_free_service_property(&sec_property);
        }