HIOWriteAsync

Syntax

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

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

Parameters

handle Channel to write.
sizeInBytes Number of bytes to write.
pData Pointer to the data to write.
asyncParam Callback to invoke upon completion of the operation.
context Pointer to user-specified local storage.

Return Values

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

Description

Invokes a write operation for the specified number of bytes on the channel designated by handle and returns immediately.

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

The callback function will be provided the number of bytes successfully written. The user must ensure that the number of bytes written matches the number of bytes specified by sizeInBytes. The user may have to issue another call to write the remaining data.

NOTE:
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

HIORead
HIOReadAsync
HIOReadAsyncEx
HIOWrite
HIOWriteAsyncEx

Revision History

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


CONFIDENTIAL