Open AguileraG opened 1 month ago
Thanks for raising this issue! Incidentally, we got another bug report about UART VFS reading behavior, and after fixing that other issue, early return on a newline character can actually be removed, fixing your issue as well.
We'll update this ticket once the fix is merged.
Is your feature request related to a problem?
Both
uart_read()
anduart_write()
treat end-of-line characters as special characters. Most of this specific behaviour can be disabled by configuring the VFS driver with theESP_LINE_ENDINGS_LF
line ending mode.However,
uart_read()
always stops reading data when a'\n'
character is received, even though more bytes may be available on the RX buffer (see line 285).This behaviour cannot be disabled in any way, and it makes it more difficult to work with binary protocols which treat
'\n'
as a regular byte.Describe the solution you'd like.
I would like for the UART VFS driver to be configurable so that all incoming characters are treated as regular bytes, so that when
uart_read()
is called, all data available in the RX buffer is read.Describe alternatives you've considered.
Right now, this issue can be worked around by calling
read()
and thereforeuart_read()
in a loop until the expected number of bytes is received.However, this approach makes it more difficult to perform non-blocking reads with
select()
orpoll()
, as the application must keep track of how long each call toread()
takes.Additional context.
No response