User Manual
// Tell the TCP Server to auto print error codes and halt on errors
tcpserver.err_actions(true, true);
// Setup callbacks: must be done before begin()
tcpserver.setConnectCallback(connect_request_callback);
// Starting server at defined port
tcpserver.begin();
Serial.print("Listening on port "); Serial.println(PORT);
}
/**************************************************************************/
/*!
@brief This loop function runs over and over again
*/
/**************************************************************************/
void loop()
{
}
/**************************************************************************/
/*!
@brief Connect to the pre-defined access point
*/
/**************************************************************************/
bool connectAP(void)
{
// Attempt to connect to an AP
Serial.print("Please wait while connecting to: '" WLAN_SSID "' ... ");
if ( Feather.connect(WLAN_SSID, WLAN_PASS) )
{
Serial.println("Connected!");
}
else
{
Serial.printf("Failed! %s (%d)", Feather.errstr(), Feather.errno());
Serial.println();
}
Serial.println();
return Feather.connected();
}
© Adafruit Industries https://learn.adafruit.com/introducing-the-adafruit-wiced-feather-wifi Page 86 of 202










