Page 1 of 1

How to wait UART untill timeout or data readed delimiter

Posted: Tue Mar 31, 2020 8:30 am
by JorgeSayMe
Good morning.

I am developing an ESP32 code where I use UART communications.

I want to know how can I wait until I have a delimiter on RX data or I wait X time, at the same time,

int uart_read_bytes(uart_port_t uart_num, char* buf, uint32_t length, TickType_t ticks_to_wait) always wait the number of ticks specified and I want to don´t wait more if I have the response.

Does anybody know how to do that?

Re: How to wait UART untill timeout or data readed delimiter

Posted: Tue Mar 31, 2020 2:19 pm
by mikemoy
There is an example in the examples folder for doing just that.

Re: How to wait UART untill timeout or data readed delimiter

Posted: Wed Apr 01, 2020 6:33 am
by JorgeSayMe
mikemoy wrote:
Tue Mar 31, 2020 2:19 pm
There is an example in the examples folder for doing just that.
Can you give me the link to this example?

Thanks in advance

Re: How to wait UART untill timeout or data readed delimiter

Posted: Wed Apr 01, 2020 11:32 pm
by akarg96
I hope you find this example helpful.
https://github.com/espressif/esp-idf/tr ... _rxtxtasks