USB_RequestGetState (SWI&55390)

USB_RequestGetState (SWI&55390) — Checks the actual state of a request.

On Entry

R0Pointer to waiting structure.
R1Reserved. Must be set to zero.
R2Reserved. Must be set to zero.

On Exit

R0preserved
R1Error code Table A.1, “Error codes used by the USB system”
R2Request result

Use

This call is used to determine the state of a transaction started with USB_RequestStart (SWI&5538F). The returned result should be examined and appropriate action taken. The request states Table A.3, “Request States” indicate the condition of the transaction.

The two main result conditions of interest are USB_TRANSACTION_RESULT_OK which indicates a successfully completed transaction in which the data has been transfered as requested and USB_TRANSACTION_RESULT_WORKING which indicates the transaction has not yet completed, this allows the driver to yield the CPU to other tasks if required. All other result codes indicate an error condition of some kind which may or may not halt the pipe or have other effects, the driver must interpret these in a driver specific manner.

It is necessary to use this call to retrieve the state of a transaction, even if a "blocking" waiting mode was used to start the transaction, if the driver wishes to discover error conditions.

Related SWI's

USB_RequestStart (SWI&5538F)

Related Information

Chapter 7, Transactions

Chapter 6, Waiting