Skip to content

Instantly share code, notes, and snippets.

@AndyMoreland
Created October 9, 2010 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndyMoreland/618562 to your computer and use it in GitHub Desktop.
Save AndyMoreland/618562 to your computer and use it in GitHub Desktop.
(defn better-port-identifier
"Returns a port associated with a given identifier name"
[port-name]
(let [ports (enumeration-seq (CommPortIdentifier/getPortIdentifiers))]
(some #(= (.getName %) port-name) ports)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment