User Manual
void flush (void)
Forces any buffered data to be transmitted to the TCP server, regardless of the size of the content.
Parameters: None
Returns: Nothing
Callback API
To make working with TCP sockets easier, a simple callback API is available in AdafruitTCP based on the following
functions:
void setReceivedCallback (tcpcallback_t fp)
Registers the data received callback handler.
Parameters:
fp: The name of the function that will be executed when received data is available from the TCP server. See the
example below for details on the function signature.
Returns: Nothing
void setDisconnectCallback (tcpcallback_t fp)
Registers the disconnect callback handler (fired when you are disconnected from the TCP server).
Parameters:
fp: The name of the function that will be executed when you are disconnected from the TCP server. See the
example below for details on the function signature.
Returns: Nothing
Callback Function Signatures
The data received and disconnect callbacks both require a specific function definition to work. The function names
('receive_callback' and 'disconnect_callback') can change, but the exact signatures are shown below:
You then register the callbacks with the dedicated set callback functions:
void receive_callback ( void );
void disconnect_callback ( void );
Make sure you register the callbacks BEFORE calling the .connect function!
© Adafruit Industries https://learn.adafruit.com/introducing-the-adafruit-wiced-feather-wifi Page 79 of 202










