GIO_write
Application Program Interface
2-135
C Interface
Syntax
status = GIO_write(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
The application uses this function to write a specified number of MADUs
to 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 write
data. In other cases, this parameter may point to a structure that
packages buffer information, size, offset to be written to, 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 written to 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_write returns IOM_COMPLETED upon successfully writing the
requested number of MADUs to 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_write results in a call to the mdSubmit function of the
associated mini-driver. The IOM_WRITE command is passed to the
mdSubmit function. The mdSubmit call is typically a blocking call, so
calling GIO_write can result in blocking.
GIO_write
Synchronous write command