Jump to content

RxUsbDeviceSetDescriptor

From EDM2
Revision as of 23:43, 20 January 2017 by Martini (talk | contribs) (Created page with "==Description== '''Warning:''' Do NOT use this function unless you know your USB device supports it. Executes the Standard Device Request that updates the Device Descriptor....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

Warning: Do NOT use this function unless you know your USB device supports it.

Executes the Standard Device Request that updates the Device Descriptor.

Syntax

rc = RxUsbDeviceSetDescriptor(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 Device Descriptor appropriate for the device.

Return Code

Errors

Remarks

Warning: Do NOT use this function unless you know your USB device supports it.

Example Code

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

/* invoke RxUsbDeviceSetDescriptor */
Length=18 /* to replace whole descriptor */
Descriptor=x2c(1201100100000040450C2D60010100010001)
rc = RxUsbDeviceSetDescriptor(Handle,Length,Descriptor)
say '*RxUsbDeviceSetDescriptor(),RC=0x'd2x(rc)

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

Related Functions