RxUsbOpen
Appearance
Description
Acquires access to a specific USB device.
Syntax
To acquire access to a specific USB device use:
rc = RxUsbOpen(Handle,EnumDevice,idVendor,idProduct)
To acquire access to an even more specific USB device use:
rc = RxUsbOpen(Handle,EnumDevice,idVendor,idProduct,bcdDevice)
Parameters
- Handle
- receives Device Handle to be used to access this USB device.
- EnumDevice
- use 0 to accept any specified device or N for the Nth device.
- idVendor
- the Vendor Identifier (VendorID) from the device descriptor.
- idProduct
- the Product Identifier (ProductID) from the device descriptor.
- bcdDevice
- the Device Release Number from the device descriptor.
Return Code
0x0000 - NO_ERROR
Errors
0x0057 - ERROR_INVALID_PARAMETER 0x1B58 - USB_NOT_INIT 0xFF0C - ERROR_I24_GEN_FAILURE 0xFF13 - ERROR_I24_INVALID_PARAMETER
Remarks
Example Code
/* add RxUsbOpen */
rc = RxFuncAdd('RxUsbOpen','usbcalls','RxUsbOpen')
say '+RxUsbOpen(),RC=0x'd2x(rc)
/* invoke RxUsbOpen */
drop Handle /* receives device handle */
EnumDevice=0 /* accept any free device */
idVendor=x2d(046D) /* vendor identifier */
idProduct=x2d(0804) /* product identifier */
bcdDevice=x2d(0009) /* device release number */
rc = RxUsbOpen(Handle,EnumDevice,idVendor,idProduct,bcdDevice)
say '*RxUsbOpen(),RC=0x'd2x(rc)
/* drop RxUsbOpen */
rc = RxFuncDrop('RxUsbOpen')
say '-RxUsbOpen(),RC=0x'd2x(rc)