Code Monkey home page Code Monkey logo

Comments (8)

mgkuhn avatar mgkuhn commented on May 20, 2024 2

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.

from serialports.jl.

scls19fr avatar scls19fr commented on May 20, 2024 1

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

from serialports.jl.

KronosTheLate avatar KronosTheLate commented on May 20, 2024 1

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.

from serialports.jl.

scls19fr avatar scls19fr commented on May 20, 2024

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

PS : JuliaIO/Roadmap#3

from serialports.jl.

scls19fr avatar scls19fr commented on May 20, 2024

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

from serialports.jl.

sjkelly avatar sjkelly commented on May 20, 2024

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.

from serialports.jl.

notinaboat avatar notinaboat commented on May 20, 2024

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)

from serialports.jl.

mgkuhn avatar mgkuhn commented on May 20, 2024

@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.

from serialports.jl.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.