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
7 : serial-obj ( -- obj )
9 "/dev/ttyS0" >>path ! linux
10 ! "/dev/dty00" >>path ! netbsd
11 ! "/dev/ttyd0" >>path ! freebsd
12 ! "/dev/ttyU0" >>path ! openbsd
14 flags{ IGNPAR ICRNL } >>iflag
16 flags{ CS8 CLOCAL CREAD } >>cflag
17 flags{ ICANON } >>lflag ;
19 : serial-test ( -- serial )
22 dup get-termios >>termios