1 ! Copyright (C) 2008 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors kernel math.bitwise io.serial io.serial.unix ;
6 : serial-obj ( -- obj )
8 "/dev/ttyS0" >>path ! linux
9 ! "/dev/dty00" >>path ! netbsd
10 ! "/dev/ttyd0" >>path ! freebsd
11 ! "/dev/ttyU0" >>path ! openbsd
13 { IGNPAR ICRNL } flags >>iflag
15 { CS8 CLOCAL CREAD } flags >>cflag
16 { ICANON } flags >>lflag ;
18 : serial-test ( -- serial )
21 dup get-termios >>termios