@@ -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*/
@@ -1695,10 +1742,11 @@ typedef union {
16951742 * @brief ESP_GAP_BLE_VENDOR_HCI_EVT
16961743 */
16971744 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 */
1745+ esp_ble_vendor_evt_t subevt_code ; /*!< Subevent code for BLE vendor HCI event */
1746+ esp_ble_vendor_evt_param_t param ; /*!< Event parameter of BLE vendor HCI subevent */
1747+ uint8_t param_len ; /*!< The length of the event parameter buffer (for internal use only) */
1748+ uint8_t * param_buf ; /*!< The pointer of the event parameter buffer (for internal use only) */
1749+ } vendor_hci_evt ; /*!< Event parameter of ESP_GAP_BLE_VENDOR_HCI_EVT */
17021750#if (BLE_FEAT_POWER_CONTROL_EN == TRUE )
17031751 /**
17041752 * @brief ESP_GAP_BLE_ENH_READ_TRANS_PWR_LEVEL_EVT
@@ -3032,14 +3080,13 @@ esp_err_t esp_ble_gap_set_csa_support(uint8_t csa_select);
30323080/**
30333081 * @brief This function is used to control which vendor events are generated by the HCI for the Host.
30343082 *
3035- * @param[in] event_mask: Bit0: Legacy scan request received event
3036- * Bit1: Vendor channel map update complete event
3083+ * @param[in] event_mask: The BLE vendor HCI event mask
30373084 *
30383085 * @return
30393086 * - ESP_OK : success
30403087 * - other : failed
30413088 */
3042- esp_err_t esp_ble_gap_set_vendor_event_mask (uint32_t event_mask );
3089+ esp_err_t esp_ble_gap_set_vendor_event_mask (esp_ble_vendor_evt_mask_t event_mask );
30433090
30443091/**
30453092 * @brief This function is used to read the current and maximum transmit power levels of the local Controller.
0 commit comments