Recovers received packets from the channel associated with the specified handle.
#include txcpi.h
S16 cpi_get_data ( TX_HANDLE handle, CPIPKT *buffer, S16 *len)
Argument |
Description |
handle |
TX handle associated with the channel. |
buffer |
Pointer to a location to store the received packet. |
len |
Pointer to the length of the buffer on input and the length of the received packet on output. |
Return value |
Description |
CPI_SUCCESS |
Packet successfully received. |
CPI_ERROR |
Call cpi_get_last_error to obtain the error code. |
CPI_TRUNCATED |
Received length is longer than the specified buffer length. |
Specify the length of the buffer in the len parameter in the call to cpi_get_data. If there is no packet to receive, cpi_get_data returns CPI_SUCCESS and len is set to zero. If there is a packet, cpi_get_data returns CPI_SUCCESS, the length is placed in len, and the packet is copied into the specified buffer.