Merge branch 'bugfix/btdm_error_when_white_list_is_full' into 'master'

component/bt: Fix bug of adding device to white list has no callback when while list is full

See merge request !1689
This commit is contained in:
Jiang Jiang Jian 2017-12-27 18:03:38 +08:00
commit 7d0d2854d3
5 changed files with 13 additions and 5 deletions

View file

@ -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_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_MEMORY_FULL, /* relate to BT_STATUS_MEMORY_FULL in bt_def.h */
} esp_bt_status_t;

View file

@ -130,6 +130,9 @@ static esp_bt_status_t btc_hci_to_esp_status(uint8_t hci_status)
case HCI_ERR_ILLEGAL_PARAMETER_FMT:
esp_status = ESP_BT_STATUS_ERR_ILLEGAL_PARAMETER_FMT;
break;
case HCI_ERR_MEMORY_FULL:
esp_status = ESP_BT_STATUS_MEMORY_FULL;
break;
default:
esp_status = ESP_BT_STATUS_FAIL;
break;

View file

@ -90,6 +90,7 @@ typedef enum {
BT_STATUS_UNACCEPT_CONN_INTERVAL,
BT_STATUS_PARAM_OUT_OF_RANGE,
BT_STATUS_TIMEOUT,
BT_STATUS_MEMORY_FULL,
} bt_status_t;
#ifndef CPU_LITTLE_ENDIAN

View file

@ -2078,7 +2078,7 @@ void BTM_BleGetWhiteListSize(uint16_t *length)
{
tBTM_BLE_CB *p_cb = &btm_cb.ble_ctr_cb;
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;
return;

View file

@ -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;
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;
}
if (add_wl_cb){