Fix: Handle the duplicated gatt descriptor 44/235944/1 submit/tizen/20200611.012128 submit/tizen/20200612.041013
authorinjun.yang <injun.yang@samsung.com>
Wed, 10 Jun 2020 00:22:45 +0000 (09:22 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Thu, 11 Jun 2020 07:19:26 +0000 (16:19 +0900)
[Model] All
[BinType] AP
[Customer] OPEN

[Issue#] N/A
[Request] Internal
[Occurrence Version] N/A

[Problem] Duplicated gatt event occured for a same uuid.
[Cause & Measure] descriptor duplicated on list. Check the path before adding it.
[Checking Method] Service browsing

[Team] Convergence BT
[Developer] Injun Yang
[Solution company] Samsung
[Change Type] Specification change

Change-Id: I897a7a6d4cebd06162159222ed3606b3fa4f5c64
Signed-off-by: injun.yang <injun.yang@samsung.com>
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
bt-oal/bluez_hal/src/bt-hal-gatt-client.c

index 823812e..863b4a7 100644 (file)
@@ -748,6 +748,16 @@ static void _gattc_create_new_service(hal_gattc_server_info_t *conn_info, gboole
 static void _hal_gattc_add_descriptor(hal_gattc_char_t *gattc_char, char *desc_path)
 {
        hal_gattc_desc_t *gattc_desc = NULL;
+       GSList *l;
+
+       for (l = gattc_char->gatt_list_descs; l != NULL; l = g_slist_next(l)) {
+               gattc_desc = (hal_gattc_desc_t *)l->data;
+               if (gattc_desc == NULL)
+                       continue;
+
+               if (g_strcmp0(gattc_desc->desc_path, desc_path) == 0)
+                       return;
+       }
 
        gattc_desc = g_malloc0(sizeof(hal_gattc_desc_t));
        gattc_desc->desc_path = g_strdup(desc_path);