mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
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:
@ -166,9 +166,9 @@ uint32_t btc_get_ble_status(void)
|
|||||||
|
|
||||||
#if (SMP_INCLUDED == TRUE)
|
#if (SMP_INCLUDED == TRUE)
|
||||||
// Number of recorded devices
|
// Number of recorded devices
|
||||||
extern uint8_t btm_ble_sec_dev_active_count(void);
|
extern uint8_t btm_ble_sec_dev_record_count(void);
|
||||||
if (btm_ble_sec_dev_active_count()) {
|
if (btm_ble_sec_dev_record_count()) {
|
||||||
status |= BIT(BTC_BLE_STATUS_KEYS);
|
status |= BIT(BTC_BLE_STATUS_DEVICE_REC);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Number of saved bonded devices
|
// Number of saved bonded devices
|
||||||
|
@ -34,7 +34,7 @@ typedef enum {
|
|||||||
BTC_BLE_STATUS_EXT_ADV, // Extended advertising exist
|
BTC_BLE_STATUS_EXT_ADV, // Extended advertising exist
|
||||||
BTC_BLE_STATUS_SCAN, // Scanning exist
|
BTC_BLE_STATUS_SCAN, // Scanning exist
|
||||||
BTC_BLE_STATUS_CONN, // Connection 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_BOND, // Bond info exist
|
||||||
BTC_BLE_STATUS_GATTC_CACHE, // GATTC cache exist
|
BTC_BLE_STATUS_GATTC_CACHE, // GATTC cache exist
|
||||||
BTC_BLE_STATUS_GATTC_APP, // GATTC application exist
|
BTC_BLE_STATUS_GATTC_APP, // GATTC application exist
|
||||||
|
@ -2946,7 +2946,7 @@ uint8_t btm_ble_scan_active_count(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if (SMP_INCLUDED == TRUE)
|
#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;
|
tBTM_SEC_DEV_REC *p_dev_rec = NULL;
|
||||||
list_node_t *p_node = NULL;
|
list_node_t *p_node = NULL;
|
||||||
@ -2962,6 +2962,12 @@ uint8_t btm_ble_sec_dev_active_count(void)
|
|||||||
|
|
||||||
return count;
|
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
|
#endif
|
||||||
|
|
||||||
#if (BLE_PRIVACY_SPT == TRUE)
|
#if (BLE_PRIVACY_SPT == TRUE)
|
||||||
|
Reference in New Issue
Block a user