For UNIX Users • • Chapter 4
33
int sio_flush(int port, int func)
return = 0 ok
-1 bad port
-2 time out
-5 port is not open
port = port number
func = flush function (clear the assigned queue)
0 for input queue
1 for output queue
2 for input & output queue
9. Read the length of data queued in Rx buffer.
long sio_iqueue(int port)
return = >0 input queue size(bytes)
-1 bad port
-2 time out
-5 port is not open
port = port number
10. Read the length of data queued in Tx buffer.
long sio_oqueue(int port)
return = >=0 length of transmitted data which still
queued in Tx buffer
-1 bad port
-2 time out
-5 port is not open
port = port number
11. Get modem line status.
int sio_lstatus(int port)
return = >0 line status : bit 0 -- S_CTS
bit 1 -- S_DSR