#include <cafe.h>
#include <cafe/hio.h>

HIOStatus HIOReadAsync(HIOHandle      handle, 
                       u32            sizeInBytes, 
                       void          *pData,
                       HIOAsyncParam  asyncParam, 
                       void          *context);


handle Handle of the channel from which to read.
sizeInBytes Number of bytes to read.
pData Pointer to the destination of the data read.
asyncParam Callback function to invoke upon completion of the operation.
context Pointer to user-specified local storage.

Return Values

HIO_STATUS_OK Successfully submitted the asynchronous read request.
HIO_STATUS_NO_CLIENT_TXN_BUF_AVAILABLE The asynchronous read request could not be submitted. Retry the request as the condition is temporary.
< 0 The asynchronous read request failed to be submitted.


Invokes a read from the specified channel and returns immediately. Upon completion, the specified callback asyncParam is invoked.

The preference for applications should be the HIOReadAsyncEx function as it provides more flexibility for asynchronous callbacks. This function is provided for compatibility.

The callback specified by asyncParam will not receive status notifications indicating that the connection has ended. Only the callbacks for HIOOpen or HIOOpenEx will receive the HIO_STATUS_NO_CONNECTIONS status code.

Do Not Call From

Callbacks Do not call this function from any callback function.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.
Production code Do not call this function in production code. It is available only for debugging purposes.

See Also


Revision History

2013-05-08 Automated cleanup pass.
2011-12-06 Added note regarding callback status code.
2011-11-04 Updated return values.
2011-02-21 Initial version.