GIO_read
Application Program Interface
2-131
C Interface
Syntax
status = GIO_read(gioChan, bufp, *pSize);
Parameters
GIO_Handle gioChan; /* handle to an instance of the device */
Ptr
bufp
/* pointer to data structure for buffer data */
size_t
*pSize
/* pointer to size of bufp structure */
Return Value
Int
status;
/* returns IOM_COMPLETED if successful */
Description
An application calls GIO_read to read a specified number of MADUs
(minimum addressable data units) from the communication channel.
The gioChan parameter is the handle returned by GIO_create or
GIO_new.
The bufp parameter points to a device-defined data structure for passing
buffer data between the device and the application. This structure may
be generic across a domain or specific to a single mini-driver. In some
cases, this parameter may point directly to a buffer that holds the read
data. In other cases, this parameter may point to a structure that
packages buffer information, size, offset to be read from, and other
device-dependent data. For example, for video capture devices this
structure may contain pointers to RGB buffers, their sizes, video format,
and a host of data required for reading a frame from a video capture
device. Upon a successful read, this argument points to the returned
data.
The pSize parameter points to the size of the buffer or data structure
pointed to by the bufp parameter. When the function returns, this
parameter points to the number of MADUs read from the device. This
parameter is relevant only if the bufp parameter points to a raw data
buffer. In cases where it points to a device-defined structure it is
redundant—the size of the structure is known to the mini-driver and the
application. At most, it can be used for error checking.
GIO_read returns IOM_COMPLETED upon successfully reading the
requested number of MADUs from the device. If an error occurs, the
device returns a negative value. For a list of error values, see “Constants,
Types, and Structures” on page 2-118.
A call to GIO_read results in a call to the mdSubmit function of the
associated mini-driver. The IOM_READ command is passed to the
mdSubmit function. The mdSubmit call is typically a blocking call, so
calling GIO_read can result in the thread blocking.
GIO_read
Synchronous read command