Page 1 of 1

Posix select() on uart

Posted: Thu Nov 30, 2017 6:46 pm
by spanky
I would like to use a library that makes extensive use of the select.h library in linux. It looks like some of this functionality has been implemented in lwip. Also in parts of newlib, but not for this particular architecture.

Are there any plans to implement this basic library? (basically everything in the man pages for select https://linux.die.net/man/2/select)

Its probably a bit trickier as that would require treating the uart as a basic file descriptor. Still, I figured I'd ask.

Re: Posix select() on uart

Posted: Fri Dec 01, 2017 6:40 am
by ESP_Angus
Hi spanky,

We treat the UART as a file descriptor now, via the "vfs" layer you have stdin/stdout/stderr:
http://esp-idf.readthedocs.io/en/latest ... e/vfs.html

Unfortunately select() currently only works with LWIP sockets. There are plans to expand this support to other vfs "drivers" in IDF V3.1, which will include implementing it for the serial uart.


Angus