You can maybe try to use the pipe interface as it accepts arbitrary file descriptors. That's what I use to create pty's in luvit.
https://luvit.io/blog/pty-ffi.html On Fri, May 27, 2016 at 12:52 AM, Jörg Krause <[email protected]> wrote: > Many thanks for the link! I think fs_read() does not work for Linux serial > ports as underlying read() system call reads EOF from the serial interface. > > If I try to use a Luvits ReadStream interface, the 'end' callback is > called before I receive any data. > > So, lets hope there will be support for serial ports in libuv soon. > > On Wednesday, May 25, 2016 at 5:46:41 PM UTC+2, Tim Caswell wrote: >> >> I don't have any idea what's wrong, but several of us have been trying to >> get serial support (or at least the ability) into upstream libuv, you can >> see much of the history at https://github.com/libuv/libuv/pull/484 >> >> On Wed, May 25, 2016 at 6:15 AM, Jörg Krause <[email protected]> >> wrote: >> >>> Hi, >>> >>> I am trying to read data from a serial port using Luvit. My simple >>> example is running, however, I have an issue with fs_read() as it calls the >>> callback function even if no data are received. >>> >>> This is my example: >>> https://gist.github.com/joerg-krause/cba5a56577a0483ceb8ea4ecda5ff0ba >>> >>> This is the output: >>> >>> # luvit main.lua >>> '' >>> '' >>> '' >>> '' >>> '' >>> >>> My problem with this issue is that it consumes much more CPU cycles on >>> my embedded Linux system than reading from "/dev/input/event0". >>> >>> Any ideas what's wrong here? >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "luvit" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- > You received this message because you are subscribed to the Google Groups > "luvit" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "luvit" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
