From: Pyun DoHyun Date: Thu, 17 Sep 2020 07:35:19 +0000 (+0000) Subject: Merge "Enable advertising after gatt server is connected" into tizen X-Git-Tag: accepted/tizen/6.0/unified/20201030.120317^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f3c9d707e8cabd5be143392a23cf316ab8be4ca4;hp=bf3d6f1f0075359a235ab3e67e0b6deb74d654e2;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git Merge "Enable advertising after gatt server is connected" into tizen --- diff --git a/bt-oal/bluez_hal/src/bt-hal-adapter-le.c b/bt-oal/bluez_hal/src/bt-hal-adapter-le.c index ba84848..b1b4b1a 100644 --- a/bt-oal/bluez_hal/src/bt-hal-adapter-le.c +++ b/bt-oal/bluez_hal/src/bt-hal-adapter-le.c @@ -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)); diff --git a/bt-oal/bluez_hal/src/bt-hal-gatt-server.c b/bt-oal/bluez_hal/src/bt-hal-gatt-server.c index 26d15c8..59f91e4 100644 --- a/bt-oal/bluez_hal/src/bt-hal-gatt-server.c +++ b/bt-oal/bluez_hal/src/bt-hal-gatt-server.c @@ -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;