mirror of
https://github.com/espressif/openthread.git
synced 2026-07-05 20:00:23 +00:00
7dc645a856
This commit changes the `Hdlc::Decoder` implementation to report non-zero length received frames shorter than FCS size as an error `OT_ERROR_PARSE` (instead of ignoring such frames during decoding). Since the recent changes in `Hdlc::Decoder` buffer model delegates the management of the frame buffer to the user of `Decoder`, clearing frame buffer after an error should be be performed by the `Decoder` user from the `FrameHandler` callback. The change in this commit addresses an issue where a small (single-byte) frame would not have been cleared from the decoder buffer and included in the next frame. This commit also updates the `test_hdlc` unit test to cover small frame error.