add uv_device_t as stream on windows and Linux to handle device IO#484
add uv_device_t as stream on windows and Linux to handle device IO#484zhaozg wants to merge 1 commit into
Conversation
|
Would this also allow creating ptty sessions with libuv or does that need another primitive? I often have need for both creating local ptty sessions and communicating over serial to embedded devices. |
|
Does this work on OSX? Would be nice if it did. |
|
@zhaozg Do you have an example of opening a serial port and talking to it? I don't know enough about this level of C interfaces to figure it out on my own. |
|
@rphillips I without osx box, should have no result on osx. @creationix I have example on windows to support serial (through luv), but I think it would easy to work on linux(because we have ffi). https://github.com/zhaozg/luv/tree/device https://github.com/zhaozg/luvit/tree/extend/deps/serial |
|
Document ioctl calls used on all platforms serialport/node-serialport#555 |
9b03774 to
214af8f
Compare
|
@zhaozg , I would just like to make sure I understand the state of your PR. This is far out of my area of expertise so I am not qualified to look at the code and figure it out. Forgive me if I ask obvious or overly simple questions. This PR adds support for Windows, Linux and OSX but it has not been tested on OSX. Is that correct? In your response above you said "should have no result on osx". I'd just like to clarify what you meant by that. You also said "I think it would easy to work on linux(because we have ffi)". Am I correct in understanding that your pull request does not depend on FFI. You are just confident it will work because it can be done via FFI as well. Is that correct? Thank you for your time. This PR has the potential to be a really big deal for the Nodebots community. |
|
Hi @dtex
Yes, I do some test on windows and Linux, but not on others.
Because not test on osx, so I don't know what result when it work on osx.
Yes, and device only imp abstract IO management, But all kind devices have special ioctl or high level control APIs(eg. serial termios), that out of scope of this patch, use uv_fileno get raw device fd to finish high level controls. FFI will make that things easy done in script language,(just like luajit). So sorry for my English language to confused you. |
|
Further improvements here: batmaninpink@9274d73 I am using this to implement a VPN client for Windows / Linux / OS X - which works fine with the above commit. |
|
@batmaninpink Thanks for letting us know! A couple of comments: your patch was probably targeted at an older version of this patch, some of the changes no longer apply. And the |
|
Good msg from @batmaninpink I'll merge some code from your version manually. thanks. |
|
@zhaozg I suggest you don't. See my comment here: #484 (comment) |
|
@saghul I notice that, I'll add uv_device_open. |
|
Doh, updated here: batmaninpink@72553a2 @saghul @zhaozg |
66ef940 to
e90c6c7
Compare
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
I think that's a bit aggressive to delete that comment from @cjdelisle. It's a bit off topic, and seems to have a naive-but-understandable misunderstanding of the situation and relevant politics, so it's not particularly productive, but there's a separate button to mark and hide it as such. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
|
closed, here https://github.com/zhaozg/libuv |
|
no uv__process_device_shutdown_req, uv_stream_init, uv_connection_init, uv_insert_pending_req, uv_want_endgame |
reopen #379
older #19
oldest joyent/libuv#1580
TODO: rewrite simple test code.
This change is