ESP_GATTC_DISCONNECT_EVT only indicates that the link-layer disconnection
has started, not that the controller has fully freed resources (L2CAP
channels, ATT resources, HCI connection handle). Transitioning to IDLE
immediately allowed reconnection attempts before cleanup was complete,
causing the controller to reject new connections with status=133
(ESP_GATT_CONN_FAIL_ESTABLISH) or crash with ASSERT_PARAM in lld_evt.c.
This applies the same fix that was made for bluetooth_proxy in #10303
to the base BLEClientBase class, which is used by the ble_client
component.
Changes:
- DISCONNECT_EVT now transitions to DISCONNECTING instead of IDLE
- CLOSE_EVT (already existing) handles the final IDLE transition
- connect() now blocks while in DISCONNECTING state
- OPEN_EVT ignores events received during DISCONNECTING state
Replace the heap-allocated tx_buffer_ (new char[]) with a compile-time
sized inline array using ESPHOME_LOGGER_TX_BUFFER_SIZE define. This
eliminates a heap allocation during Logger construction, saving ~513
bytes of heap on memory-constrained devices like BK72xx.
Changes:
- Add ESPHOME_LOGGER_TX_BUFFER_SIZE define set from Python config
- Change tx_buffer_ from char* to char[ESPHOME_LOGGER_TX_BUFFER_SIZE+1]
- Remove tx_buffer_size_ member field
- Update constructor to no longer take tx_buffer_size parameter
- Update all references to use the compile-time constant
Replace the heap-allocated tx_buffer_ (new char[]) with a compile-time
sized inline array using ESPHOME_LOGGER_TX_BUFFER_SIZE define. This
eliminates a heap allocation during Logger construction, saving ~513
bytes of heap on memory-constrained devices like BK72xx.
Changes:
- Add ESPHOME_LOGGER_TX_BUFFER_SIZE define set from Python config
- Change tx_buffer_ from char* to char[ESPHOME_LOGGER_TX_BUFFER_SIZE+1]
- Remove tx_buffer_size_ member field
- Update constructor to no longer take tx_buffer_size parameter
- Update all references to use the compile-time constant
WebServerBase was registered as a Component but never used the lifecycle -
no setup(), loop(), or dump_config(). The get_setup_priority() override
was dead code since there was nothing to schedule. It is just a shared
base class that holds the AsyncWebServer and handler list, with init/deinit
called manually by consumers via reference counting.
- Remove Component inheritance and register_component call
- Use C++17 nested namespace syntax
- Replace unique_ptr<AsyncWebServer> with raw pointer (server is never
deleted in practice - device runs until power loss)
- Remove unused includes (memory, component.h, application.h, helpers.h, log.h)
Replace the unwieldy 6-tuple with a frozen dataclass for clarity
and named attribute access at call sites.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Clarify MIN_TCP_SOCKETS comment: covers minimal configs (api-only);
when web_server is present its 5 sockets push past the minimum.
- Add MIN_TCP_LISTEN_SOCKETS = 2 alongside MIN_TCP/MIN_UDP for
consistency instead of hardcoding the value in libretiny.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
BK SDK sets TCP_SND_BUF=10×MSS on both plans but TCP_WND varies:
3×MSS (reduced plan) vs 10×MSS (default plan). Also update stale
minimum counts in docstring (8 TCP / 6 UDP).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>