fix(ble/bluedroid): Fixed clear BLE device recored

(cherry picked from commit 21391a45fd)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
This commit is contained in:
Zhang Hai Peng
2025-05-27 15:13:38 +08:00
parent 26ca2561f6
commit e64937f7f6
3 changed files with 11 additions and 5 deletions

View File

@ -154,9 +154,9 @@ uint32_t btc_get_ble_status(void)
#if (SMP_INCLUDED == TRUE)
// Number of recorded devices
extern uint8_t btm_ble_sec_dev_active_count(void);
if (btm_ble_sec_dev_active_count()) {
status |= BIT(BTC_BLE_STATUS_KEYS);
extern uint8_t btm_ble_sec_dev_record_count(void);
if (btm_ble_sec_dev_record_count()) {
status |= BIT(BTC_BLE_STATUS_DEVICE_REC);
}
// Number of saved bonded devices

View File

@ -34,7 +34,7 @@ typedef enum {
BTC_BLE_STATUS_EXT_ADV, // Extended advertising exist
BTC_BLE_STATUS_SCAN, // Scanning exist
BTC_BLE_STATUS_CONN, // Connection exist
BTC_BLE_STATUS_KEYS, // Device keys record exist
BTC_BLE_STATUS_DEVICE_REC, // Device record exist
BTC_BLE_STATUS_BOND, // Bond info exist
BTC_BLE_STATUS_GATTC_CACHE, // GATTC cache exist
BTC_BLE_STATUS_GATTC_APP, // GATTC application exist

View File

@ -2946,7 +2946,7 @@ uint8_t btm_ble_scan_active_count(void)
}
#if (SMP_INCLUDED == TRUE)
uint8_t btm_ble_sec_dev_active_count(void)
uint8_t btm_ble_sec_dev_record_count(void)
{
tBTM_SEC_DEV_REC *p_dev_rec = NULL;
list_node_t *p_node = NULL;
@ -2962,6 +2962,12 @@ uint8_t btm_ble_sec_dev_active_count(void)
return count;
}
void btm_ble_clear_sec_dev_record(void)
{
/* only used when connection is closed */
if(btm_cb.p_sec_dev_rec_list) list_clear(btm_cb.p_sec_dev_rec_list);
}
#endif
#if (BLE_PRIVACY_SPT == TRUE)