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

Safe open #81

Open
yakir12 opened this issue Nov 18, 2020 · 2 comments
Open

Safe open #81

yakir12 opened this issue Nov 18, 2020 · 2 comments

Comments

@yakir12
Copy link
Contributor

yakir12 commented Nov 18, 2020

Is there some way I can open a port (i.e. "/dev/ttyACM0") "safely"? Alternatively, test to see if a port is already open? Currently I can only do:

isopen(sp)

but this only works for a SerialPort type, that has already been opened before (and maybe closed at some point). My point is, if you don't know what ports are available, open, or closed, you can only start from get_port_list(), which gives you a list of strings. How can I, from that point, safely test if a port is already open, so I'll know to close it before attempting to open it again?

@yakir12
Copy link
Contributor Author

yakir12 commented Nov 18, 2020

Never mind, I dunno how I missed that LibSerialPort.open(port::String) when that port is already open does not error. Sorry for the noise.

@yakir12 yakir12 closed this as completed Nov 18, 2020
@yakir12
Copy link
Contributor Author

yakir12 commented Nov 18, 2020

Never Never mind, forgot about the baudrate... Still a problem (for me).

@yakir12 yakir12 reopened this Nov 18, 2020
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