TTY.dcl 974 Bytes
Newer Older
Mart Lubbers's avatar
Mart Lubbers committed
1 2 3 4
definition module TTY

from StdClass import class zero

Mart Lubbers's avatar
Mart Lubbers committed
5
:: *TTY (:== Int)
Mart Lubbers's avatar
Mart Lubbers committed
6 7

:: ByteSize = BytesizeFive | BytesizeSix | BytesizeSeven | BytesizeEight
8
:: Parity = ParityNone | ParityOdd | ParityEven | ParitySpace | ParityMark
Mart Lubbers's avatar
Mart Lubbers committed
9 10 11 12 13
:: BaudRate = B0 | B50 | B75 | B110 | B134 | B150 | B200 | B300 | B600 |
	B1200 | B1800 | B2400 | B4800 | B9600 | B19200 | B38400 | B57600 |
	B115200 | B230400

:: TTYSettings = {
Mart Lubbers's avatar
Mart Lubbers committed
14
		devicePath :: String,
Mart Lubbers's avatar
Mart Lubbers committed
15 16 17
		baudrate :: BaudRate,
		bytesize :: ByteSize,
		parity :: Parity,
Mart Lubbers's avatar
Mart Lubbers committed
18
		stop2bits :: Bool,
Mart Lubbers's avatar
Mart Lubbers committed
19 20 21 22 23
		xonxoff :: Bool
	}

instance zero TTYSettings

24
getTTYDevices :: !*World -> *(![String], !*World)
25 26
makeTTYSettings :: String BaudRate ByteSize Parity Bool Bool -> TTYSettings

Mart Lubbers's avatar
Mart Lubbers committed
27
TTYclose :: !*TTY !*env -> (!Bool, !*env)
Mart Lubbers's avatar
Mart Lubbers committed
28
TTYerror :: !*env -> (!String, !*env)
Mart Lubbers's avatar
Mart Lubbers committed
29
TTYopen :: !TTYSettings !*env -> (!Bool,!*TTY,!*env)
Mart Lubbers's avatar
Mart Lubbers committed
30
TTYread :: !*TTY -> (!Int, !*TTY)
Mart Lubbers's avatar
Mart Lubbers committed
31
TTYreadline :: !*TTY -> (!String, !*TTY)
Mart Lubbers's avatar
Mart Lubbers committed
32
TTYavailable :: !*TTY -> (!Bool, !*TTY)
Mart Lubbers's avatar
Mart Lubbers committed
33
TTYwrite :: !String !*TTY -> *TTY