mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-03 03:31:41 +03:00
feat(bt/bluedroid): Support BLE setting vendor event mask
This commit is contained in:
@@ -1381,6 +1381,25 @@ static void btc_ble_set_csa_support_callback(UINT8 status)
|
||||
}
|
||||
}
|
||||
|
||||
static void btc_ble_set_vendor_evt_mask_callback(UINT8 status)
|
||||
{
|
||||
esp_ble_gap_cb_param_t param;
|
||||
bt_status_t ret;
|
||||
btc_msg_t msg = {0};
|
||||
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = ESP_GAP_BLE_SET_VENDOR_EVT_MASK_COMPLETE_EVT;
|
||||
|
||||
param.set_csa_support_cmpl.status = btc_btm_status_to_esp_status(status);
|
||||
|
||||
ret = btc_transfer_context(&msg, ¶m, sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
|
||||
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
void btc_get_whitelist_size(uint16_t *length)
|
||||
{
|
||||
BTM_BleGetWhiteListSize(length);
|
||||
@@ -2461,6 +2480,9 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
|
||||
case BTC_GAP_BLE_SET_CSA_SUPPORT:
|
||||
BTA_DmBleGapSetCsaSupport(arg->set_csa_support.csa_select, btc_ble_set_csa_support_callback);
|
||||
break;
|
||||
case BTC_GAP_BLE_ACT_SET_VENDOR_EVT_MASK:
|
||||
BTA_DmBleGapSetVendorEventMask(arg->set_vendor_evt_mask.evt_mask, btc_ble_set_vendor_evt_mask_callback);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -121,6 +121,7 @@ typedef enum {
|
||||
BTC_GAP_BLE_ACT_VENDOR_HCI_CMD_EVT,
|
||||
BTC_GAP_BLE_SET_PRIVACY_MODE,
|
||||
BTC_GAP_BLE_SET_CSA_SUPPORT,
|
||||
BTC_GAP_BLE_ACT_SET_VENDOR_EVT_MASK,
|
||||
} btc_gap_ble_act_t;
|
||||
|
||||
/* btc_ble_gap_args_t */
|
||||
@@ -295,6 +296,10 @@ typedef union {
|
||||
struct set_csa_support_args {
|
||||
uint8_t csa_select;
|
||||
} set_csa_support;
|
||||
// BTC_GAP_BLE_ACT_SET_VENDOR_EVT_MASK
|
||||
struct set_vendor_evt_mask_args {
|
||||
uint32_t evt_mask;
|
||||
} set_vendor_evt_mask;
|
||||
} btc_ble_gap_args_t;
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
Reference in New Issue
Block a user