component/bt : change api for V2.0

1. change all gatt cb function to 3 args and function type. add gattc_if/gatts_if as second argument
2. delete gatt_if of "gatt cb param"
3. separate conn_id and gatt_if from conn_id
4. change the demo code as the gatt changed
This commit is contained in:
Tian Hao
2016-12-11 16:36:47 +08:00
parent 1ed584f896
commit c01dedcb06
23 changed files with 573 additions and 382 deletions

View File

@@ -31,7 +31,7 @@ typedef enum {
ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT , /*!< When scan response data set complete, the event comes */
ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT, /*!< When scan parameters set complete, the event comes */
ESP_GAP_BLE_SCAN_RESULT_EVT, /*!< When one scan result ready, the event comes each time */
}esp_gap_ble_cb_event_t;
} esp_gap_ble_cb_event_t;
/// Advertising data maximum length
#define ESP_BLE_ADV_DATA_LEN_MAX 31
@@ -257,6 +257,13 @@ typedef union {
} scan_rst; /*!< Event parameter of ESP_GAP_BLE_SCAN_RESULT_EVT */
} esp_ble_gap_cb_param_t;
/**
* @brief GAP callback function type
* @param event : Event type
* @param param : Point to callback parameter, currently is union type
*/
typedef void (* esp_gap_ble_cb_t)(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param);
/**
* @brief This function is called to occur gap event, such as scan result
*
@@ -267,7 +274,7 @@ typedef union {
* - other : failed
*
*/
esp_err_t esp_ble_gap_register_callback(esp_profile_cb_t callback);
esp_err_t esp_ble_gap_register_callback(esp_gap_ble_cb_t callback);
/**