Chapter 4 • • For UNIX Users
~32~
int sio_ioctl(int port, int baud, int mode)
return = 0 ok
-1 bad port
-2 time out
-4 bad baud rate
port = port number
baud = 0 = 50 1 = 75 2 = 110
3 = 134.5 4 = 150 5 = 300
6 = 600 7 = 1200 8 = 1800
9 = 2400 10 = 4800 11 = 7200
12 = 9600 13 = 19200 14 = 38400
15 = 57600 16 = 115200 17 = 230400
18 = 460800
mode = bit_cnt OR stop_bit OR parity
bit_cnt ( bit 0, 1, 2 )
0x00 = bit_5 0x01 = bit_6 0x02 = bit_7
0x03 = bit_8
stop_bit ( bit 3 )
0x00 = stop_1 0x04 = stop_2
parity ( bit 4, 5 )
0x00 = none 0x08 = odd 0x18 = even
0x28 = mark 0x38 = space
7. Send break signal.
int sio_break(int port, int time)
return = 0 ok
-1 bad port
-2 time out
-4 xmit disable
-5 port is not open
port = port number
time = break time in tic ( 1/18.2 second )
8. Flush Tx/Rx buffer data.