USB Resource Manager for OS/2 (ArcaOS, eComStation) - CAUTION: This is beta test software!

May be freely used and exchanged, as long as it is not modified. You may use this product solely at your own risk. I cannot be held responsible for any damages occurring due to your using this product. You may not lease, rent or sell this product to any other party. Have fun.

Description - This (beta test) matched set of USBCALLS.DLL and USBRESMG.SYS supports application run-time dynamic linking as well as load-time dynamic linking. Contains the "USBCALLS - API Reference Guide" for application developers. Contains the "USBCALLS - REXX/2 Reference Guide" for rexx programmers.

Installation - Move USBRES05.ZIP into a directory of your choice and unzip it. In order to replace USBCALLS.DLL you may have to close the eCenter first. Replace USBCALLS.DLL in your \ECS\DLL or \OS2\DLL directory and replace USBRESMG.SYS and USBRESMG.SYM in your \ECS\BOOT or \OS2\BOOT directory. Restart your system.

Obtain this product here free of charge. Click here for my home page.

Asynchronous Operation

The application gets control back when the transfer request has been started. The application gets notified when that transfer request has been completed.

Parm Buffer (control)
fielddescription
usStatuscompletion status
usDataLengthcompletion length

CAUTION: Only one UsbStartCtrlTransfer may be outstanding to a particular endpoint.

When UsbStartCtrlTransfer is issued with an optional Data Buffer then usDatalength in the Parm Buffer must have been set to that Data Buffer size. When the transfer request has been completed then usDataLength in the Parm Buffer contains the number of bytes transferred.

Parm Buffer (data)
fielddescription
usStatuscompletion status
usDataLengthcompletion length

CAUTION: Only one UsbStartDataTransfer may be outstanding to a particular endpoint.

When UsbStartDataTransfer is issued then a Data Buffer is required and usDatalength in the Parm Buffer must have been set to that Data Buffer size. When the transfer request has been completed then usDataLength in the Parm Buffer contains the number of bytes transferred.

Isochronous Operation

The application gets control back when the transfer request has been started. The application gets notified when that transfer request has been completed.

Parm Buffer (frames)
fielddescription
usStatuscompletion status
usDataLengthcompletion length
usFrameSize[]frame size array

Individual Iso Frames are being used when usFrameCount is larger than zero.

When UsbStartIsoTransfer is issued and Individual Iso Frames are being used then usDatalength in the Parm Buffer must be set to usFrameCount*usFramelength and each element of usFrameSize[] in the Parm Buffer must be set to usFrameLength. When the transfer request has been completed then each element of usFrameSize[] contains the number of bytes transferred.

Parm Buffer (stream)
fielddescription
usStatuscompletion status
usDataLengthcompletion length

Concatenated Payloads are being used when usFrameCount equals zero.

When UsbStartIsoTransfer is issued and Concatenated Payloads are being used then usDatalength in the Parm Buffer must be set to the Data Buffer size. When the transfer request has been completed then usDataLength in the Parm Buffer contains the number of bytes transferred.

Synchronous Operation

The application gets control back when the transfer request has been completed.

Application Program Interface

USBCALLS.DLL supplies the Application Program Interface. The available functions are described as follows:

USBCALLS.H supplies the Standard Device Requests. The available functions are described as follows:

Access Device

ulrc=UsbOpen(pHandle,usVendor,usProduct,usBCDDevice,usEnumDevice);

Acquires access to a specific USB device.

ulrc=UsbClose(Handle);

Releases access to a specific USB device.

Control Transfer

ulrc=UsbCtrlMessage(Handle,ucRequestType,ucRequest,usValue,usIndex,usLength,pucData,ulTimeout);

Executes synchronous Control Transfer with the default endpoint.

ulrc=UsbCtrlTransfer(Handle,ucEndpoint,ucAltSetting,ucRequestType,ucRequest,usValue,usIndex,pusLength,pucData,ulTimeout);

Executes synchronous Control Transfer with a specific endpoint.

ulrc=UsbStartCtrlTransfer(Handle,ucEndpoint,ucAltSetting,ucRequestType,ucRequest,usValue,usIndex,pucParm,pucData,ulEvent);

Starts asynchronous Control Transfer with a specific endpoint.

ulrc=UsbCancelTransfer(Handle,ucEndpoint,ucAltSetting,ulEvent);

Stops asynchronous Control Transfer with a specific endpoint.

Data Transfer

ulrc=UsbBulkRead(Handle,ucEndpoint,ucAltSetting,pulNumBytes,pucData,ulTimeout);

Executes synchronous device-to-host Bulk Transfer with a specific endpoint.

ulrc=UsbBulkWrite(Handle,ucEndpoint,ucAltSetting,ulNumBytes,pucData,ulTimeout);

Executes synchronous host-to-device Bulk Transfer with a specific endpoint.

ulrc=UsbDataTransfer(Handle,ucEndpoint,ucAltSetting,pulNumBytes,pucData,ulTimeout,usFlags);

Executes synchronous Bulk or Interrupt Transfer with a specific endpoint.

ulrc=UsbIrqRead(Handle,ucEndpoint,ucAltSetting,pulNumBytes,pucData,ulTimeout);

Executes synchronous device-to-host Interrupt Transfer with a specific endpoint.

ulrc=UsbIrqWrite(Handle,ucEndpoint,ucAltSetting,ulNumBytes,pucData,ulTimeout);

Executes synchronous host-to-device Interrupt Transfer with a specific endpoint.

ulrc=UsbStartDataTransfer(Handle,ucEndpoint,ucAltSetting,pucParm,pucData,ulEvent,usFlags);

Starts asynchronous Bulk or Interrupt Transfer with a specific endpoint.

ulrc=UsbCancelTransfer(Handle,ucEndpoint,ucAltSetting,ulEvent);

Stops asynchronous Bulk or Interrupt Transfer with a specific endpoint.

Isochronous Transfer

ulrc=UsbIsoOpen(Handle,ucEndpoint,ucAltSetting,usBufferCount,usFrameLength);

Allocates bandwidth and resources for Isochronous Transfer.

ulrc=UsbIsoClose(Handle,ucEndpoint,ucAltSetting);

Releases bandwidth and resources for Isochronous Transfer.

ulrc=UsbStartIsoTransfer(Handle,ucEndpoint,ucAltSetting,ulEvent,pucParm,pucData,usFrameLength,usFrameCount);

Starts asynchronous Isochronous Transfer with a specific endpoint.

ulrc=UsbCancelTransfer(Handle,ucEndpoint,ucAltSetting,ulEvent);

Stops asynchronous Isochronous Transfer with a specific endpoint.

PNP Notification

ulrc=UsbRegisterChangeNotification(pNotifyID,hDeviceAdded,hDeviceRemoved);

Registers semaphores for a generic attach/detach notification of USB devices.

ulrc=UsbRegisterDeviceNotification(pNotifyID,hDeviceAdded,hDeviceRemoved,usVendor,usProduct,usBCDDevice);

Registers semaphores for attach/detach notification of a specific USB device.

ulrc=UsbDeregisterNotification(NotifyID);

Removes the registration of attach/detach notification semaphores.

System Information

ulrc=UsbQueryVersion(pUsbVersion,pulBufLen);

Obtains the version numbers of the USB Resource Manager components.

ulrc=UsbQueryNumberDevices(pulNumDev);

Obtains the total number of USB devices currently attached.

ulrc=UsbQueryDeviceInfo(ulDevNumber,pulBufLen,pucData);

Obtains attachment information about a specific USB device.

ulrc=UsbQueryDeviceReport(ulDevNumber,pulBufLen,pucData);

Obtains the compound USB descriptors of a specific USB device.

ulrc=UsbQueryStringReport(Handle,usLangID,ucStringID,pulBufLen,pucData);

Obtains an array of languages supported by a specific USB device. Obtains the specified string descriptor of a specific USB device.

Device Control

ulrc=UsbDeviceGetConfiguration(Handle,pucConfiguration);

Executes the Standard Device Request that obtains the current Configuration Value.

ulrc=UsbDeviceSetConfiguration(Handle,ucConfiguration);

Executes the Standard Device Request that sets the current Configuration Value.

ulrc=UsbDeviceGetStatus(Handle,pucStatus);

Executes the Standard Device Request that obtains the status of a USB device.

ulrc=UsbDeviceClearFeature(Handle,ucFeature);

Executes the Standard Device Request that clears or disables a USB device feature.

ulrc=UsbDeviceSetFeature(Handle,ucFeature);

Executes the Standard Device Request that sets or enables a USB device feature.

ulrc=UsbDeviceSetAddress(Handle,ucAddress);

Executes the Standard Device Request that sets the USB device address.

Endpoint Control

ulrc=UsbEndpointGetStatus(Handle,ucEndpoint,pucStatus);

Executes the Standard Device Request that obtains the status of an endpoint.

ulrc=UsbEndpointClearHalt(Handle,ucEndpoint);

Executes the Standard Device Request that clears an endpoint halt status.

ulrc=UsbEndpointClearFeature(Handle,ucEndpoint,ucFeature);

Executes the Standard Device Request that clears or disables an endpoint feature.

ulrc=UsbEndpointSetFeature(Handle,ucEndpoint,ucFeature);

Executes the Standard Device Request that sets or enables an endpoint feature.

ulrc=UsbEndpointSynchFrame(Handle,ucEndpoint,pucFrame);

Executes the Standard Device Request that synchronizes endpoint and frame.

Interface Control

ulrc=UsbInterfaceGetAltSetting(Handle,ucInterface,pucAltSetting);

Executes the Standard Device Request that obtains the Alternate Setting for an interface.

ulrc=UsbInterfaceSetAltSetting(Handle,ucInterface,ucAltSetting);

Executes the Standard Device Request that selects the Alternate Setting for an interface.

ulrc=UsbInterfaceGetStatus(Handle,ucInterface,pucStatus);

Executes the Standard Device Request that obtains the status of an interface.

ulrc=UsbInterfaceClearFeature(Handle,ucInterface,ucFeature);

Executes the Standard Device Request that clears or disables an interface feature.

ulrc=UsbInterfaceSetFeature(Handle,ucInterface,ucFeature);

Executes the Standard Device Request that sets or enables an interface feature.

Obtain Descriptor

ulrc=UsbDeviceGetDescriptor(Handle,usLength,pucDescriptor);

Executes the Standard Device Request that obtains the Device Descriptor.

ulrc=UsbConfigurationGetDescriptor(Handle,usLength,pucDescriptor);

Executes the Standard Device Request that obtains the Configuration Descriptor.

ulrc=UsbStringGetDescriptor(Handle,ucIndex,usLanguage,usLength,pucDescriptor);

Executes the Standard Device Request that obtains the String Descriptor.

Supply Descriptor

ulrc=UsbDeviceSetDescriptor(Handle,usLength,pucDescriptor);

Executes the Standard Device Request that updates the Device Descriptor.

ulrc=UsbConfigurationSetDescriptor(Handle,usLength,pucDescriptor);

Executes the Standard Device Request that updates the Configuration Descriptor.

ulrc=UsbStringSetDescriptor(Handle,ucIndex,usLanguage,usLength,pucDescriptor);

Executes the Standard Device Request that adds or updates the String Descriptor.

Device Driver Interface

USBRESMG.SYS is the device driver. USB Device Monitor Version 0.9.7 is the only one allowed to use this interface.

REXX/2 Interface

USBCALLS.DLL supplies the REXX/2 External Functions. See the USBCALLS - REXX/2 Reference Guide.

Conforms to XHTML 1.0 Conforms to CSS 2.1 © W.M.Brul 2013-2017, all rights reserved.