Fix TCT fail issue
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / bluez_hal / src / bt-hal-adapter-le.c
index 95ac2ff..563b924 100644 (file)
@@ -277,7 +277,7 @@ void _bt_hal_free_server_slot(int slot_id)
        memset(&le_adv_slot[slot_id], 0x00, sizeof(bt_adapter_le_adv_slot_t));
 }
 
-int _bt_hal_get_available_adv_slot_id(bt_uuid_t *uuid)
+int _bt_hal_get_available_adv_slot_id(bt_uuid_t *uuid, gboolean use_reserved_slot)
 {
        int i;
 
@@ -297,6 +297,14 @@ int _bt_hal_get_available_adv_slot_id(bt_uuid_t *uuid)
                }
        }
 
+       /* We should consider 'use_reverved_slot' in later */
+       if (le_feature_info.adv_inst_max <= 1)
+               i = 0;
+       else if (use_reserved_slot == TRUE)
+               i = 1;
+       else
+               i = 2;
+
        for (i = 0; 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]",
@@ -626,7 +634,7 @@ int _bt_hal_set_advertising_params(int server_if, int min_interval,
        max = max_interval / BT_HAL_ADV_INTERVAL_SPLIT;
 
        ret = g_dbus_proxy_call_sync(proxy, "SetAdvertisingParameters",
-                       g_variant_new("(uuuui)", min, max,
+                       g_variant_new("(uuuuii)", min, max,
                        BT_HAL_ADV_FILTER_POLICY_DEFAULT, adv_type,
                        server_if), G_DBUS_CALL_FLAGS_NONE,
                        -1, NULL, &error);