CPS_SocWrite

C Specification

#include <nitroWiFi/cps.h>
u32 CPS_SocWrite (u8 *buf, u32 len);

Arguments

buf Output buffer
len Length of output buffer

Return Values

The length of the output data.

Description

Outputs PING/UDP/TCP. Blocks until complete. For TCP, the process waits to receive an ACK for the output data that will be returned; therefore, outputting small units of data is inefficient. Buffering in the application or using the output service through the buffer prepared by the CPS Library is good. The pointer passed to CPS_SocWrite() can be anywhere. If an address is obtained by adding a constant (14 + 20 + 8 for UDP or 14 + 20 + 20 for TCP) to CPSSoc.sndbuf.data, ARM9 executes this with no-copy, and the speed and memory efficiency is advantageous. Applications must not use CPSSoc.sndbuf.data for any other purpose. This can also be mixed with output services through a buffer. Data output occurs after an internal process equivalent to CPS_SocFlush() completes. The data length of the actual output is returned. This blocks.

See Also

CPSSoc, CPS_SocFlush, CPS_GetProperSize

Revision History

10/21/2005 Initial version.