TCPIP_TCP_StringPut Function

C

const uint8_t* TCPIP_TCP_StringPut(
    TCP_SOCKET hTCP, 
    const uint8_t* Data
);

Description

This function writes a null-terminated string to a TCP socket. The null-terminator is not copied to the socket.

Preconditions

TCP is initialized.

Parameters

ParametersDescription
hTCPThe socket to which data is to be written.
dataPointer to the string to be written.

Returns

Pointer to the byte following the last byte written to the socket. If this pointer does not dereference to a NULL byte, the buffer became full or the socket is not connected.

Remarks

The return value of this function differs from that of TCPIP_TCP_ArrayPut. To write long strings in a single state, initialize the *data pointer to the first byte, then call this function repeatedly (breaking to the main stack loop after each call) until the return value dereferences to a NULL byte. Save the return value as the new starting *data pointer otherwise.