Skip to content
Matthias Görges edited this page May 20, 2015 · 1 revision

detect-usb-serial returns the name of the first usb-serial port found on a unix-like operating system.

Example

Example 1: Obtain name for serial port and then connect to a monitor using it

;; Get serial port
(set! gui:source (cond
  ((string=? (system-platform) "linux") (detect-usb-serial))
  ((string=? (system-platform) "win32") "COM5")
  ((string=? (system-platform) "macosx") (detect-usb-serial))
   (else ""))
)
(make-instance store "BISmonitor" "monitor" `("Port" ,gui:source))
Clone this wiki locally