From 58cd754e0733c22b456e2472e730e9d84b6f12f4 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Wed, 19 Oct 2022 10:50:32 +1300 Subject: [PATCH] Fix bad merge --- .../bluetooth_proxy/bluetooth_proxy.cpp | 72 ------------------- 1 file changed, 72 deletions(-) diff --git a/esphome/components/bluetooth_proxy/bluetooth_proxy.cpp b/esphome/components/bluetooth_proxy/bluetooth_proxy.cpp index 3f06cd5c25..cc1c178b08 100644 --- a/esphome/components/bluetooth_proxy/bluetooth_proxy.cpp +++ b/esphome/components/bluetooth_proxy/bluetooth_proxy.cpp @@ -164,78 +164,6 @@ void BluetoothProxy::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if } } -void BluetoothProxy::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, - esp_ble_gattc_cb_param_t *param) { - BLEClientBase::gattc_event_handler(event, gattc_if, param); - switch (event) { - case ESP_GATTC_DISCONNECT_EVT: { -#ifdef USE_API - api::global_api_server->send_bluetooth_device_connection(this->address_, false, this->mtu_, - param->disconnect.reason); - api::global_api_server->send_bluetooth_connections_free(this->get_bluetooth_connections_free(), - this->get_bluetooth_connections_limit()); -#endif - this->address_ = 0; - } - case ESP_GATTC_OPEN_EVT: { - if (param->open.status != ESP_GATT_OK && param->open.status != ESP_GATT_ALREADY_OPEN) { -#ifdef USE_API - api::global_api_server->send_bluetooth_device_connection(this->address_, false, this->mtu_, param->open.status); - -#endif - break; - } - break; - } - case ESP_GATTC_SEARCH_CMPL_EVT: { -#ifdef USE_API - api::global_api_server->send_bluetooth_device_connection(this->address_, true, this->mtu_); - api::global_api_server->send_bluetooth_connections_free(this->get_bluetooth_connections_free(), - this->get_bluetooth_connections_limit()); -#endif - break; - } - case ESP_GATTC_READ_DESCR_EVT: - case ESP_GATTC_READ_CHAR_EVT: { - if (param->read.conn_id != this->conn_id_) - break; - if (param->read.status != ESP_GATT_OK) { - ESP_LOGW(TAG, "Error reading char/descriptor at handle %d, status=%d", param->read.handle, param->read.status); - break; - } -#ifdef USE_API - api::BluetoothGATTReadResponse resp; - resp.address = this->address_; - resp.handle = param->read.handle; - resp.data.reserve(param->read.value_len); - for (uint16_t i = 0; i < param->read.value_len; i++) { - resp.data.push_back(param->read.value[i]); - } - api::global_api_server->send_bluetooth_gatt_read_response(resp); -#endif - break; - } - case ESP_GATTC_NOTIFY_EVT: { - if (param->notify.conn_id != this->conn_id_) - break; - ESP_LOGV(TAG, "ESP_GATTC_NOTIFY_EVT: handle=0x%x", param->notify.handle); -#ifdef USE_API - api::BluetoothGATTNotifyDataResponse resp; - resp.address = this->address_; - resp.handle = param->notify.handle; - resp.data.reserve(param->notify.value_len); - for (uint16_t i = 0; i < param->notify.value_len; i++) { - resp.data.push_back(param->notify.value[i]); - } - api::global_api_server->send_bluetooth_gatt_notify_data_response(resp); -#endif - break; - } - default: - break; - } -} - void BluetoothProxy::dump_config() { ESP_LOGCONFIG(TAG, "Bluetooth Proxy:"); } void BluetoothProxy::loop() {