Fixed gatt characteristic property 30/182230/1
authorAmit Purwar <amit.purwar@samsung.com>
Thu, 21 Jun 2018 10:39:48 +0000 (16:09 +0530)
committerAmit Purwar <amit.purwar@samsung.com>
Thu, 21 Jun 2018 10:45:07 +0000 (16:15 +0530)
This change fix the issue that Gatt characteristic property
was not sent when descriptor is not present.

Change-Id: I8dc6ec159ed049a3d550c2b8660506c5193a2a0c
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
bt-service-adaptation/services/gatt/bt-service-gatt.c

index 61c4987165f54e2a95ce7039d4738b31c0253186..e5c306cf1915d1e29ce43dbf929dd09efd53dd87 100644 (file)
@@ -2691,14 +2691,17 @@ static void __bt_build_descriptor_browse_info(int conn_id,
        memcpy(&info->char_uuid, char_info->uuid, BLUETOOTH_UUID_HEX_MAX_LEN);
        info->char_inst_id = char_info->inst_id;
 
+       /* Fill property of the parent characteristic of this descriptor */
+       info->char_props_map = char_info->props;
+
+       info->count = g_slist_length(char_info->descs);
+       BT_INFO("Total count of Descriptors [%d]", info->count);
+
        if (!char_info->descs) {
                BT_ERR("No Descriptors browsed for address [%s]", conn_info->addr);
                return;
        }
 
-       info->count = g_slist_length(char_info->descs);
-       BT_INFO("Total count of Descriptors [%d]", info->count);
-
        for (l = char_info->descs; l != NULL; l = g_slist_next(l)) {
                desc_info = (bt_gatt_descriptor_info_t*)l->data;
                if (desc_info == NULL)
@@ -2714,8 +2717,6 @@ static void __bt_build_descriptor_browse_info(int conn_id,
                /* Fill instance ID of Descriptor */
                info->inst_id[count] = desc_info->inst_id;
 
-               /* Fill property of the parent characteristic of this descriptor */
-               info->char_props_map = char_info->props;
 
                /* Increment count of Descriptor browsed */
                count++;