Files
esphome/tests/components/ld2450
Jonathan Swoboda 3dcaa552f7 [ld2450] Add frame header synchronization to fix initialization regression
The batch UART read change in #13818 exposed a latent bug where the
UART parser could start accumulating bytes mid-frame after module
restart, causing an infinite cycle of "Max command length exceeded"
warnings that prevented initialization.

Add header validation for the first 4 bytes of each frame, ensuring
the parser only accumulates data starting from a valid DATA_FRAME_HEADER
(AA FF 03 00) or CMD_FRAME_HEADER (FD FC FB FA). Non-matching bytes are
discarded until a valid frame start is found.

Fixes #14131

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 21:37:09 -05:00
..