ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT, /*!< When clear the bond device clear complete, the event comes */
ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT, /*!< When get the bond device list complete, the event comes */
ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT, /*!< When read the rssi complete, the event comes */
- ESP_GAP_BLE_ADD_WHITELIST_COMPLETE_EVT, /*!< When add or remove whitelist complete, the event comes */
+ ESP_GAP_BLE_UPDATE_WHITELIST_COMPLETE_EVT, /*!< When add or remove whitelist complete, the event comes */
ESP_GAP_BLE_EVT_MAX,
} esp_gap_ble_cb_event_t;
+/// This is the old name, just for backwards compatibility
+#define ESP_GAP_BLE_ADD_WHITELIST_COMPLETE_EVT ESP_GAP_BLE_UPDATE_WHITELIST_COMPLETE_EVT
/// Advertising data maximum length
#define ESP_BLE_ADV_DATA_LEN_MAX 31
uint8_t flag; /*!< Advertising flag of discovery mode, see BLE_ADV_DATA_FLAG detail */
} esp_ble_adv_data_t;
-/// Ble scan type
+/// Ble scan type
typedef enum {
BLE_SCAN_TYPE_PASSIVE = 0x0, /*!< Passive scan */
BLE_SCAN_TYPE_ACTIVE = 0x1, /*!< Active scan */
typedef enum {
BLE_SCAN_FILTER_ALLOW_ALL = 0x0, /*!< Accept all :
1. advertisement packets except directed advertising packets not addressed to this device (default). */
- BLE_SCAN_FILTER_ALLOW_ONLY_WLST = 0x1, /*!< Accept only :
+ BLE_SCAN_FILTER_ALLOW_ONLY_WLST = 0x1, /*!< Accept only :
1. advertisement packets from devices where the advertiser’s address is in the White list.
2. Directed advertising packets which are not addressed for this device shall be ignored. */
BLE_SCAN_FILTER_ALLOW_UND_RPA_DIR = 0x2, /*!< Accept all :
} esp_ble_penc_keys_t; /*!< The key type*/
/**
-* @brief BLE CSRK keys
+* @brief BLE CSRK keys
*/
typedef struct
{
} esp_ble_pcsrk_keys_t; /*!< The pcsrk key type */
/**
-* @brief BLE pid keys
+* @brief BLE pid keys
*/
typedef struct
{
} esp_ble_lcsrk_keys; /*!< The csrk key type */
/**
-* @brief Structure associated with ESP_KEY_NOTIF_EVT
+* @brief Structure associated with ESP_KEY_NOTIF_EVT
*/
typedef struct
{
typedef enum{
ESP_BLE_WHITELIST_REMOVE = 0X00, /*!< remove mac from whitelist */
ESP_BLE_WHITELIST_ADD = 0X01, /*!< add address to whitelist */
-}esp_ble_wl_opration;
+}esp_ble_wl_opration_t;
/**
* @brief Gap callback parameters union
*/
*/
struct ble_adv_data_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicate the set advertising data operation success status */
- } adv_data_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT */
+ } adv_data_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT */
/**
* @brief ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT
*/
*/
struct ble_adv_data_raw_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicate the set raw advertising data operation success status */
- } adv_data_raw_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT */
+ } adv_data_raw_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT */
/**
* @brief ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT
*/
esp_bd_addr_t remote_addr; /*!< The remote device address */
} read_rssi_cmpl; /*!< Event parameter of ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT */
/**
- * @brief ESP_GAP_BLE_ADD_WHITELIST_COMPLETE_EVT
+ * @brief ESP_GAP_BLE_UPDATE_WHITELIST_COMPLETE_EVT
*/
- struct ble_add_whitelist_cmpl_evt_param {
+ struct ble_update_whitelist_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicate the add or remove whitelist operation success status */
- esp_ble_wl_opration wl_opration; /*!< The value is ESP_BLE_WHITELIST_ADD if add address to whitelist operation success, ESP_BLE_WHITELIST_REMOVE if remove address from the whitelist operation success */
- } add_whitelist_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADD_WHITELIST_COMPLETE_EVT */
+ esp_ble_wl_opration_t wl_opration; /*!< The value is ESP_BLE_WHITELIST_ADD if add address to whitelist operation success, ESP_BLE_WHITELIST_REMOVE if remove address from the whitelist operation success */
+ } update_whitelist_cmpl; /*!< Event parameter of ESP_GAP_BLE_UPDATE_WHITELIST_COMPLETE_EVT */
} esp_ble_gap_cb_param_t;
/**
* Suggest that dev_num value equal to esp_ble_get_bond_device_num().
*
* @param[out] dev_list: an array(buffer) of `esp_ble_bond_dev_t` type. Use for storing the bonded devices address.
-* The dev_list should be allocated by who call this API.
+* The dev_list should be allocated by who call this API.
* @return - ESP_OK : success
* - other : failed
*
btc_msg_t msg;
msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_GAP_BLE;
- msg.act = ESP_GAP_BLE_ADD_WHITELIST_COMPLETE_EVT;
- param.add_whitelist_cmpl.status = btc_hci_to_esp_status(status);
- param.add_whitelist_cmpl.wl_opration = wl_opration;
+ msg.act = ESP_GAP_BLE_UPDATE_WHITELIST_COMPLETE_EVT;
+ param.update_whitelist_cmpl.status = btc_hci_to_esp_status(status);
+ param.update_whitelist_cmpl.wl_opration = wl_opration;
ret = btc_transfer_context(&msg, ¶m,
sizeof(esp_ble_gap_cb_param_t), NULL);
}
case BTC_GAP_BLE_ACT_CONFIG_LOCAL_PRIVACY:
btc_ble_config_local_privacy(arg->cfg_local_privacy.privacy_enable, btc_set_local_privacy_callback);
- break;
+ break;
case BTC_GAP_BLE_ACT_UPDATE_WHITE_LIST:
BTA_DmUpdateWhiteList(arg->update_white_list.add_remove, arg->update_white_list.remote_bda, btc_add_whitelist_complete_callback);
break;
STREAM_TO_UINT8(key_size, arg->set_security_param.value);
bta_dm_co_ble_set_max_key_size(key_size);
break;
- }
+ }
default:
break;
}
break;
- }
+ }
case BTC_GAP_BLE_SECURITY_RSP_EVT: {
BD_ADDR bd_addr;
tBTA_DM_BLE_SEC_GRANT res = arg->sec_rsp.accept ? BTA_DM_SEC_GRANTED : BTA_DM_SEC_PAIR_NOT_SPT;