mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
component/bt: Fix bug of adding device to white list has no callback when while list is full
This commit is contained in:
parent
5401a75bad
commit
f5f8dda8a2
@ -51,6 +51,7 @@ typedef enum {
|
|||||||
ESP_BT_STATUS_PEER_LE_DATA_LEN_UNSUPPORTED, /* relate to BTM_PEER_LE_DATA_LEN_UNSUPPORTED in btm_api.h */
|
ESP_BT_STATUS_PEER_LE_DATA_LEN_UNSUPPORTED, /* relate to BTM_PEER_LE_DATA_LEN_UNSUPPORTED in btm_api.h */
|
||||||
ESP_BT_STATUS_CONTROL_LE_DATA_LEN_UNSUPPORTED,/* relate to BTM_CONTROL_LE_DATA_LEN_UNSUPPORTED in btm_api.h */
|
ESP_BT_STATUS_CONTROL_LE_DATA_LEN_UNSUPPORTED,/* relate to BTM_CONTROL_LE_DATA_LEN_UNSUPPORTED in btm_api.h */
|
||||||
ESP_BT_STATUS_ERR_ILLEGAL_PARAMETER_FMT, /* relate to HCI_ERR_ILLEGAL_PARAMETER_FMT in hcidefs.h */
|
ESP_BT_STATUS_ERR_ILLEGAL_PARAMETER_FMT, /* relate to HCI_ERR_ILLEGAL_PARAMETER_FMT in hcidefs.h */
|
||||||
|
ESP_BT_STATUS_MEMORY_FULL, /* relate to BT_STATUS_MEMORY_FULL in bt_def.h */
|
||||||
} esp_bt_status_t;
|
} esp_bt_status_t;
|
||||||
|
|
||||||
|
|
||||||
|
@ -130,6 +130,9 @@ static esp_bt_status_t btc_hci_to_esp_status(uint8_t hci_status)
|
|||||||
case HCI_ERR_ILLEGAL_PARAMETER_FMT:
|
case HCI_ERR_ILLEGAL_PARAMETER_FMT:
|
||||||
esp_status = ESP_BT_STATUS_ERR_ILLEGAL_PARAMETER_FMT;
|
esp_status = ESP_BT_STATUS_ERR_ILLEGAL_PARAMETER_FMT;
|
||||||
break;
|
break;
|
||||||
|
case HCI_ERR_MEMORY_FULL:
|
||||||
|
esp_status = ESP_BT_STATUS_MEMORY_FULL;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
esp_status = ESP_BT_STATUS_FAIL;
|
esp_status = ESP_BT_STATUS_FAIL;
|
||||||
break;
|
break;
|
||||||
|
@ -90,6 +90,7 @@ typedef enum {
|
|||||||
BT_STATUS_UNACCEPT_CONN_INTERVAL,
|
BT_STATUS_UNACCEPT_CONN_INTERVAL,
|
||||||
BT_STATUS_PARAM_OUT_OF_RANGE,
|
BT_STATUS_PARAM_OUT_OF_RANGE,
|
||||||
BT_STATUS_TIMEOUT,
|
BT_STATUS_TIMEOUT,
|
||||||
|
BT_STATUS_MEMORY_FULL,
|
||||||
} bt_status_t;
|
} bt_status_t;
|
||||||
|
|
||||||
#ifndef CPU_LITTLE_ENDIAN
|
#ifndef CPU_LITTLE_ENDIAN
|
||||||
|
@ -2078,7 +2078,7 @@ void BTM_BleGetWhiteListSize(uint16_t *length)
|
|||||||
{
|
{
|
||||||
tBTM_BLE_CB *p_cb = &btm_cb.ble_ctr_cb;
|
tBTM_BLE_CB *p_cb = &btm_cb.ble_ctr_cb;
|
||||||
if (p_cb->white_list_avail_size == 0) {
|
if (p_cb->white_list_avail_size == 0) {
|
||||||
BTM_TRACE_ERROR("%s Whitelist full.", __func__);
|
BTM_TRACE_DEBUG("%s Whitelist full.", __func__);
|
||||||
}
|
}
|
||||||
*length = p_cb->white_list_avail_size;
|
*length = p_cb->white_list_avail_size;
|
||||||
return;
|
return;
|
||||||
|
@ -259,7 +259,10 @@ BOOLEAN btm_update_dev_to_white_list(BOOLEAN to_add, BD_ADDR bd_addr, tBTM_ADD_W
|
|||||||
tBTM_BLE_CB *p_cb = &btm_cb.ble_ctr_cb;
|
tBTM_BLE_CB *p_cb = &btm_cb.ble_ctr_cb;
|
||||||
|
|
||||||
if (to_add && p_cb->white_list_avail_size == 0) {
|
if (to_add && p_cb->white_list_avail_size == 0) {
|
||||||
BTM_TRACE_DEBUG("%s Whitelist full, unable to add device", __func__);
|
BTM_TRACE_ERROR("%s Whitelist full, unable to add device", __func__);
|
||||||
|
if (add_wl_cb){
|
||||||
|
add_wl_cb(HCI_ERR_MEMORY_FULL,to_add);
|
||||||
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (add_wl_cb){
|
if (add_wl_cb){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user