mirror of
https://github.com/espressif/esp-idf
synced 2025-03-06 22:59:09 -05:00
Merge branch 'feat/support_ble_vendor_hci_event_report_v5.0' into 'release/v5.0'
feat(bt/bluedroid): Support BLE vendor hci event reporting (v5.0) See merge request espressif/esp-idf!37350
This commit is contained in:
commit
e69a86629a
@ -1741,3 +1741,21 @@ esp_err_t esp_ble_gap_vendor_command_send(esp_ble_vendor_cmd_params_t *vendor_cm
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), btc_gap_ble_arg_deep_copy, btc_gap_ble_arg_deep_free)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_set_vendor_event_mask(uint32_t event_mask)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_gap_args_t arg;
|
||||
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_ACT_SET_VENDOR_EVT_MASK;
|
||||
arg.set_vendor_evt_mask.evt_mask = event_mask;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -230,6 +230,8 @@ typedef enum {
|
||||
ESP_GAP_BLE_VENDOR_CMD_COMPLETE_EVT, /*!< When vendor hci command complete, the event comes */
|
||||
ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT, /*!< When set privacy mode complete, the event comes */
|
||||
ESP_GAP_BLE_SET_CSA_SUPPORT_COMPLETE_EVT, /*!< When set CSA support complete, the event comes */
|
||||
ESP_GAP_BLE_SET_VENDOR_EVT_MASK_COMPLETE_EVT, /*!< When set vendor event mask complete, the event comes */
|
||||
ESP_GAP_BLE_VENDOR_HCI_EVT, /*!< When BLE vendor HCI event received, the event comes */
|
||||
ESP_GAP_BLE_EVT_MAX, /*!< when maximum advertising event complete, the event comes */
|
||||
} esp_gap_ble_cb_event_t;
|
||||
|
||||
@ -1578,7 +1580,21 @@ typedef union {
|
||||
*/
|
||||
struct ble_set_csa_support_cmpl_evt_param {
|
||||
esp_bt_status_t status; /*!< Indicate CSA support set operation success status */
|
||||
} set_csa_support_cmpl; /*!< Event parameter of ESP_GAP_BLE_SET_CSA_SUPPORT_COMPLETE_EVT */
|
||||
} set_csa_support_cmpl; /*!< Event parameter of ESP_GAP_BLE_SET_CSA_SUPPORT_COMPLETE_EVT */
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_SET_VENDOR_EVT_MASK_COMPLETE_EVT
|
||||
*/
|
||||
struct ble_set_vendor_evt_mask_cmpl_evt_param {
|
||||
esp_bt_status_t status; /*!< Indicate set vendor event mask operation success status */
|
||||
} set_vendor_evt_mask_cmpl; /*!< Event parameter of ESP_GAP_BLE_SET_VENDOR_EVT_MASK_COMPLETE_EVT */
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_VENDOR_HCI_EVT
|
||||
*/
|
||||
struct ble_vendor_hci_event_evt_param {
|
||||
uint8_t subevt_code; /*!< Subevent code for vendor HCI event, the range is 0xC0 to 0xFF */
|
||||
uint8_t param_len; /*!< The length of the event parameter buffer */
|
||||
uint8_t *param_buf; /*!< The pointer of the event parameter buffer */
|
||||
} vendor_hci_evt; /*!< Event parameter buffer of ESP_GAP_BLE_VENDOR_HCI_EVT */
|
||||
} esp_ble_gap_cb_param_t;
|
||||
|
||||
/**
|
||||
@ -2770,6 +2786,18 @@ esp_err_t esp_ble_gap_set_privacy_mode(esp_ble_addr_type_t addr_type, esp_bd_add
|
||||
*/
|
||||
esp_err_t esp_ble_gap_set_csa_support(uint8_t csa_select);
|
||||
|
||||
/**
|
||||
* @brief This function is used to control which vendor events are generated by the HCI for the Host.
|
||||
*
|
||||
* @param[in] event_mask: Bit0: Legacy scan request received event
|
||||
* Bit1: Vendor channel map update complete event
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK : success
|
||||
* - other : failed
|
||||
*/
|
||||
esp_err_t esp_ble_gap_set_vendor_event_mask(uint32_t event_mask);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -5770,6 +5770,12 @@ void bta_dm_ble_gap_set_csa_support(tBTA_DM_MSG *p_data)
|
||||
BTM_BleSetCsaSupport(p_data->ble_set_csa_support.csa_select, p_data->ble_set_csa_support.p_cback);
|
||||
}
|
||||
|
||||
void bta_dm_ble_gap_set_vendor_evt_mask(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
APPL_TRACE_API("%s, evt_mask = %d", __func__, p_data->ble_set_vendor_evt_mask.evt_mask);
|
||||
BTM_BleSetVendorEventMask(p_data->ble_set_vendor_evt_mask.evt_mask, p_data->ble_set_vendor_evt_mask.p_cback);
|
||||
}
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
void bta_dm_ble_gap_dtm_enhance_tx_start(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
|
@ -2943,6 +2943,19 @@ void BTA_DmBleGapSetCsaSupport(uint8_t csa_select, tBTA_SET_CSA_SUPPORT_CMPL_CBA
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapSetVendorEventMask(uint32_t evt_mask, tBTA_SET_VENDOR_EVT_MASK_CBACK *p_callback)
|
||||
{
|
||||
tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK *)osi_malloc(sizeof(tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK)))
|
||||
!= NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT;
|
||||
p_msg->evt_mask = evt_mask;
|
||||
p_msg->p_cback = p_callback;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_VendorInit
|
||||
|
@ -223,6 +223,7 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
||||
bta_dm_ble_gap_add_dev_to_resolving_list, /* BTA_DM_API_ADD_DEV_TO_RESOLVING_LIST_EVT */
|
||||
bta_dm_ble_gap_set_privacy_mode, /* BTA_DM_API_SET_PRIVACY_MODE_EVT */
|
||||
bta_dm_ble_gap_set_csa_support, /* BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT */
|
||||
bta_dm_ble_gap_set_vendor_evt_mask, /* BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT */
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -219,6 +219,7 @@ enum {
|
||||
BTA_DM_API_ADD_DEV_TO_RESOLVING_LIST_EVT,
|
||||
BTA_DM_API_SET_PRIVACY_MODE_EVT,
|
||||
BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT,
|
||||
BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT,
|
||||
#endif
|
||||
BTA_DM_MAX_EVT
|
||||
};
|
||||
@ -925,6 +926,12 @@ typedef struct {
|
||||
tBTA_SET_CSA_SUPPORT_CMPL_CBACK *p_cback;
|
||||
} tBTA_DM_API_BLE_SET_CSA_SUPPORT;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT32 evt_mask;
|
||||
tBTA_SET_VENDOR_EVT_MASK_CBACK *p_cback;
|
||||
} tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK;
|
||||
|
||||
#endif /* BLE_INCLUDED */
|
||||
|
||||
/* data type for BTA_DM_API_REMOVE_ACL_EVT */
|
||||
@ -1324,6 +1331,7 @@ typedef union {
|
||||
tBTA_DM_API_CLEAR_ADV ble_clear_adv;
|
||||
tBTA_DM_API_SET_PRIVACY_MODE ble_set_privacy_mode;
|
||||
tBTA_DM_API_BLE_SET_CSA_SUPPORT ble_set_csa_support;
|
||||
tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK ble_set_vendor_evt_mask;
|
||||
#endif
|
||||
|
||||
tBTA_DM_API_REMOVE_ACL remove_acl;
|
||||
@ -1769,6 +1777,7 @@ extern void bta_dm_ble_gap_set_rpa_timeout(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_gap_add_dev_to_resolving_list(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_gap_set_privacy_mode(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_gap_set_csa_support(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_gap_set_vendor_evt_mask(tBTA_DM_MSG *p_data);
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
extern void bta_dm_ble_gap_dtm_enhance_tx_start(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_gap_dtm_enhance_rx_start(tBTA_DM_MSG *p_data);
|
||||
|
@ -441,6 +441,8 @@ typedef tBTM_SET_PRIVACY_MODE_CMPL_CBACK tBTA_SET_PRIVACY_MODE_CMPL_CBACK;
|
||||
|
||||
typedef tBTM_SET_CSA_SUPPORT_CMPL_CBACK tBTA_SET_CSA_SUPPORT_CMPL_CBACK;
|
||||
|
||||
typedef tBTM_SET_VENDOR_EVT_MASK_CBACK tBTA_SET_VENDOR_EVT_MASK_CBACK;
|
||||
|
||||
typedef tBTM_CMPL_CB tBTA_CMPL_CB;
|
||||
|
||||
typedef tBTM_VSC_CMPL tBTA_VSC_CMPL;
|
||||
@ -2860,6 +2862,8 @@ extern void BTA_DmBleSetPrivacyMode(uint8_t addr_type, BD_ADDR addr, uint8_t pri
|
||||
|
||||
extern void BTA_DmBleGapSetCsaSupport(uint8_t csa_select, tBTM_SET_CSA_SUPPORT_CMPL_CBACK *p_callback);
|
||||
|
||||
extern void BTA_DmBleGapSetVendorEventMask(uint32_t evt_mask, tBTA_SET_VENDOR_EVT_MASK_CBACK *p_callback);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmBleSetStorageParams
|
||||
|
@ -1375,6 +1375,45 @@ 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__);
|
||||
}
|
||||
}
|
||||
|
||||
static void btc_ble_vendor_hci_event_callback(UINT8 subevt_code, UINT8 param_len, UINT8 *params)
|
||||
{
|
||||
esp_ble_gap_cb_param_t param = {0};
|
||||
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_VENDOR_HCI_EVT;
|
||||
|
||||
param.vendor_hci_evt.subevt_code = subevt_code;
|
||||
param.vendor_hci_evt.param_len = param_len;
|
||||
param.vendor_hci_evt.param_buf = params;
|
||||
ret = btc_transfer_context(&msg, ¶m, sizeof(esp_ble_gap_cb_param_t), btc_gap_ble_cb_deep_copy, btc_gap_ble_cb_deep_free);
|
||||
|
||||
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);
|
||||
@ -1774,6 +1813,18 @@ void btc_gap_ble_cb_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ESP_GAP_BLE_VENDOR_HCI_EVT: {
|
||||
if (src->vendor_hci_evt.param_len) {
|
||||
dst->vendor_hci_evt.param_buf = osi_malloc(src->vendor_hci_evt.param_len);
|
||||
if (dst->vendor_hci_evt.param_buf) {
|
||||
memcpy(dst->vendor_hci_evt.param_buf, src->vendor_hci_evt.param_buf,
|
||||
src->vendor_hci_evt.param_len);
|
||||
} else {
|
||||
BTC_TRACE_ERROR("%s, malloc failed\n", __func__);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
BTC_TRACE_ERROR("%s, Unhandled deep copy %d\n", __func__, msg->act);
|
||||
break;
|
||||
@ -1902,6 +1953,13 @@ void btc_gap_ble_cb_deep_free(btc_msg_t *msg)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ESP_GAP_BLE_VENDOR_HCI_EVT: {
|
||||
void *value = ((esp_ble_gap_cb_param_t *)msg->arg)->vendor_hci_evt.param_buf;
|
||||
if (value) {
|
||||
osi_free(value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
BTC_TRACE_DEBUG("Unhandled deep free %d", msg->act);
|
||||
break;
|
||||
@ -2397,6 +2455,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;
|
||||
}
|
||||
@ -2412,6 +2473,7 @@ void btc_gap_callback_init(void)
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
BTM_BleGapRegisterCallback(btc_ble_5_gap_callback);
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
BTM_BleRegisterVendorHciEventCallback(btc_ble_vendor_hci_event_callback);
|
||||
}
|
||||
|
||||
bool btc_gap_ble_init(void)
|
||||
|
@ -109,6 +109,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 */
|
||||
@ -281,6 +282,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)
|
||||
|
@ -71,6 +71,8 @@ static tBTM_BLE_CTRL_FEATURES_CBACK *p_ctrl_le_feature_rd_cmpl_cback = NULL;
|
||||
#endif
|
||||
|
||||
tBTM_CallbackFunc conn_callback_func;
|
||||
// BLE vendor HCI event callback
|
||||
static tBTM_BLE_VENDOR_HCI_EVT_CBACK *ble_vs_evt_callback = NULL;
|
||||
/*******************************************************************************
|
||||
** Local functions
|
||||
*******************************************************************************/
|
||||
@ -326,6 +328,11 @@ void BTM_BleRegiseterPktLengthChangeCallback(tBTM_SET_PKT_DATA_LENGTH_CBACK *ptk
|
||||
conn_callback_func.set_pkt_data_length_cb = ptk_len_chane_cb;
|
||||
}
|
||||
|
||||
void BTM_BleRegisterVendorHciEventCallback(tBTM_BLE_VENDOR_HCI_EVT_CBACK *vendor_hci_evt_cb)
|
||||
{
|
||||
ble_vs_evt_callback = vendor_hci_evt_cb;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleUpdateAdvWhitelist
|
||||
@ -4529,6 +4536,26 @@ BOOLEAN btm_ble_update_mode_operation(UINT8 link_role, BD_ADDR bd_addr, UINT8 st
|
||||
return bg_con;
|
||||
}
|
||||
|
||||
static void btm_ble_vs_evt_callback(UINT8 len, UINT8 *p)
|
||||
{
|
||||
UINT8 sub_event;
|
||||
|
||||
if (!len || !p) {
|
||||
return;
|
||||
}
|
||||
|
||||
STREAM_TO_UINT8(sub_event, p);
|
||||
len--;
|
||||
|
||||
if (sub_event < HCI_VSE_LE_LEGACY_SCAN_REQ_RECEIVED_EVT) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ble_vs_evt_callback) {
|
||||
ble_vs_evt_callback(sub_event, len, p);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_ble_init
|
||||
@ -4585,6 +4612,8 @@ void btm_ble_init (void)
|
||||
#if BLE_VND_INCLUDED == FALSE
|
||||
btm_ble_adv_filter_init();
|
||||
#endif
|
||||
|
||||
BTM_RegisterForVSEvents(btm_ble_vs_evt_callback, TRUE);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
@ -4778,6 +4807,17 @@ BOOLEAN BTM_BleSetCsaSupport(UINT8 csa_select, tBTM_SET_CSA_SUPPORT_CMPL_CBACK *
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOLEAN BTM_BleSetVendorEventMask(UINT32 evt_mask, tBTM_SET_VENDOR_EVT_MASK_CBACK *p_callback)
|
||||
{
|
||||
if (btsnd_hcic_ble_set_vendor_evt_mask(evt_mask) != TRUE) {
|
||||
BTM_TRACE_ERROR("LE SetVendorEventMask evt_mask=%x: error", evt_mask);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
btm_cb.ble_ctr_cb.set_vendor_evt_mask_cmpl_cb = p_callback;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool btm_ble_adv_pkt_ready(void)
|
||||
{
|
||||
tBTM_BLE_CB *p_cb = &btm_cb.ble_ctr_cb;
|
||||
|
@ -730,6 +730,14 @@ void btm_vsc_complete (UINT8 *p, UINT16 opcode, UINT16 evt_len,
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HCI_VENDOR_BLE_SET_EVT_MASK: {
|
||||
uint8_t status;
|
||||
STREAM_TO_UINT8(status, p);
|
||||
if (ble_cb && ble_cb->set_vendor_evt_mask_cmpl_cb) {
|
||||
ble_cb->set_vendor_evt_mask_cmpl_cb(status);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -381,6 +381,7 @@ typedef struct {
|
||||
UINT8 link_count[2]; /* total link count master and slave*/
|
||||
tBTM_UPDATE_DUPLICATE_EXCEPTIONAL_LIST_CMPL_CBACK *update_exceptional_list_cmp_cb;
|
||||
tBTM_SET_CSA_SUPPORT_CMPL_CBACK *set_csa_support_cmpl_cb;
|
||||
tBTM_SET_VENDOR_EVT_MASK_CBACK *set_vendor_evt_mask_cmpl_cb;
|
||||
} tBTM_BLE_CB;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -1955,4 +1955,26 @@ BOOLEAN btsnd_hcic_ble_set_csa_support (UINT8 csa_select)
|
||||
btu_hcif_send_cmd (LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOLEAN btsnd_hcic_ble_set_vendor_evt_mask (UINT32 evt_mask)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
if ((p = HCI_GET_CMD_BUF (HCIC_PARAM_SIZE_BLE_SET_VENDOR_EVT_MASK)) == NULL) {
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_SET_VENDOR_EVT_MASK;
|
||||
p->offset = 0;
|
||||
|
||||
UINT16_TO_STREAM (pp, HCI_VENDOR_BLE_SET_EVT_MASK);
|
||||
UINT8_TO_STREAM (pp, HCIC_PARAM_SIZE_BLE_SET_VENDOR_EVT_MASK);
|
||||
UINT32_TO_STREAM (pp, evt_mask);
|
||||
|
||||
btu_hcif_send_cmd (LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
@ -201,6 +201,9 @@ typedef void (tBTM_SET_LOCAL_PRIVACY_CBACK) (UINT8 status);
|
||||
typedef void (tBTM_SET_RPA_TIMEOUT_CMPL_CBACK) (UINT8 status);
|
||||
|
||||
typedef void (tBTM_ADD_DEV_TO_RESOLVING_LIST_CMPL_CBACK) (UINT8 status);
|
||||
|
||||
typedef void (tBTM_BLE_VENDOR_HCI_EVT_CBACK) (UINT8 subevt_code, UINT8 param_len, UINT8 *params);
|
||||
|
||||
/*****************************************************************************
|
||||
** DEVICE DISCOVERY - Inquiry, Remote Name, Discovery, Class of Device
|
||||
*****************************************************************************/
|
||||
|
@ -1008,6 +1008,7 @@ typedef void (tBTM_UPDATE_DUPLICATE_EXCEPTIONAL_LIST_CMPL_CBACK) (tBTM_STATUS st
|
||||
typedef void (tBTM_CLEAR_ADV_CMPL_CBACK) (UINT8 status);
|
||||
typedef void (tBTM_SET_PRIVACY_MODE_CMPL_CBACK) (tBTM_STATUS status);
|
||||
typedef void (tBTM_SET_CSA_SUPPORT_CMPL_CBACK) (tBTM_STATUS status);
|
||||
typedef void (tBTM_SET_VENDOR_EVT_MASK_CBACK) (tBTM_STATUS status);
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#define BTM_BLE_5_GAP_READ_PHY_COMPLETE_EVT 1
|
||||
@ -1383,6 +1384,7 @@ extern "C" {
|
||||
*******************************************************************************/
|
||||
void BTM_BleRegiseterConnParamCallback(tBTM_UPDATE_CONN_PARAM_CBACK *update_conn_param_cb);
|
||||
void BTM_BleRegiseterPktLengthChangeCallback(tBTM_SET_PKT_DATA_LENGTH_CBACK *ptk_len_chane_cb);
|
||||
void BTM_BleRegisterVendorHciEventCallback(tBTM_BLE_VENDOR_HCI_EVT_CBACK *vendor_hci_evt_cb);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@ -2739,6 +2741,19 @@ BOOLEAN BTM_BleSetPrivacyMode(UINT8 addr_type,
|
||||
*******************************************************************************/
|
||||
BOOLEAN BTM_BleSetCsaSupport (UINT8 csa_select, tBTM_SET_CSA_SUPPORT_CMPL_CBACK *p_callback);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleSetVendorEventMask
|
||||
**
|
||||
** Description This function is called to set the vendor HCI event mask
|
||||
**
|
||||
** Parameters evt_mask - vendor HCI event mask.
|
||||
** p_callback - Callback function to be called when the operation is completed.
|
||||
**
|
||||
** Returns TRUE if the operation was successful, otherwise FALSE.
|
||||
**
|
||||
*******************************************************************************/
|
||||
BOOLEAN BTM_BleSetVendorEventMask(UINT32 evt_mask, tBTM_SET_VENDOR_EVT_MASK_CBACK *p_callback);
|
||||
/*
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -422,6 +422,7 @@
|
||||
#define HCI_SUBCODE_BLE_RD_STATIC_ADDR 0x0B
|
||||
#define HCI_SUBCODE_BLE_CLEAR_ADV 0x0C
|
||||
#define HCI_SUBCODE_BLE_SET_CSA_SUPPORT 0x12
|
||||
#define HCI_SUBCODE_BLE_SET_VENDOR_EVT_MASK 0x16
|
||||
#define HCI_SUBCODE_BLE_MAX 0x7F
|
||||
|
||||
//ESP BT subcode define
|
||||
@ -469,6 +470,8 @@
|
||||
#define HCI_VENDOR_BLE_CLEAR_ADV HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_CLEAR_ADV)
|
||||
/* BLE set CSA support */
|
||||
#define HCI_VENDOR_BLE_SET_CSA_SUPPORT HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_SET_CSA_SUPPORT)
|
||||
/* BLE set vendor event mask */
|
||||
#define HCI_VENDOR_BLE_SET_EVT_MASK HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_SET_VENDOR_EVT_MASK)
|
||||
//ESP BT HCI CMD
|
||||
|
||||
/* subcode for multi adv feature */
|
||||
@ -824,6 +827,9 @@
|
||||
#define HCI_BLE_CHNL_MAP_SIZE 5
|
||||
|
||||
#define HCI_VENDOR_SPECIFIC_EVT 0xFF /* Vendor specific events */
|
||||
#define HCI_VSE_LE_LEGACY_SCAN_REQ_RECEIVED_EVT 0xC0
|
||||
#define HCI_VSE_LE_CHAN_MAP_UPDATE_CMPL_EVT 0xC1
|
||||
#define HCI_VSE_LE_EVT_MAX 0xFF
|
||||
#define HCI_NAP_TRACE_EVT 0xFF /* was define 0xFE, 0xFD, change to 0xFF
|
||||
because conflict w/ TCI_EVT and per
|
||||
specification compliant */
|
||||
|
@ -756,6 +756,7 @@ void btsnd_hcic_vendor_spec_cmd (BT_HDR *buffer, UINT16 opcode,
|
||||
#define HCIC_PARAM_SIZE_BLE_CLEAR_ADV 0
|
||||
#define HCIC_PARAM_SIZE_SET_PRIVACY_MODE 8
|
||||
#define HCIC_PARAM_SIZE_BLE_SET_CSA_SUPPORT 1
|
||||
#define HCIC_PARAM_SIZE_BLE_SET_VENDOR_EVT_MASK 4
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#define HCIC_PARAM_SIZE_BLE_READ_PHY 2
|
||||
#define HCIC_PARAM_SIZE_BLE_SET_DEF_PHY 3
|
||||
@ -915,6 +916,8 @@ BOOLEAN btsnd_hcic_ble_set_privacy_mode(UINT8 addr_type, BD_ADDR addr, UINT8 pri
|
||||
|
||||
BOOLEAN btsnd_hcic_ble_set_csa_support (UINT8 csa_select);
|
||||
|
||||
BOOLEAN btsnd_hcic_ble_set_vendor_evt_mask (UINT32 evt_mask);
|
||||
|
||||
#endif /* BLE_INCLUDED */
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
Loading…
x
Reference in New Issue
Block a user