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

Reaquire a port by id #83

Open
yakir12 opened this issue Mar 16, 2021 · 1 comment
Open

Reaquire a port by id #83

yakir12 opened this issue Mar 16, 2021 · 1 comment

Comments

@yakir12
Copy link
Contributor

yakir12 commented Mar 16, 2021

A common situation I've encountered: I have the port name (i.e. as a String, e.g. "/dev/serial/by-id/usb-Arduino__www.arduino.cc__0043_95735353032351F0F0F0-if00"), I open it, do stuff with the SerialPort object, and then for various reasons I "lose" the SerialPort object. I then have no means of reacquiring it. In fact, the only real option I have is to restart the Julia session and get it by name again.

One way would be for me to keep my own record of the SerialPort object (like a const Ref of the object) and maintain it that way. But perhaps it would be better if that functionality existed in LibSerialPort.jl. Simply put, just like there is an open port function that accepts the port name as a string, there should be a close function that accepts the port name as a string (and not just as a SerialPort).

@yakir12
Copy link
Contributor Author

yakir12 commented Mar 16, 2021

Note worthy: I just found out that I can open and close the same SerialPort instance as much as I like, so I could just a keep a const sp and that's it...

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

1 participant