Merge "Enable advertising after gatt server is connected" into tizen accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.120317 accepted/tizen/6.0/unified/hotfix/20201103.045831 accepted/tizen/unified/20200923.093730 submit/tizen/20200917.075044 submit/tizen/20200923.005759 submit/tizen_6.0/20201029.205103 submit/tizen_6.0_hotfix/20201102.192503 submit/tizen_6.0_hotfix/20201103.114803 tizen_6.0.m2_release
authorPyun DoHyun <dh79.pyun@samsung.com>
Thu, 17 Sep 2020 07:35:19 +0000 (07:35 +0000)
committerGerrit Code Review <gerrit@review>
Thu, 17 Sep 2020 07:35:19 +0000 (07:35 +0000)
bt-oal/bluez_hal/src/bt-hal-adapter-le.c
bt-oal/bluez_hal/src/bt-hal-gatt-server.c

index ba84848..b1b4b1a 100644 (file)
@@ -365,9 +365,9 @@ int _bt_hal_get_available_adv_slot_id(bt_uuid_t *uuid, gboolean use_reserved_slo
        else if (use_reserved_slot == TRUE)
                i = 1;
        else
-               i = 2;
+               i = 0;
 
-       for (i = 0; i < le_feature_info.adv_inst_max; i++) {
+       for ( ; i < le_feature_info.adv_inst_max; i++) {
                if (le_adv_slot[i].initialized == 0) {
                        DBG("Slot to be allocated [%d] UUID to be registered [%s]",
                                i, btuuid2str(uuid->uu));
index 26d15c8..59f91e4 100644 (file)
@@ -3494,7 +3494,7 @@ static int bt_hal_gatts_allocate_adv_slot(struct hal_gatts_server_register_info_
 
        /* allocate adv slot for gatt server if not assigned */
        if (server_register_info->adv_slot_id < 0 ) {
-               adv_slot_id = _bt_hal_get_available_adv_slot_id(&server_register_info->app_uuid, FALSE);
+               adv_slot_id = _bt_hal_get_available_adv_slot_id(&server_register_info->app_uuid, TRUE);
                if (adv_slot_id < 0) {
                        ERR("failed to get the adv_slot");
                        return -1;