User Manual
/*!
* @brief HTTP 404 generator. The HTTP Server will automatically redirect
* to "/404.html" when it can't find the requested url in the
* list of registered pages
*
* The url and query string are already separated when this function
* is called.
*
* @param url url of this page
* @param query query string after '?' e.g "var=value"
* @param http_request Details about this HTTP request
*/
/**************************************************************************/
void file_not_found_generator (const char* url, const char* query, httppage_request_t* http_request)
{
(void) url;
(void) query;
(void) http_request;
httpserver.print("<html><body>");
httpserver.print("<h1>Error 404 File Not Found!</h1>");
httpserver.print("<br>");
httpserver.print("Available pages are:");
httpserver.print("<br>");
httpserver.print("<ul>");
for(int i=0; i<pagecount; i++)
{
httpserver.print("<li>");
httpserver.print(pages[i].url);
httpserver.print("</li>");
}
httpserver.print("</ul>");
httpserver.print("</body></html>");
}
/**************************************************************************/
/*!
@brief The setup function runs once when the board comes out of reset
*/
/**************************************************************************/
void setup()
{
Serial.begin(115200);
// Wait for the USB serial to connect. Needed for native USB port only.
while (!Serial) delay(1);
Serial.println("Simple HTTP Server Example\r\n");
// Print all software versions
Feather.printVersions();
// Try to connect to an AP
while ( !connectAP() )
{
delay(500); // delay between each attempt
}
© Adafruit Industries https://learn.adafruit.com/introducing-the-adafruit-wiced-feather-wifi Page 106 of 202










