Using the QuickUSB Library
Using the QuickUSB Library
Overview
The QuickUSB® Library API gives programmers a cohesive programming
interface to the QuickUSB family of products. The same QuickUSB Library API
works for all QuickUSB products on all platforms, so you write your software
once and all your QuickUSB based products will work on any supported
platform.
The QuickUSB library offers support for many programming languages. The
QuickUSB Library includes support for the following programming languages:
•
Microsoft Visual Basic 6.0
•
Microsoft C/C++ version 6.0, MFC dialog and command line
•
Microsoft .NET 2003
•
Borland C++ Builder 5.0
•
Borland Delphi 4.0
•
LabView 7.0
•
Qt Designer
This API documentation is language independent. To find the particular
parameter type, please consult the QuickUSB Library include files for your
programming language.
There are three basic methods of interfacing with the QuickUSB Library, using a
function-based API, a class-based API or a using a QuickUSB component.
The function-based API makes calls to the QuickUSB Library directly from your
programming language. For instance, your application will include a file that
has all the QuickUSB function declarations then from your code, you would call
the appropriate functions to implement the behavior you need.
The class-based API makes the QuickUSB Library level calls from an object-
oriented interface. Your code instantiates one or more CQuickUSB objects and
calls the methods to implement the required behavior.
The component-based approach displays available modules and lets the user
interact with the component GUI to make that selection, and then the app calls
component methods to implement the required behavior.
How to Communicate with a Module
The general procedure to use a QuickUSB module is given below:
1.
Call QuickUsbFindModules to get a list of available modules. The list will
be returned as a NULL-delimited string.
2.
Parse the list of available modules and provide a means to select the
desired module.
3.
Then, for each data transaction (send or receive):
a.
Call QuickUsbOpen and pass in the device name. A new device id is
returned on success.
b.
Call the data transfer functions needed by your application.
c.
Call QuickUsbClose to close the handle to the USB module.
Overview
39