squash again

squash the commit.
component/bt:Added the update_white_list & set_prefer_conn_params API to the bt project.

component/bt: Added the get white list size API & delete the read adv tx power API.

component/bt: Change the esp_gap_ble_api.h esp_ble_gap_set_prefer_conn_params API docs.

changed btm_find_dev to btm_find_or_alloc_dev

component/bt: Change the rssi API deep copy method.

component/bt: Change the code as comment in the gitlab.

squash the commit.
component/bt:Added the update_white_list & set_prefer_conn_params API to the bt project.

component/bt: Added the get white list size API & delete the read adv tx power API.

component/bt: Change the esp_gap_ble_api.h esp_ble_gap_set_prefer_conn_params API docs.

changed btm_find_dev to btm_find_or_alloc_dev

component/bt: Change the rssi API deep copy method.

component/bt: Change the code as comment in the gitlab.

component/bt: change the ESP_BLE_CONN_PARAM_UNDEF redefinition error.

component/bt: Change the ESP_BLE_IS_VALID_PARAM function with the compile error.
This commit is contained in:
Yulong
2017-08-14 23:24:36 -04:00
parent 3d7ec475d1
commit 8925a90d40
15 changed files with 408 additions and 17 deletions

View File

@@ -68,7 +68,6 @@ typedef uint8_t esp_ble_auth_req_t; /*!< combination of the above bit
#define ESP_IO_CAP_KBDISP 4 /*!< Keyboard display */ /* relate to BTM_IO_CAP_KBDISP in btm_api.h */
typedef uint8_t esp_ble_io_cap_t; /*!< combination of the io capability */
/// GAP BLE callback event type
typedef enum {
ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT = 0, /*!< When advertising data set complete, the event comes */
@@ -95,6 +94,9 @@ typedef enum {
ESP_GAP_BLE_SET_PKT_LENGTH_COMPLETE_EVT, /*!< When set pkt lenght complete, the event comes */
ESP_GAP_BLE_SET_LOCAL_PRIVACY_COMPLETE_EVT, /*!< When Enable/disable privacy on the local device complete, the event comes */
ESP_GAP_BLE_REMOVE_BOND_DEV_COMPLETE_EVT, /*!< When remove the bond device complete, the event comes */
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_EVT_MAX,
} esp_gap_ble_cb_event_t;
@@ -567,7 +569,7 @@ typedef union {
*/
struct ble_local_privacy_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicate the set local privacy operation success status */
} local_privacy_cmpl; /*!< Event parameter of ESP_GAP_BLE_SET_LOCAL_PRIVACY_COMPLETE_EVT */
} local_privacy_cmpl; /*!< Event parameter of ESP_GAP_BLE_SET_LOCAL_PRIVACY_COMPLETE_EVT */
/**
* @brief ESP_GAP_BLE_REMOVE_BOND_DEV_COMPLETE_EVT
*/
@@ -575,6 +577,29 @@ typedef union {
esp_bt_status_t status; /*!< Indicate the remove bond device operation success status */
esp_bd_addr_t bd_addr; /*!< The device address which has been remove from the bond list */
}remove_bond_dev_cmpl; /*!< Event parameter of ESP_GAP_BLE_REMOVE_BOND_DEV_COMPLETE_EVT */
/**
* @brief ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT
*/
struct ble_clear_bond_dev_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicate the clear bond device operation success status */
}clear_bond_dev_cmpl; /*!< Event parameter of ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT */
/**
* @brief ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT
*/
struct ble_get_bond_dev_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicate the get bond device operation success status */
uint8_t dev_num; /*!< Indicate the get number device in the bond list */
esp_ble_bond_dev_t *bond_dev; /*!< the pointer to the bond device Structure */
}get_bond_dev_cmpl; /*!< Event parameter of ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT */
/**
* @brief ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT
*/
struct ble_read_rssi_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicate the read adv tx power operation success status */
int8_t rssi; /*!< The ble remote device rssi value, the range is from -127 to 20, the unit is dbm,
if the RSSI cannot be read, the RSSI metric shall be set to 127. */
esp_bd_addr_t remote_addr; /*!< The remote device address */
} read_rssi_cmpl; /*!< Event parameter of ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT */
} esp_ble_gap_cb_param_t;
/**
@@ -726,6 +751,48 @@ esp_err_t esp_ble_gap_set_rand_addr(esp_bd_addr_t rand_addr);
*/
esp_err_t esp_ble_gap_config_local_privacy (bool privacy_enable);
/**
* @brief Add or remove device from white list
*
* @param[in] add_remove: the value is true if added the ble device to the white list, and false remove to the white list.
* @param[in] remote_bda: the remote device address add/remove from the white list.
* @return
* - ESP_OK : success
* - other : failed
*
*/
esp_err_t esp_ble_gap_update_whitelist(bool add_remove, esp_bd_addr_t remote_bda);
/**
* @brief Get the whitelist size in the controller
*
* @param[out] length: the white list length.
* @return
* - ESP_OK : success
* - other : failed
*
*/
esp_err_t esp_ble_gap_get_whitelist_size(uint16_t *length);
/**
* @brief This function is called to set the preferred connection
* parameters when default connection parameter is not desired before connecting.
* This API can only be used in the master role.
*
* @param[in] bd_addr: BD address of the peripheral
* @param[in] min_conn_int: minimum preferred connection interval
* @param[in] max_conn_int: maximum preferred connection interval
* @param[in] slave_latency: preferred slave latency
* @param[in] supervision_tout: preferred supervision timeout
*
* @return
* - ESP_OK : success
* - other : failed
*
*/
esp_err_t esp_ble_gap_set_prefer_conn_params(esp_bd_addr_t bd_addr,
uint16_t min_conn_int, uint16_t max_conn_int,
uint16_t slave_latency, uint16_t supervision_tout);
/**
* @brief Set device name to the local device
@@ -780,6 +847,26 @@ esp_err_t esp_ble_gap_config_adv_data_raw(uint8_t *raw_data, uint32_t raw_data_l
*/
esp_err_t esp_ble_gap_config_scan_rsp_data_raw(uint8_t *raw_data, uint32_t raw_data_len);
/**
* @brief This function is called to read the RSSI of remote device.
* The address of link policy results are returned in the gap callback function with
* ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT event.
*
* @param[in] remote_addr : The remote connection device address.
*
* @return
* - ESP_OK : success
* - other : failed
*/
esp_err_t esp_ble_gap_read_rssi(esp_bd_addr_t remote_addr);
<<<<<<< HEAD
=======
>>>>>>> e14a214... squash the commit.
#if (SMP_INCLUDED == TRUE)
/**
* @brief Set a GAP security parameter value. Overrides the default value.