move serial to io.serial
parent
0ccb04e50f
commit
378c8f90ff
|
@ -3,22 +3,21 @@
|
|||
USING: accessors alien.c-types assocs combinators destructors
|
||||
kernel math math.bitwise math.parser sequences summary system
|
||||
vocabs.loader ;
|
||||
IN: serial
|
||||
IN: io.serial
|
||||
|
||||
TUPLE: serial stream path baud
|
||||
termios iflag oflag cflag lflag ;
|
||||
|
||||
ERROR: invalid-baud baud ;
|
||||
M: invalid-baud summary ( invalid-baud -- string )
|
||||
"Baud rate "
|
||||
swap baud>> number>string
|
||||
" not supported" 3append ;
|
||||
baud>> number>string
|
||||
"Baud rate " " not supported" surround ;
|
||||
|
||||
HOOK: lookup-baud os ( m -- n )
|
||||
HOOK: open-serial os ( serial -- serial' )
|
||||
M: serial dispose ( serial -- ) stream>> dispose ;
|
||||
|
||||
{
|
||||
{ [ os unix? ] [ "serial.unix" ] }
|
||||
{ [ os windows? ] [ "serial.windows" ] }
|
||||
{ [ os unix? ] [ "io.serial.unix" ] }
|
||||
{ [ os windows? ] [ "io.serial.windows" ] }
|
||||
} cond require
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2008 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.syntax kernel math.bitwise sequences system serial ;
|
||||
IN: serial.unix
|
||||
USING: alien.syntax kernel math.bitwise sequences system io.serial ;
|
||||
IN: io.serial.unix
|
||||
|
||||
M: bsd lookup-baud ( m -- n )
|
||||
dup {
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2008 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: assocs alien.syntax kernel serial system unix ;
|
||||
IN: serial.unix
|
||||
USING: assocs alien.syntax kernel io.serial system unix ;
|
||||
IN: io.serial.unix
|
||||
|
||||
CONSTANT: TCSANOW 0
|
||||
CONSTANT: TCSADRAIN 1
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2008 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.syntax kernel sequences system ;
|
||||
IN: serial.unix.termios
|
||||
IN: io.serial.unix.termios
|
||||
|
||||
CONSTANT: NCCS 20
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2008 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.syntax kernel system unix ;
|
||||
IN: serial.unix.termios
|
||||
IN: io.serial.unix.termios
|
||||
|
||||
CONSTANT: NCCS 32
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
! Copyright (C) 2008 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: combinators system vocabs.loader ;
|
||||
IN: serial.unix.termios
|
||||
IN: io.serial.unix.termios
|
||||
|
||||
{
|
||||
{ [ os linux? ] [ "serial.unix.termios.linux" ] }
|
||||
{ [ os bsd? ] [ "serial.unix.termios.bsd" ] }
|
||||
{ [ os linux? ] [ "io.serial.unix.termios.linux" ] }
|
||||
{ [ os bsd? ] [ "io.serial.unix.termios.bsd" ] }
|
||||
} cond require
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2008 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors kernel math.bitwise serial serial.unix ;
|
||||
IN: serial.unix
|
||||
USING: accessors kernel math.bitwise io.serial io.serial.unix ;
|
||||
IN: io.serial.unix
|
||||
|
||||
: serial-obj ( -- obj )
|
||||
serial new
|
|
@ -2,12 +2,12 @@
|
|||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors alien.c-types alien.syntax combinators io.ports
|
||||
io.streams.duplex system kernel math math.bitwise
|
||||
vocabs.loader unix serial serial.unix.termios io.backend.unix ;
|
||||
IN: serial.unix
|
||||
vocabs.loader unix io.serial io.serial.unix.termios io.backend.unix ;
|
||||
IN: io.serial.unix
|
||||
|
||||
<< {
|
||||
{ [ os linux? ] [ "serial.unix.linux" ] }
|
||||
{ [ os bsd? ] [ "serial.unix.bsd" ] }
|
||||
{ [ os linux? ] [ "io.serial.unix.linux" ] }
|
||||
{ [ os bsd? ] [ "io.serial.unix.bsd" ] }
|
||||
} cond require >>
|
||||
|
||||
FUNCTION: speed_t cfgetispeed ( termios* t ) ;
|
|
@ -3,7 +3,7 @@
|
|||
USING: io.files.windows io.streams.duplex kernel math
|
||||
math.bitwise windows.kernel32 accessors alien.c-types
|
||||
windows io.files.windows fry locals continuations ;
|
||||
IN: serial.windows
|
||||
IN: io.serial.windows
|
||||
|
||||
: <serial-stream> ( path encoding -- duplex )
|
||||
[ open-r/w dup ] dip <encoder-duplex> ;
|
|
@ -1,4 +0,0 @@
|
|||
! Copyright (C) 2009 Your name.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: tools.test serial.windows ;
|
||||
IN: serial.windows.tests
|
Loading…
Reference in New Issue