Datasheet

Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com
The data exchange can be full-duplex, so both Server and Client can send and receive packets.
To write data TCPWrite(TCP_SOCKET socktowrite, char* writech,
int wlen);
Parameters:
socktowrite: the TCP socket connection to write
writech: the char array of data to write out
wlen: the length of data to write
NOTE: The receive method is a little bit different. The user should first check how many chars arrived
from the TCP connection, then call the read function
To know the rx length TCPRxLen(TCP_SOCKET socklen);
Parameters:
socklen: the TCP socket to check
Returns:
WORD number of bytes available to be read
To read the rx buffer TCPRead( TCP_SOCKET socktoread, char[] readch,
int rlen);
Parameters:
socktoread: the TCP socket to read
readch: the char array to fill with the read characters
rlen: the number of characters to read (the word returned by TCPRxLen);
Warning
The length of the array must be AT LEAST = rlen + 1, because at the end of the operation the
array is automatically NULL terminated (is added the '\0' character).
To read the rx buffer without clearing it → TCPpRead( TCP_SOCKET socktoread,
char readch[], int rlen,
int start);
Parameters:
socktoread: the TCP socket to read
readch: the char array to fill with the read characters
rlen: the number of characters to read (the word returned by TCPRxLen);
start: the starting point to read
Warning
The length of the array must be AT LEAST = rlen + 1, because at the end of the operation the
array is automatically NULL terminated (is added the '\0' character).
To clear the rx buffer TCPRxFlush(TCP_SOCKET socktoflush);
Parameters:
socktoflush: the TCP socket to clear
41