-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add get-port-names helper to util #8
Add get-port-names helper to util #8
Conversation
db4e806
to
b640170
Compare
@peterschwarz rebased, and fixed some bad spelling in the commit message, and Travis now passes, so this should be ready for review. |
src/serial/util.clj
Outdated
|
||
(defn list-ports | ||
"Print out the available ports. | ||
The names printed may be passed to `serial.core/open` as printed." | ||
[] | ||
(doall (map #(println (.getName %)) (port-identifiers)))) | ||
(map println (get-port-names))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
map
is lazy, so this won't actually print. That's where the doall
came in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I keep forgetting that when I do that in the repl that would realize it... Sorry about that! Pushed a fix.
It's frequently useful to get the set of the available port names, and then be able to do work over it. This just exposes a helper so that the caller doesn't need to know what a CommPortIdentifier is and how to get it's name.
b640170
to
27babd4
Compare
Is this waiting on anything from me? You've marked it as approved but I'm guessing you aren't waiting on anyone else to comment on it... |
Was just waiting on the build, and got a bit distracted |
It's frequently useful to get the set of the available port names, and then be able to do work over it. This just exposes a helper so that the caller doesn't need to know what a CommPortIdentifier is and how to get it's name.