Merge branch 'bugfix/fix_duplicate_disable_compile_issue_backport_5_1' into 'release/v5.1'

bugfix(ble): Fix compile issue when disable duplicate config option in kconfig.

See merge request espressif/esp-idf!25177
This commit is contained in:
Jiang Jiang Jian 2023-08-28 10:22:50 +08:00
commit fae05ace21
2 changed files with 12 additions and 6 deletions

View File

@ -616,7 +616,9 @@ int ble_vhci_disc_duplicate_set_period_refresh_time(int refresh_period_time){
void ble_controller_scan_duplicate_config(void)
{
uint32_t duplicate_mode = FILTER_DUPLICATE_DEFAULT;
uint32_t cache_size = CONFIG_BT_LE_SCAN_DUPL_CACHE_SIZE;
uint32_t cache_size = 100;
#if CONFIG_BT_LE_SCAN_DUPL == true
cache_size = CONFIG_BT_LE_SCAN_DUPL_CACHE_SIZE;
if (CONFIG_BT_LE_SCAN_DUPL_TYPE == 0) {
duplicate_mode = FILTER_DUPLICATE_ADDRESS | FILTER_DUPLICATE_PDUTYPE;
} else if (CONFIG_BT_LE_SCAN_DUPL_TYPE == 1) {
@ -624,13 +626,14 @@ void ble_controller_scan_duplicate_config(void)
} else if (CONFIG_BT_LE_SCAN_DUPL_TYPE == 2) {
duplicate_mode = FILTER_DUPLICATE_ADDRESS | FILTER_DUPLICATE_ADVDATA;
}
duplicate_mode |= FILTER_DUPLICATE_EXCEPTION_FOR_MESH;
ble_vhci_disc_duplicate_set_period_refresh_time(CONFIG_BT_LE_SCAN_DUPL_CACHE_REFRESH_PERIOD);
#endif
ble_vhci_disc_duplicate_mode_disable(0xFFFFFFFF);
ble_vhci_disc_duplicate_mode_enable(duplicate_mode);
ble_vhci_disc_duplicate_set_max_cache_size(cache_size);
ble_vhci_disc_duplicate_set_period_refresh_time(CONFIG_BT_LE_SCAN_DUPL_CACHE_REFRESH_PERIOD);
}
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)

View File

@ -613,7 +613,9 @@ int ble_vhci_disc_duplicate_set_period_refresh_time(int refresh_period_time){
void ble_controller_scan_duplicate_config(void)
{
uint32_t duplicate_mode = FILTER_DUPLICATE_DEFAULT;
uint32_t cache_size = CONFIG_BT_LE_SCAN_DUPL_CACHE_SIZE;
uint32_t cache_size = 100;
#if CONFIG_BT_LE_SCAN_DUPL == true
cache_size = CONFIG_BT_LE_SCAN_DUPL_CACHE_SIZE;
if (CONFIG_BT_LE_SCAN_DUPL_TYPE == 0) {
duplicate_mode = FILTER_DUPLICATE_ADDRESS | FILTER_DUPLICATE_PDUTYPE;
} else if (CONFIG_BT_LE_SCAN_DUPL_TYPE == 1) {
@ -621,13 +623,14 @@ void ble_controller_scan_duplicate_config(void)
} else if (CONFIG_BT_LE_SCAN_DUPL_TYPE == 2) {
duplicate_mode = FILTER_DUPLICATE_ADDRESS | FILTER_DUPLICATE_ADVDATA;
}
duplicate_mode |= FILTER_DUPLICATE_EXCEPTION_FOR_MESH;
ble_vhci_disc_duplicate_set_period_refresh_time(CONFIG_BT_LE_SCAN_DUPL_CACHE_REFRESH_PERIOD);
#endif
ble_vhci_disc_duplicate_mode_disable(0xFFFFFFFF);
ble_vhci_disc_duplicate_mode_enable(duplicate_mode);
ble_vhci_disc_duplicate_set_max_cache_size(cache_size);
ble_vhci_disc_duplicate_set_period_refresh_time(CONFIG_BT_LE_SCAN_DUPL_CACHE_REFRESH_PERIOD);
}
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)