serv_info->serv_path, service_handle);
}
- for (l = serv_info->char_data; l != NULL; l = g_slist_next(l)) {
+ for (l = serv_info->char_data; l != NULL;) {
struct gatt_char_info *char_info = l->data;
+ l = g_slist_next(l);
if (char_info == NULL)
break;
- for (l1 = char_info->desc_data; l1 != NULL; l1 = g_slist_next(l1)) {
+ for (l1 = char_info->desc_data; l1 != NULL;) {
struct gatt_desc_info *desc_info = l1->data;
+ l1 = g_slist_next(l1);
if (desc_info == NULL)
break;
/* list remove & free */
char_info->desc_data = g_slist_remove(char_info->desc_data, desc_info);
__bt_hal_free_gatt_handle(BT_GATT_TYPE_DESC, desc_info->desc_handle);
+ INFO("desc handle(%d) removed successfully", desc_info->desc_handle);
__bt_hal_gatt_free_descriptor_info(desc_info);
}
/* list remove & free */
serv_info->char_data = g_slist_remove(serv_info->char_data, char_info);
__bt_hal_free_gatt_handle(BT_GATT_TYPE_CHAR, char_info->char_handle);
+ INFO("char handle(%d) removed successfully", char_info->char_handle);
__bt_hal_gatt_free_characteristic_info(char_info);
}
/* Remove from global list */
gatt_services = g_slist_remove(gatt_services, serv_info);
__bt_hal_free_gatt_handle(BT_GATT_TYPE_SERV, serv_info->service_handle);
- INFO("After removing from global list total service dount [%d]", g_slist_length(gatt_services));
+ INFO("serv handle(%d) removed successfully", serv_info->service_handle);
+ INFO("After removing from global list total service count [%d]", g_slist_length(gatt_services));
/* Remove from GATT Server's list of services */
_bt_remote_service_from_gatt_server(server_if, service_handle);