Using the QuickUSB Library
QuickUSB Base API
General purpose functions to manage the operation of the QuickUSB module
and the Library.
QuickUsbFindModules
Purpose
Build a list of all QuickUSB modules connected to the host.
Parameters
nameList: A PCHAR that points to a buffer in which to store a of QuickUSB
module names found by the library. Device names are of the
form ‘QUSB-XXX’ where XXX is the device address (0-126) in
decimal. ‘nameList’ must be large enough to contain all the
device names + 1 character.
length:
A LONG containing the length of the nameList buffer in CHARs.
Returns
A LONG that is either non-zero on success or zero (0) on failure. If
successful, nameList will contain a NULL (‘\0’ or CHR(0)) delimited list of
QuickUSB module names found by the library. The final entry is
designated by two consecutive NULL characters. For example, after
executing this function with one module connected, nameList will contain
"QUSB-0\0\0". If there are two devices plugged in, nameList will contain
"QUSB-0\0QUSB-1\0\0".
Notes
This routine will only find devices that are closed.
QuickUsbOpen
Purpose
Open a QuickUSB device for use by the library
Parameters
hDevice: A PHANDLE that points to a HANDLE in which to place the new
device ID. If successful, hDevice will contain the new HANDLE.
devName: A PCHAR that points to a null-terminated CHAR array containing
the name of the device. Device names are of the form ‘QUSB-
XXX’ where XXX is the device address (0-126) in decimal. The
device name should be parsed from the response from
QuickUsbFindModules. For example, if two modules are
connected, devName should contain “QUSB-0” to select the first
module, and devName should contain “QUSB-1” to select the
second module.
Returns
A LONG that is either non-zero on success or zero (0) on failure.
Notes
•
This function will only open devices that are closed.
QuickUSB Base API
41