This section describes a simple fictional device and lists the
steps an application takes to use the generic USB driver to control
the device. This fictional device is a smart-card reader that does
not conform to the smart-card device class. This reader has one interface
that uses the vendor-specific class “sub class” and
protocol types of 0xff.It has a bulk-in pipe, a bulk-out pipe, an
interrupt pipe, and the required control pipe.
Assume that the steps necessary for the USB configuration to
load a driver are complete. (How device configuration works and how
to obtain the information necessary for configuration are discussed
later.) With these assumptions, plug the device into the system.
At this point, the generic driver has opened all the pipes for
the chosen interface and is waiting for an application to assign a
channel to it. The first channel assigned must be associated with
the control pipe before it can be used for anything else.
The application now associates a channel to the interrupt
pipe, the bulk-in pipe, and the bulk-out pipe.
The application next determines the type of pipe it
has and other data about the device that it needs by using the IO$_SETCHAR
and IO$_SENSECHAR functions.
The application then issues a “read”
to the interrupt to determine if a card is present in the reader.
If a card is present, the application uses the control pipe and the
bulk in and bulk out pipes to exchange data with the smart card.