@@ -1102,11 +1102,58 @@ typedef struct {
11021102} esp_ble_gap_past_params_t ;
11031103#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
11041104
1105- typedef enum {
1105+ typedef enum {
11061106 ESP_BLE_NETWORK_PRIVACY_MODE = 0X00 , /*!< Network Privacy Mode for peer device (default) */
11071107 ESP_BLE_DEVICE_PRIVACY_MODE = 0X01 , /*!< Device Privacy Mode for peer device */
11081108} esp_ble_privacy_mode_t ;
11091109
1110+ #define ESP_BLE_VENDOR_SCAN_REQ_RECV_EVT_MASK BIT(0) /*!< Vendor BLE legacy SCAN_REQ received event mask */
1111+ #define ESP_BLE_VENDOR_CHMAP_UPDATE_EVT_MASK BIT(1) /*!< Vendor BLE channel map update event mask */
1112+ #define ESP_BLE_VENDOR_SLEEP_WAKEUP_EVT_MASK BIT(3) /*!< Vendor BLE sleep wakeup event mask */
1113+ #define ESP_BLE_VENDOR_CONN_REQ_RECV_EVT_MASK BIT(4) /*!< Vendor BLE CONNECT_IND and AUX_CONNECT_REQ received event mask */
1114+ #define ESP_BLE_VENDOR_CONN_RSP_RECV_EVT_MASK BIT(5) /*!< Vendor BLE AUX_CONNECT_RSP received event mask */
1115+ typedef uint32_t esp_ble_vendor_evt_mask_t ;
1116+
1117+ #define ESP_BLE_VENDOR_PDU_RECV_EVT (0) /*!< Vendor BLE specify PDU received event */
1118+ #define ESP_BLE_VENDOR_CHAN_MAP_UPDATE_EVT (1) /*!< Vendor BLE channel map update complete event */
1119+ #define ESP_BLE_VENDOR_SLEEP_WAKEUP_EVT (2) /*!< Vendor BLE sleep wakeup event */
1120+ typedef uint8_t esp_ble_vendor_evt_t ;
1121+
1122+ typedef enum {
1123+ ESP_BLE_VENDOR_PDU_SCAN_REQ = 0 , /*!< SCAN_REQ PDU type */
1124+ ESP_BLE_VENDOR_PDU_CONN_REQ , /*!< CONNECT_IND and AUX_CONNECT_REQ PDU type */
1125+ ESP_BLE_VENDOR_PDU_CONN_RSP , /*!< AUX_CONNECT_RSP PDU type */
1126+ } esp_ble_vendor_pdu_t ;
1127+
1128+ /**
1129+ * @brief BLE vendor event parameters union
1130+ */
1131+ typedef union {
1132+ /**
1133+ * @brief ESP_BLE_VENDOR_PDU_RECV_EVT
1134+ */
1135+ struct ble_pdu_recv_evt_param {
1136+ esp_ble_vendor_pdu_t type ; /*!< The type of LE PDU */
1137+ uint8_t handle ; /*!< The handle of advertising set */
1138+ esp_ble_addr_type_t addr_type ; /*!< The address type of peer device */
1139+ esp_bd_addr_t peer_addr ; /*!< The address of peer device */
1140+ } pdu_recv ; /*!< Event parameter of ESP_BLE_VENDOR_PDU_RECV_EVT */
1141+ /**
1142+ * @brief ESP_BLE_VENDOR_CHAN_MAP_UPDATE_EVT
1143+ */
1144+ struct ble_chan_map_update_evt_param {
1145+ uint8_t status ; /*!< Indicate the channel map update status (HCI error code) */
1146+ uint16_t conn_handle ; /*!< The connection handle */
1147+ esp_gap_ble_channels ch_map ; /*!< The channel map after updated */
1148+ } chan_map_update ; /*!< Event parameter of ESP_BLE_VENDOR_CHAN_MAP_UPDATE_EVT */
1149+ /**
1150+ * @brief ESP_BLE_VENDOR_SLEEP_WAKEUP_EVT
1151+ */
1152+ struct ble_sleep_wakeup_evt_param {
1153+ // No parameters
1154+ } sleep_wakeup ; /*!< Event parameter of ESP_BLE_VENDOR_SLEEP_WAKEUP_EVT */
1155+ } esp_ble_vendor_evt_param_t ;
1156+
11101157/**
11111158* @brief path loss report parameters
11121159*/
@@ -1258,12 +1305,6 @@ typedef union {
12581305 struct ble_adv_stop_cmpl_evt_param {
12591306 esp_bt_status_t status ; /*!< Indicate adv stop operation success status */
12601307 } adv_stop_cmpl ; /*!< Event parameter of ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT */
1261- /**
1262- * @brief ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT
1263- */
1264- struct ble_adv_clear_cmpl_evt_param {
1265- esp_bt_status_t status ; /*!< Indicate adv clear operation success status */
1266- } adv_clear_cmpl ; /*!< Event parameter of ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT */
12671308#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
12681309 /**
12691310 * @brief ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT
@@ -1665,6 +1706,19 @@ typedef union {
16651706 esp_ble_dtm_update_evt_t update_evt ; /*!< DTM state change event, 0x00: DTM TX start, 0x01: DTM RX start, 0x02:DTM end */
16661707 uint16_t num_of_pkt ; /*!< number of packets received, only valid if update_evt is DTM_TEST_STOP_EVT and shall be reported as 0 for a transmitter */
16671708 } dtm_state_update ; /*!< Event parameter of ESP_GAP_BLE_DTM_TEST_UPDATE_EVT */
1709+ /**
1710+ * @brief ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT
1711+ */
1712+ struct ble_set_privacy_mode_cmpl_evt_param {
1713+ esp_bt_status_t status ; /*!< Indicate privacy mode set operation success status */
1714+ } set_privacy_mode_cmpl ; /*!< Event parameter of ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT */
1715+ #if (BLE_VENDOR_HCI_EN == TRUE )
1716+ /**
1717+ * @brief ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT
1718+ */
1719+ struct ble_adv_clear_cmpl_evt_param {
1720+ esp_bt_status_t status ; /*!< Indicate adv clear operation success status */
1721+ } adv_clear_cmpl ; /*!< Event parameter of ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT */
16681722 /**
16691723 * @brief ESP_GAP_BLE_VENDOR_CMD_COMPLETE_EVT
16701724 */
@@ -1673,12 +1727,6 @@ typedef union {
16731727 uint16_t param_len ; /*!< The length of parameter buffer */
16741728 uint8_t * p_param_buf ; /*!< The point of parameter buffer */
16751729 } vendor_cmd_cmpl ; /*!< Event parameter of ESP_GAP_BLE_VENDOR_CMD_COMPLETE_EVT */
1676- /**
1677- * @brief ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT
1678- */
1679- struct ble_set_privacy_mode_cmpl_evt_param {
1680- esp_bt_status_t status ; /*!< Indicate privacy mode set operation success status */
1681- } set_privacy_mode_cmpl ; /*!< Event parameter of ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT */
16821730 /**
16831731 * @brief ESP_GAP_BLE_SET_CSA_SUPPORT_COMPLETE_EVT
16841732 */
@@ -1695,10 +1743,12 @@ typedef union {
16951743 * @brief ESP_GAP_BLE_VENDOR_HCI_EVT
16961744 */
16971745 struct ble_vendor_hci_event_evt_param {
1698- uint8_t subevt_code ; /*!< Subevent code for vendor HCI event, the range is 0xC0 to 0xFF */
1699- uint8_t param_len ; /*!< The length of the event parameter buffer */
1700- uint8_t * param_buf ; /*!< The pointer of the event parameter buffer */
1701- } vendor_hci_evt ; /*!< Event parameter buffer of ESP_GAP_BLE_VENDOR_HCI_EVT */
1746+ esp_ble_vendor_evt_t subevt_code ; /*!< Subevent code for BLE vendor HCI event */
1747+ esp_ble_vendor_evt_param_t param ; /*!< Event parameter of BLE vendor HCI subevent */
1748+ uint8_t param_len ; /*!< The length of the event parameter buffer (for internal use only) */
1749+ uint8_t * param_buf ; /*!< The pointer of the event parameter buffer (for internal use only) */
1750+ } vendor_hci_evt ; /*!< Event parameter of ESP_GAP_BLE_VENDOR_HCI_EVT */
1751+ #endif // #if (BLE_VENDOR_HCI_EN == TRUE)
17021752#if (BLE_FEAT_POWER_CONTROL_EN == TRUE )
17031753 /**
17041754 * @brief ESP_GAP_BLE_ENH_READ_TRANS_PWR_LEVEL_EVT
@@ -3032,14 +3082,13 @@ esp_err_t esp_ble_gap_set_csa_support(uint8_t csa_select);
30323082/**
30333083 * @brief This function is used to control which vendor events are generated by the HCI for the Host.
30343084 *
3035- * @param[in] event_mask: Bit0: Legacy scan request received event
3036- * Bit1: Vendor channel map update complete event
3085+ * @param[in] event_mask: The BLE vendor HCI event mask
30373086 *
30383087 * @return
30393088 * - ESP_OK : success
30403089 * - other : failed
30413090 */
3042- esp_err_t esp_ble_gap_set_vendor_event_mask (uint32_t event_mask );
3091+ esp_err_t esp_ble_gap_set_vendor_event_mask (esp_ble_vendor_evt_mask_t event_mask );
30433092
30443093/**
30453094 * @brief This function is used to read the current and maximum transmit power levels of the local Controller.
0 commit comments