USBLib_FindDeviceRef (SWI &56350) — Obtains a device reference
This call is used to obtain a device reference from a device number and controller reference.
The device reference will have its registration count incremented which will require freeing with USBLib_ReferenceDeregister (SWI &56372) when the reference is no longer required.
Example 3.1. Using USBLib_FindDeviceRef
An example of this calls use, the dev is from a "new device" message obtained either by using the USBLib_DevMgrFindFree (SWI &5635A) call or from a registered message handler.
REM find host controller reference SYS "USBLib_FindObject",0,controller_name$,USB_REFERENCE_CONTROLLER%,0 TO hc_ref% REM find device reference SYS "USBLib_FindDeviceRef",device_number,hc_ref% TO dev_ref% REM we don't need the controller reference, so deregister it SYS "USBLib_ReferenceDeregister", hc_ref%, USB_REFERENCE_CONTROLLER% REM do stuff using the reference REM we don't need the device reference, so deregister it SYS "USBLib_ReferenceDeregister", dev_ref%, USB_REFERENCE_DEVICE% |