From b80f40676a82e88f124abf6289117f7fc478c8a4 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 1 Nov 2025 15:02:51 -0500 Subject: [PATCH] fix ble latency --- esphome/components/esp32_ble/ble.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/esphome/components/esp32_ble/ble.h b/esphome/components/esp32_ble/ble.h index a91d8756a8..facb0e5853 100644 --- a/esphome/components/esp32_ble/ble.h +++ b/esphome/components/esp32_ble/ble.h @@ -244,19 +244,6 @@ inline void ESP32BLE::notify_main_loop_() { lwip_send(this->notify_fd_, &dummy, 1, 0); } } - -inline void ESP32BLE::drain_event_notifications_() { - // Called from main loop to drain any pending notifications - // Must check is_socket_ready() to avoid blocking on empty socket - if (this->notify_fd_ >= 0 && esphome::App.is_socket_ready(this->notify_fd_)) { - char buffer[BLE_EVENT_NOTIFY_DRAIN_BUFFER_SIZE]; - // Drain all pending notifications with non-blocking reads - // Multiple BLE events may have triggered multiple writes, so drain until EWOULDBLOCK - while (lwip_recvfrom(this->notify_fd_, buffer, sizeof(buffer), 0, nullptr, nullptr) > 0) { - // Just draining, no action needed - } - } -} #endif // USE_SOCKET_SELECT_SUPPORT template class BLEEnabledCondition : public Condition {