1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-24 04:33:49 +01:00
This commit is contained in:
J. Nick Koston
2025-09-29 18:07:46 -05:00
parent e7750250e0
commit d802d70311
12 changed files with 50 additions and 476 deletions

View File

@@ -153,14 +153,18 @@ void BLEServer::gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t ga
case ESP_GATTS_CONNECT_EVT: {
ESP_LOGD(TAG, "BLE Client connected");
this->add_client_(param->connect.conn_id);
this->emit_on_connect_(param->connect.conn_id);
if (this->on_connect_callback_) {
this->on_connect_callback_(param->connect.conn_id);
}
break;
}
case ESP_GATTS_DISCONNECT_EVT: {
ESP_LOGD(TAG, "BLE Client disconnected");
this->remove_client_(param->disconnect.conn_id);
this->parent_->advertising_start();
this->emit_on_disconnect_(param->disconnect.conn_id);
if (this->on_disconnect_callback_) {
this->on_disconnect_callback_(param->disconnect.conn_id);
}
break;
}
case ESP_GATTS_REG_EVT: {