aux_rawrd(3) CLIX aux_rawrd(3)
NAME
aux_rawrd, aux_rawrd_nw - Read data with error byte from a serial port
LIBRARY
Intergraph Device Library (libix.a)
SYNOPSIS
#include <sys/aux.h>
#include <sys/xio/xio.h>
#include <sys/xio/xerr.h>
int aux_rawrd(
int port ,
short *dbuf ,
int dcnt ,
int *xfcnt );
int aux_rawrd_nw(
int port ,
short *dbuf ,
int dcnt ,
struct xiosb *xiosb ,
int efn );
PARAMETERS
port An integer representing a serial port
dbuf A pointer to the receiving buffer
dcnt The size in bytes of the receiving buffer
xfcnt The number of bytes transferred
xiosb A pointer to the xiosb structure
efn The event flag number associated with the transfer request
DESCRIPTION
The aux_rawrd() function reads data and error information from the
specified port. The port must have been opened by aux_open().
Each short read from port consists of a character in the low byte and
error information in the high-order byte. The error information is a bit
mask with bit definitions shown below and defined in <sys/aux.h>.
2/94 - Intergraph Corporation 1
aux_rawrd(3) CLIX aux_rawrd(3)
Multiple errors can occur on a character.
BREAK 0x0100 /* break sequence detected */
PARITY 0x0200 /* character parity error */
PART_OVERRUN 0x0400 /* hardware overrun */
FRAME 0x0800 /* character framing error */
QUEUE_OVERRUN 0x1000 /* software overrun */
The dbuf parameter is a pointer to the buffer to receive the
character/error information, and dcnt is the size (in bytes) of the
buffer. The buffer must be short aligned.
Upon completion of the synchronous request, the integer pointed to by
xfcnt is updated with the number of bytes transferred to dbuf. Since each
character received from port is coupled with error information, xfcnt
indicates twice as many bytes as there were characters received.
The aux_rawrd_nw() function is the asynchronous version of aux_rawrd(),
providing the same capability without waiting for completion of the
request. The efn parameter specifies the event flag number associated
with the request. The xiosb parameter is a pointer to the xiosb structure
updated upon completion of the request (see intro(3)). The xfcnt member
of the xiosb structure indicates the number of bytes transferred to dbuf.
RETURN VALUES
Upon successful completion of the synchronous request, a value of 0 is
returned. Otherwise, one of the following failure codes is returned.
If the asynchronous request is accepted by the XIO system, a value of 0
will be returned by the request. Otherwise, XIO_FAILURE will be returned.
Upon completion of an accepted request, the status member of the xiosb
structure will be set to either 0 if successful, or to one of the above
failure codes if unsuccessful.
ERRORS
The aux_rawrd() and aux_rawrd_nw() functions will fail if one of the
following is true:
[XIO_FAILURE]
The system does not contain the driver needed to support this
request or efn is invalid.
[AUX_PORT_NOT_OPEN]
The specified port is not open by the calling process.
[AUX_PORT_REDUNDANT_REQUEST]
An outstanding read is already on the specified port.
[BAD_DATA_BUFFER_SIZE]
2 Intergraph Corporation - 2/94
aux_rawrd(3) CLIX aux_rawrd(3)
The value of dcnt is less than or equal to zero.
[BAD_DATA_BUFFER_ADDRESS]
The value of dbuf points to a nonwritable memory space.
RELATED INFORMATION
Functions: aux_open(3), intro(3)
Files: xaux(7)
2/94 - Intergraph Corporation 3