Skip to content
Chris Petersen edited this page Oct 16, 2014 · 1 revision

serial-readchar reads a character to RS232 device

Parameter Description
dev Serial device obtained from rs232-try

Example

Example 1: From (serial-cache-read dev . hook), where the starting character of the cache is to be found:

(if (not buf)
  (let loop ()
    (let ((c (serial-readchar dev)))
      (if (or (serial-timeout) (serial-error)) (return #f))
      (if hookproc (hookproc c))
      (if (if (procedure? c1) (c1 c) (fx= c c1)) (set! buf (string (integer->char c))) (loop))
  ))
)
Clone this wiki locally