mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
feat(ble): Add support to scan period refresh duplicate cache list
This commit is contained in:
parent
a357fd17c2
commit
2b195191b3
@ -469,7 +469,6 @@ config BT_LE_SCAN_DUPL_TYPE
|
|||||||
default 2 if BT_LE_SCAN_DUPL_TYPE_DATA_DEVICE
|
default 2 if BT_LE_SCAN_DUPL_TYPE_DATA_DEVICE
|
||||||
default 0
|
default 0
|
||||||
|
|
||||||
|
|
||||||
config BT_LE_SCAN_DUPL_CACHE_SIZE
|
config BT_LE_SCAN_DUPL_CACHE_SIZE
|
||||||
int "Maximum number of devices in scan duplicate filter"
|
int "Maximum number of devices in scan duplicate filter"
|
||||||
depends on BT_LE_SCAN_DUPL
|
depends on BT_LE_SCAN_DUPL
|
||||||
@ -478,3 +477,19 @@ config BT_LE_SCAN_DUPL_CACHE_SIZE
|
|||||||
help
|
help
|
||||||
Maximum number of devices which can be recorded in scan duplicate filter.
|
Maximum number of devices which can be recorded in scan duplicate filter.
|
||||||
When the maximum amount of device in the filter is reached, the cache will be refreshed.
|
When the maximum amount of device in the filter is reached, the cache will be refreshed.
|
||||||
|
|
||||||
|
config BT_LE_SCAN_DUPL_CACHE_REFRESH_PERIOD
|
||||||
|
int "Duplicate scan list refresh period (seconds)"
|
||||||
|
depends on BT_LE_SCAN_DUPL
|
||||||
|
range 0 1000
|
||||||
|
default 0
|
||||||
|
help
|
||||||
|
If the period value is non-zero, the controller will periodically clear the device information
|
||||||
|
stored in the scan duuplicate filter. If it is 0, the scan duuplicate filter will not be cleared
|
||||||
|
until the scanning is disabled. Duplicate advertisements for this period should not be sent to the
|
||||||
|
Host in advertising report events.
|
||||||
|
There are two scenarios where the ADV packet will be repeatedly reported:
|
||||||
|
1. The duplicate scan cache is full, the controller will delete the oldest device information and
|
||||||
|
add new device information.
|
||||||
|
2. When the refresh period is up, the controller will clear all device information and start filtering
|
||||||
|
again.
|
||||||
|
@ -632,6 +632,7 @@ typedef enum {
|
|||||||
extern void filter_duplicate_mode_enable(disc_duplicate_mode_t mode);
|
extern void filter_duplicate_mode_enable(disc_duplicate_mode_t mode);
|
||||||
extern void filter_duplicate_mode_disable(disc_duplicate_mode_t mode);
|
extern void filter_duplicate_mode_disable(disc_duplicate_mode_t mode);
|
||||||
extern void filter_duplicate_set_ring_list_max_num(uint32_t max_num);
|
extern void filter_duplicate_set_ring_list_max_num(uint32_t max_num);
|
||||||
|
extern void scan_duplicate_cache_refresh_set_time(uint32_t period_time);
|
||||||
|
|
||||||
int
|
int
|
||||||
ble_vhci_disc_duplicate_mode_enable(int mode)
|
ble_vhci_disc_duplicate_mode_enable(int mode)
|
||||||
@ -655,6 +656,12 @@ int ble_vhci_disc_duplicate_set_max_cache_size(int max_cache_size){
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ble_vhci_disc_duplicate_set_period_refresh_time(int refresh_period_time){
|
||||||
|
// TODO: use vendor hci to update
|
||||||
|
scan_duplicate_cache_refresh_set_time(refresh_period_time);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Config scan duplicate option mode from menuconfig (Adapt to the old configuration method.)
|
* @brief Config scan duplicate option mode from menuconfig (Adapt to the old configuration method.)
|
||||||
*/
|
*/
|
||||||
@ -675,6 +682,7 @@ void ble_controller_scan_duplicate_config()
|
|||||||
ble_vhci_disc_duplicate_mode_disable(0xFF);
|
ble_vhci_disc_duplicate_mode_disable(0xFF);
|
||||||
ble_vhci_disc_duplicate_mode_enable(duplicate_mode);
|
ble_vhci_disc_duplicate_mode_enable(duplicate_mode);
|
||||||
ble_vhci_disc_duplicate_set_max_cache_size(cache_size);
|
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)
|
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user