-
Notifications
You must be signed in to change notification settings - Fork 16
Expose ioctl in LIBUV #10
Comments
ioctl is a bit of a God function. It's second parameter is more or less a device dependent blob that makes a ton of things possible, so not wanting to expose it in libuv is understandable. Also, it's a Linux/Unix function, so what should be used on Windows? Exposing ioctl may be asking for too much. Perhaps it would be better to propose a concrete set of functions related to serial ports in libuv, for example, functions that allow the following properties to be set for a file descriptor:
|
I know we kinda sorta rejected this earlier, but maybe we should revisit integrating the node-serialport apis into node core? |
If we look at the functionality provided by node today compared to 2009 when node-serialport was originally implemented, perhaps a lot of the functionality that's currently implemented in node-serialport is now available in node. For example, could something like the following JavaScript code be used to create two streams, one stream for serial port receive and one for serial port send?
These two streams could then be turned into a duplex stream with something like duplexify. At the end of the day, there's going to be more to it that this of course, but would this not be a large portion of what node-serialport is today? |
@fivdi that approach has been researched in the past by @voodootikigod, and the tl;dr is that it just doesn't provide enough of what we need. |
Can you tell me what it doesn't provide or link to an explanation of what it doesn't provide? |
ioctl |
The sample code above doesn't provide ioctl, but it's not supposed to. Instead, it call calls currently non-existent functions from libuv in the rxstream
These new libuv functions would be used to set the baudrate, parity, character size, etc, ... |
Ah I'm sorry, I see what you're getting at now, I missed the "new methods to set baudrate, parity, etc" bit. People are always saying "why don't you just use TTY", so it's a bit of a sore spot. |
Brian and Bryan, Let me come up with the list of what we need added (sorry for delay was Chris Williams @voodootikigod http://twitter.com/voodootikigod | GitHub The things I make that you should check out: Help me end the negativity on the internet, share this On Mon, Jun 1, 2015 at 5:28 PM, Bryan Hughes [email protected]
|
This is the PR you can monitor. Help in reviewing is more than welcome!
|
This is tightly related to issue #2 |
Small update from the libuv PR listed above. That PR was closed and a new one opened at libuv/libuv#484 |
Hey gang, a new milestone has been added to libuv for the forthcoming 1.8.0 release and it does not include our favorite PR. I've added a comment requesting its inclusion but if y'all can think of additional, compelling arguments in favor of it, I don't think that would hurt to add them. |
@dtex part of this comment from the corresponding PR is:
My interpretation of this is that the |
That may be part of it but @saghul said he's got some new notes to hand off to the requester and that it's unlikely this will land in 1.8.0 |
Yes, my current plan is to slim the idea even more, and make it even more flexible (specially on the Unix side). Will update the libuv issue soon. |
ping any update ? |
Not really. Alas this has stalled. |
Which OSs can we target? If it's only linux, it would probably be more secure to set said params with a
Not sure whether you meant to specifically include Would you mind sharing what you plan to use ioctl for? |
Interaction with i2c and other GPIO pins has similar issues. It's really important to manage all of these blocking moments in one way that is uniformly consistent. epoll(2) and other blocking requests for the next event should be possible to use because applications have done this for years. |
If we could set rate, bit and parity for serial communications we would no longer need a compile step for Node-Serialport installations.
According to libuv/libuv#333 this is not possible but we'd like to get a handle and why and explore alternatives.
The text was updated successfully, but these errors were encountered: