cpia_send

Asynchronously sends a packet of data over the specified channel.

Prototype

#include txcpi.h

S16 cpia_send ( TX_HANDLE handle, CPIPKT *buffer, void *user_tx_key)

Argument

Description

handle

TX_HANDLE associated with the channel.

buffer

Pointer to a CPIPKT structure containing data to send.

user_tx_key

Pointer to a user-defined key returned when I/O completes.


Return values

Return value

Description

CPI_SUCCESS

Packet send successfully started. Completes when cpia_txnotify is called.

CPI_ERROR

Call cpi_get_last_error to obtain the error code.

CPI_INVALID_MODE

Handle is not open for asynchronous I/O.

CPI_QUEUE_FULL

Maximum number of pending asynchronous I/O requests already in progress.


Details

The value returned by cpia_send reflects the result of enqueing the packet for transmission. The ultimate disposition of the packet is passed back as a parameter to cpia_txnotify.

Once sent, a packet cannot be unsent (that is, there is no cpia_cancel).

Final I/O result notification is handled by cpia_intr and cpia_txnotify callback.

The CPIPKT structure pointed to by the buffer parameter cannot be freed, re-used, or re-allocated until the final disposition of the packet is determined with cpia_intr and cpia_txnotify. Failure to adhere to this requirement causes unreliable and unpredictable results.

See also

cpia_open, cpix_open