Jump to content

RxUsbDeviceGetDescriptor

From EDM2
Revision as of 23:38, 20 January 2017 by Martini (talk | contribs) (Created page with "==Description== Executes the Standard Device Request that obtains the Device Descriptor. ==Syntax== <pre> rc = RxUsbDeviceGetDescriptor(Handle,Length,Descriptor) </pre> ==P...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

Executes the Standard Device Request that obtains the Device Descriptor.

Syntax

rc = RxUsbDeviceGetDescriptor(Handle,Length,Descriptor)

Parameters

Handle
the Device Handle received from the previous RxUsbOpen.
Length
the desired number of bytes or 0 for the whole Device Descriptor.
Descriptor
the name of the variable to receive the Device Descriptor.

Return Code

Errors

Remarks

Example Code

/* add RxUsbDeviceGetDescriptor */
rc = RxFuncAdd('RxUsbDeviceGetDescriptor','usbcalls','RxUsbDeviceGetDescriptor')
say '+RxUsbDeviceGetDescriptor(),RC=0x'd2x(rc)

/* invoke RxUsbDeviceGetDescriptor */
Length=18 /* to receive whole descriptor */
drop Descriptor /* receives device descriptor */
rc = RxUsbDeviceGetDescriptor(Handle,Length,Descriptor)
say '*RxUsbDeviceGetDescriptor(),RC=0x'd2x(rc)

/* drop RxUsbDeviceGetDescriptor */
rc = RxFuncDrop('RxUsbDeviceGetDescriptor')
say '-RxUsbDeviceGetDescriptor(),RC=0x'd2x(rc)

Related Functions