Merge branch 'bugfix/btdm_standardize_code' into 'master'

component/bt: Standardize code

See merge request !1696
This commit is contained in:
Jiang Jiang Jian 2018-01-05 18:56:08 +08:00
commit a1b59679f9
2 changed files with 19 additions and 17 deletions

View File

@ -97,9 +97,11 @@ typedef enum {
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
@ -476,7 +478,7 @@ typedef enum {
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
*/
@ -616,12 +618,12 @@ typedef union {
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;
/**

View File

@ -691,9 +691,9 @@ static void btc_add_whitelist_complete_callback(UINT8 status, tBTM_WL_OPERATION
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, &param,
sizeof(esp_ble_gap_cb_param_t), NULL);