UsbStandardControlRequest Procedure |
Version 7 |
Sends and receives standard control packet to the specified USB device.
[ vReturn = ] UsbStandardControlRequest (hDevice, enRequest, vValue, vIndex )
The UsbStandardControlRequest procedure syntax has the following parts:
Name |
Type |
Description |
vReturn |
Variant |
Empty or received data |
hDevice |
Val AHandle |
Handle to the USB device |
enRequest |
Standard control requests |
|
wValue |
[Val] Word |
Optional (default -1). Varies according to request; typically used for passing data. |
wIndex |
[Val] Word |
Optional (default -1). Varies according to request; typically used to pass an index or offset. |
This function sends standard control requests to a USB device. Please see USB specs section 9.4 "Standard Device Requests", USBTMC specs section 9.4 "USBTMC class specific requests", and USB488 specs section 4.3 " USB488 subclass specific requests" for more details (see http://www.usb.org/developers/devclass_docs#approved).
None of the standard requests that required a send data buffer and any received data will be return as a Variant. The request will be send to the default control pipe address 0.
The following example sends standard request to retrieve the configuration descriptor of a USB device:
print UsbStandardControlRequest(hDevice, aUsbGetConfigurationDescriptor)
The following example initialize a TMC USB driver:
Driver.OnInit
{
Delay(100)
UsbStandardControlRequest(driver.InterfaceInfo(adriverInfoAddress),
aUsbTmcCheckClearStatus)
}