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).
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
SerialPortobject (like aconst Refof the object) and maintain it that way. But perhaps it would be better if that functionality existed inLibSerialPort.jl. Simply put, just like there is anopenport function that accepts the port name as a string, there should be aclosefunction that accepts the port name as a string (and not just as a SerialPort).