From: injun.yang Date: Wed, 25 Mar 2020 07:03:00 +0000 (+0900) Subject: Fix : Adv malfunction on multiple LE connection X-Git-Tag: accepted/tizen/5.5/unified/20200331.180229~5^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F18%2F229118%2F1;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git Fix : Adv malfunction on multiple LE connection [Model] All [BinType] AP [Customer] OPEN [Issue#] N/A [Request] Internal [Occurrence Version] N/A [Problem] When multiple LE connection existed, unable to connect iOS GM. [Cause & Measure] After le disconnection, Kernel start standard advertising. It make ANCS connection again. [Checking Method] Connect with LE device > ANCS connection > GM launch > weconn start role switching > ANCS connected again [Team] Convergence BT [Developer] Injun Yang [Solution company] Samsung [Change Type] Specification change Change-Id: Iea238ebb1a08a2313c49f418bcc4c9abb04956e3 --- 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 7e36cf8..ac621d7 100644 --- a/bt-oal/bluez_hal/src/bt-hal-adapter-le.c +++ b/bt-oal/bluez_hal/src/bt-hal-adapter-le.c @@ -334,6 +334,11 @@ void _bt_hal_free_server_slot(int slot_id) memset(&le_adv_slot[slot_id], 0x00, sizeof(bt_adapter_le_adv_slot_t)); } +gboolean _bt_hal_is_support_multi_adv(void) +{ + return (le_feature_info.adv_inst_max > 1 ? TRUE : FALSE); +} + int _bt_hal_get_available_adv_slot_id(bt_uuid_t *uuid, gboolean use_reserved_slot) { int i; @@ -617,8 +622,10 @@ int _bt_hal_enable_advertising(int server_if, int adv_slot_id, bool enable, bool if (proxy == NULL) return BT_STATUS_FAIL; - if (le_adv_slot[adv_slot_id].is_advertising == TRUE && enable == TRUE) + if (le_adv_slot[adv_slot_id].is_advertising == TRUE && enable == TRUE) { + ERR("Already advertising inprogress. server_if %d, adv_slot_id %d",server_if, adv_slot_id); return BT_STATUS_BUSY; + } if (le_adv_slot[adv_slot_id].initialized == TRUE && le_adv_slot[adv_slot_id].is_advertising == FALSE && @@ -643,13 +650,14 @@ int _bt_hal_enable_advertising(int server_if, int adv_slot_id, bool enable, bool return BT_STATUS_FAIL; } - INFO("Enable advertising [%d] SLot Id [%d] gatt_server [%d] Is Multi? [%d]", - enable, adv_slot_id, server_if, is_multi_adv); + INFO_C("### %s advertising. gatt_server [%d] adv_slot_id [%d] Is Multi? [%d]", + enable ? "Start":"Stop", server_if, adv_slot_id, is_multi_adv); if (ret) g_variant_unref(ret); le_adv_slot[adv_slot_id].is_multi_adv = is_multi_adv; le_adv_slot[adv_slot_id].is_advertising = enable; + return BT_STATUS_SUCCESS; } diff --git a/bt-oal/bluez_hal/src/bt-hal-adapter-le.h b/bt-oal/bluez_hal/src/bt-hal-adapter-le.h index e9965e0..faa8429 100644 --- a/bt-oal/bluez_hal/src/bt-hal-adapter-le.h +++ b/bt-oal/bluez_hal/src/bt-hal-adapter-le.h @@ -50,6 +50,8 @@ void _bt_hal_unregister_gatt_le_dbus_handler_cb(); gboolean _bt_hal_update_le_feature_support(const char *item, const char *value, bt_local_le_features_t *le_features); +gboolean _bt_hal_is_support_multi_adv(void); + int _bt_hal_get_available_adv_slot_id(bt_uuid_t *uuid, gboolean use_reserved_slot); int _bt_hal_get_adv_slot_adv_handle(int slot_id); diff --git a/bt-oal/bluez_hal/src/bt-hal-gatt-client.c b/bt-oal/bluez_hal/src/bt-hal-gatt-client.c index a54059c..6a29e5b 100644 --- a/bt-oal/bluez_hal/src/bt-hal-gatt-client.c +++ b/bt-oal/bluez_hal/src/bt-hal-gatt-client.c @@ -3443,6 +3443,12 @@ static bt_status_t _bt_hold_current_advertising() gboolean is_advertising = FALSE; DBG("+"); + if (_bt_hal_is_support_multi_adv() == TRUE) { + DBG("VSC adv used"); + return BT_STATUS_SUCCESS; + } + + /* Dependent on Kernel operation. Hold adv to prevent stopping adv on kernel */ is_advertising = _bt_hal_is_advertising_in_slot(0); if (is_advertising) { DBG("+ Stop current advertising");