Component/bt: add new cmd for blufi ,ESP32 close a gatt connection

This commit is contained in:
zhiweijian
2017-04-21 11:04:53 +08:00
parent 8f9707fd07
commit fb45ee7a4c
7 changed files with 52 additions and 0 deletions
@@ -88,6 +88,9 @@ static uint8_t gl_sta_bssid[6];
static uint8_t gl_sta_ssid[32];
static int gl_sta_ssid_len;
/* connect infor*/
static uint8_t server_if;
static uint16_t conn_id;
static esp_err_t example_net_event_handler(void *ctx, system_event_t *event)
{
wifi_mode_t mode;
@@ -178,6 +181,8 @@ static void example_event_callback(esp_blufi_cb_event_t event, esp_blufi_cb_para
break;
case ESP_BLUFI_EVENT_BLE_CONNECT:
BLUFI_INFO("BLUFI ble connect\n");
server_if=param->connect.server_if;
conn_id=param->connect.conn_id;
esp_ble_gap_stop_advertising();
blufi_security_deinit();
blufi_security_init();
@@ -218,6 +223,10 @@ static void example_event_callback(esp_blufi_cb_event_t event, esp_blufi_cb_para
break;
}
case ESP_BLUFI_EVENT_RECV_SLAVE_DISCONNECT_BLE:
BLUFI_INFO("blufi close a gatt connection");
esp_blufi_close(server_if,conn_id);
break;
case ESP_BLUFI_EVENT_DEAUTHENTICATE_STA:
/* TODO */
break;