For UNIX Users • • Chapter 4
31
int sio_read(int port, char *buf, int len)
return = >0 length of data received
0 no data received
-1 bad port
-2 time out
-5 port is not open
port = port number
buf = receive buffer pointer with required space
len = buffer length
4. Write a string of data to Tx buffer.
int sio_write(int port, char *buf, int len)
return = >0 length of data transmitted to Tx buffer
=0 buffer full
-1 bad port
-2 time out
-5 port is not open
port = port number
buf = transmit string pointer
len = transmit string length
5. Put a block of data to Tx buffer. If the Tx buffer free space is
smaller than block length, it will return zero.
int sio_putb(int port, char *buf, int len)
return = >0 length of data transmitted to Tx buffer
0 free buffer not enough
-1 bad port
-2 time out
-5 port is not open
-6 len > Tx buffer size
port = port number
buf = transmit string pointer
len = transmit string length
6. Non-TTY port parameter setting.