The settings for serial ports (aka "ttys" in the Unix world) can be changed with the procedure tty-mode-set!. Here is an example on MacOS X using a bluetooth modem:
(let ((modem (open-file "/dev/tty.Bluetooth-Modem")))
(tty-mode-set! modem #f #f #t #t 38400)
(display "at\r" modem) (force-output modem)
(pp (read-line modem)) ;; prints: "at\r\r" (pp (read-line modem))) ;; prints: "OK\r"
Only some settings can be changed with tty-mode-set!. The parameters are:
(tty-mode-set! <input-allow-special> <input-echo> <input-raw> <output-raw> <speed>)
<input-allow-special>: boolean, #f = disable ctr-c handling, etc <input-echo>: boolean, #f = characters received are not echoed <input-raw>: boolean, #t = pass each character read unchanged ("RAW" mode) <output-raw>: boolean, #t = pass each character to the output unchanged ("RAW" mode) <speed>: integer = baud rate
Marc