Jump to content

RxUsbOpen: Difference between revisions

From EDM2
Created page with "==Description== Acquires access to a specific USB device. ==Syntax== Acquires access to a specific USB device. <pre> rc = RxUsbOpen(Handle,EnumDevice,idVendor,idProduct) <..."
 
W.m.brul (talk | contribs)
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:


==Syntax==
==Syntax==
Acquires access to a specific USB device.
''To acquire access to a specific USB device use:''
<pre>
<pre>
  rc = RxUsbOpen(Handle,EnumDevice,idVendor,idProduct)
  rc = RxUsbOpen(Handle,EnumDevice,idVendor,idProduct)
</pre>
</pre>


Acquires access to a more specific USB device.
''To acquire access to an even more specific USB device use:''
<pre>
<pre>
  rc = RxUsbOpen(Handle,EnumDevice,idVendor,idProduct,bcdDevice)  
  rc = RxUsbOpen(Handle,EnumDevice,idVendor,idProduct,bcdDevice)  
Line 23: Line 23:


; bcdDevice : the Device Release Number from the device descriptor.  
; bcdDevice : the Device Release Number from the device descriptor.  


==Return Code==
==Return Code==
 
<pre>
0x0000 - NO_ERROR
</pre>
===Errors===
===Errors===
 
<pre>
0x0057 - ERROR_INVALID_PARAMETER
0x1B58 - USB_NOT_INIT
0xFF0C - ERROR_I24_GEN_FAILURE
0xFF13 - ERROR_I24_INVALID_PARAMETER
</pre>
==Remarks==
==Remarks==


Line 52: Line 58:


==Related Functions==
==Related Functions==
* [[RxUsbCtrlMessage]]
* [[RxUsbCtrlTransfer]]
* [[RxUsbDataTransfer]]
* [[RxUsbQueryDeviceInfo]]
* [[RxUsbQueryDeviceReport]]
* [[RxUsbQueryStringReport]]
* [[RxUsbClose]]


[[Category:USBCalls]]
[[Category:USBCalls]]

Latest revision as of 19:15, 12 February 2017

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)

Related Functions