Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename SerialPorts.jl PySerialPorts.jl #24

Open
scls19fr opened this issue Aug 19, 2018 · 8 comments
Open

Rename SerialPorts.jl PySerialPorts.jl #24

scls19fr opened this issue Aug 19, 2018 · 8 comments

Comments

@scls19fr
Copy link
Contributor

Following JuliaIO/LibSerialPort.jl#20 (comment)
maybe we should consider renaming SerialPorts.jl PySerialPorts.jl which is more explicit about what this package actualy do.

@scls19fr
Copy link
Contributor Author

scls19fr commented Mar 27, 2019

SerialPorts.jl could first use PySerialPorts.jl and later LibSerialPorts.jl

PS : JuliaIO/Roadmap#3

@mgkuhn
Copy link

mgkuhn commented Apr 15, 2020

The name SerialPorts.jl could also be reserved for a future native Julia serial-port library, which might be needed to fully integrate non-blocking serial-port communication with the multi-threading and asynchronous I/O capabilities of libuv and Julia. However, that's a non-trivial piece of work, because POSIX and Win32 have completely different serial-port APIs.

@scls19fr
Copy link
Contributor Author

As discussed in JuliaIO/Roadmap#3 (comment) renaming SerialPorts.jl to PySerialPorts.jl should be considered

A first step could be to create PySerialPorts with exactly same code as SerialPorts and publish it
Then deprecating SerialPorts to ask to use either PySerialPorts if looking at a Python implementation of serial port or LibSerialPort for a Julia wrapper to C library libserialport.

Pinging @KronosTheLate @andrewadare @sjkelly

@KronosTheLate
Copy link

I was recently looking for Serial comunications packages for Julia, and found the naming confusing. SerialPorts.jl sounds very straightforward, but requires a Python installation I don't have. Whereas LibSerialPorts sounded more specific and I did not know what the "Lib" ment, but it seems that it is the more straightforward solution for what I have in mind. This renaming would have made it faster and easier for me to orient myself in the package options.

@scls19fr
Copy link
Contributor Author

scls19fr commented Dec 10, 2020

A @JuliaIO owner https://github.com/JuliaIO should create PySerialPorts.jl repository under JuliaIO
Pinging @andreasnoack @ararslan @tanmaykm @sjkelly and all...

@sjkelly
Copy link
Member

sjkelly commented Dec 10, 2020

I don't really have the time to champion a package rename. Happy to let someone else do it.

When I created this package 6 years ago the name made sense as it was the only general package with this functionality. Apologies for confusion. In the interim I will cross reference libserialport in the readme.

sjkelly added a commit that referenced this issue Dec 10, 2020
@notinaboat
Copy link

It might also be useful to point out in the README that on Linux you can just open the serial port using Base.open

run(`stty -F /dev/ttyS0 38400 raw`)
serial_in = open("/dev/ttyS0", read=true, write=false)
serial_out = open("/dev/ttyS0", read=false, write=true)

@mgkuhn
Copy link

mgkuhn commented Feb 18, 2021

@notinaboat That's essentially what a native serial-port package would do on Linux, such that the async I/O facilities of libuv become available. However, it would also have to offer portable wrappers for the POSIX termios.h API, i.e.

speed_t cfgetispeed(const struct termios *);
speed_t cfgetospeed(const struct termios *);
int     cfsetispeed(struct termios *, speed_t);
int     cfsetospeed(struct termios *, speed_t);
int     tcdrain(int);
int     tcflow(int, int);
int     tcflush(int, int);
int     tcgetattr(int, struct termios *);
pid_t   tcgetsid(int);
int     tcsendbreak(int, int);
int     tcsetattr(int, int, struct termios *);

instead of calling the stty command-line tool, and some care would have to be taken with concurrency and task safety for calling these, so they play along well with libuv (especially the drain/flush functions for managing UART buffers).

But Julia also aims to be a multi-platform environment, and while other Unices, such as macOS, are likely to work quite similarly to Linux, Win32 has a rather different serial-port API. And ideally, much of that should be hidden from the user, such that they can move their Julia code between the platforms with ease. That's what the currently used C and Python libraries do, but they bypass libuv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants