component/bt: support BLE Authorization

This commit is contained in:
XieWenxiang
2020-09-15 15:17:30 +08:00
parent 3d8eb26fe1
commit 366b036ba5
12 changed files with 119 additions and 4 deletions

View File

@@ -749,3 +749,14 @@ esp_err_t esp_gap_ble_set_channels(esp_gap_ble_channels channels)
arg.set_channels.channels[ESP_GAP_BLE_CHANNELS_LEN -1] &= 0x1F;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_gap_ble_set_authorization(esp_bd_addr_t bd_addr, bool authorize)
{
if (!bd_addr) {
return ESP_ERR_INVALID_ARG;
}
if (BTM_Ble_Authorization(bd_addr, authorize)) {
return ESP_OK;
}
return ESP_FAIL;
}