Fix improv

This commit is contained in:
Rapsssito 2024-10-20 23:18:03 +02:00
parent f6bd3ad344
commit 214bd354a0

View file

@ -27,6 +27,9 @@ void ESP32ImprovComponent::setup() {
}); });
} }
#endif #endif
global_ble_server->on(BLEServerEvt::EmptyEvt::ON_DISCONNECT, [this](uint16_t conn_id) {
this->set_error_(improv::ERROR_NONE);
});
} }
void ESP32ImprovComponent::setup_characteristics() { void ESP32ImprovComponent::setup_characteristics() {
@ -83,7 +86,6 @@ void ESP32ImprovComponent::loop() {
// Setup the service // Setup the service
ESP_LOGD(TAG, "Creating Improv service"); ESP_LOGD(TAG, "Creating Improv service");
this->service_ = global_ble_server->create_service(ESPBTUUID::from_raw(improv::SERVICE_UUID), true); this->service_ = global_ble_server->create_service(ESPBTUUID::from_raw(improv::SERVICE_UUID), true);
this->service_->on_client_disconnect([this](const uint16_t conn_id) { this->set_error_(improv::ERROR_NONE); });
this->setup_characteristics(); this->setup_characteristics();
} }