Each USB device has address specified by vendor id, product id and S/N. Users call UsbOpen to open a device, once opened a handle to a device is returned. When communication is no longer need you can call UsbClose to release the handle created. ATEasy automatically closes all handle when the application is closed.
Each device has one or more configurations (usually 1). Each configuration contains one or more interfaces, each interface constrains one or more endpoints (max 32 endpoints for a configuration for USB 2.0 device and 16 for USB 1.0). Pipes is the channels connected to an endpoint and used to transfer data or command. See the USB standard for more information about USB and USB devices.
After the handle is created UsbSetup can be called to set the default interface number within the configuration index specified and if the device interface is a USBTMC class. For USBTMC devices (argument set to TRUE) the interface and configuration is automatically selected and the interface number/configuration index are ignored. Once the interface is selected all send and receive commands will use that interface.
To send or receive data use the UsbSend and UsbReceive functions. The functions communicate through a pipe to a device specified by the enPipeType (enumAUsbPipeTypes) or the lEndpointAddress. For USBTMC devices aUsbPipeTypeBulkOut for UsbSend or aUsbPipeTypeBulkIn for UsbReceive are used by default. lEndpointAddress address is used for specifying the absolute address within the configuration. enPipe Type is the address that is relative within the current selected interface.
Additional low level functions are provided mainly for RAW devices:
UsbControlRequest used to send and receive any command (packet used to control the device). See the USB 2.0 specification section 9.3 - USB Device Requests for detailed information regarding the parameters of these functions.
UsbStandardControlRequest is similar but used for pre-defined commands defined in the USB or USBTMC specification (see 9.4 Standard Device Requests in the USB 2.0 specification and 4.3 - USB488 subclass specific requests in the USBTMC-USB488 v1.0 specifications).
UsbGetHandle used to return the Windows handle for endpoint specified using a pipe or an endpoint address. This handle may be used by Windows API such as ReadFile/WriteFile to communicate with the device.