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
parent 954c0981d8
commit 38d58f1c2e
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;
@ -1047,7 +1050,7 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
}
case BTC_GAP_BLE_ACT_CONFIG_LOCAL_PRIVACY:
btc_ble_config_local_privacy(arg->cfg_local_privacy.privacy_enable, btc_set_local_privacy_callback);
break;
break;
case BTC_GAP_BLE_ACT_UPDATE_WHITE_LIST:
BTA_DmUpdateWhiteList(arg->update_white_list.add_remove, arg->update_white_list.remote_bda, btc_add_whitelist_complete_callback);
break;
@ -1113,12 +1116,12 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
STREAM_TO_UINT8(key_size, arg->set_security_param.value);
bta_dm_co_ble_set_max_key_size(key_size);
break;
}
}
default:
break;
}
break;
}
}
case BTC_GAP_BLE_SECURITY_RSP_EVT: {
BD_ADDR bd_addr;
tBTA_DM_BLE_SEC_GRANT res = arg->sec_rsp.accept ? BTA_DM_SEC_GRANTED : BTA_DM_SEC_PAIR_NOT_SPT;

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){