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
@@ -25,9 +25,11 @@ extern "C" {
#define ESP_BLUFI_RECV_DATA_LEN_MAX (64+1)
#define ESP_BLUFI_EVENT_INIT_FINISH 0
#define ESP_BLUFI_EVENT_DEINIT_FINISH 1
#define ESP_BLUFI_EVENT_RECV_DATA 2
typedef enum {
ESP_BLUFI_EVENT_INIT_FINISH = 0,
ESP_BLUFI_EVENT_DEINIT_FINISH = 1,
ESP_BLUFI_EVENT_RECV_DATA = 2,
} esp_blufi_cb_event_t;
/// BLUFI config status
typedef enum {
@@ -74,6 +76,14 @@ typedef union {
} recv_data; /*!< Blufi callback param of ESP_BLUFI_EVENT_RECV_DATA */
} esp_blufi_cb_param_t;
/**
* @brief BLUFI callback function type
* @param event : Event type
* @param param : Point to callback parameter, currently is union type
*/
typedef void (* esp_blufi_cb_t)(esp_blufi_cb_event_t event, esp_blufi_cb_param_t *param);
/**
*
* @brief This function is called to receive blufi callback event
@@ -83,7 +93,7 @@ typedef union {
* @return ESP_OK - success, other - failed
*
*/
esp_err_t esp_blufi_register_callback(esp_profile_cb_t callback);
esp_err_t esp_blufi_register_callback(esp_blufi_cb_t callback);
/**
*