Posix select() on uart

spanky
Posts: 13
Joined: Thu Nov 30, 2017 6:35 pm

Posix select() on uart

Postby spanky » Thu Nov 30, 2017 6:46 pm

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.

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Posix select() on uart

Postby ESP_Angus » Fri Dec 01, 2017 6:40 am

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

Who is online

Users browsing this forum: No registered users and 100 guests