User Manual

void info_html_generator (const char* url, const char* query, httppage_request_t* http_request);
void file_not_found_generator (const char* url, const char* query, httppage_request_t* http_request);
const char hello_html[] = "<html><body> <h1>Hello World!</h1> </body></html>";
HTTPPage pages[] =
{
HTTPPageRedirect("/", "/hello.html"), // redirect root to hello page
HTTPPage("/hello.html", HTTP_MIME_TEXT_HTML, hello_html),
HTTPPage("/info.html" , HTTP_MIME_TEXT_HTML, info_html_generator),
HTTPPage("/404.html" , HTTP_MIME_TEXT_HTML, file_not_found_generator),
};
uint8_t pagecount = sizeof(pages)/sizeof(HTTPPage);
// Declare HTTPServer with max number of pages
AdafruitHTTPServer httpserver(pagecount);
/**************************************************************************/
/*!
* @brief Example of generating dynamic HTML content on demand
*
* Link is separated to url and query
*
* @param url url of this page
* @param query query string after '?' e.g "var=value"
*
* @param http_request This request's information
*/
/**************************************************************************/
void info_html_generator (const char* url, const char* query, httppage_request_t* http_request)
{
(void) url;
(void) query;
(void) http_request;
httpserver.print("<b>Bootloader</b> : ");
httpserver.print( Feather.bootloaderVersion() );
httpserver.print("<br>");
httpserver.print("<b>WICED SDK</b> : ");
httpserver.print( Feather.sdkVersion() );
httpserver.print("<br>");
httpserver.print("<b>FeatherLib</b> : ");
httpserver.print( Feather.firmwareVersion() );
httpserver.print("<br>");
httpserver.print("<b>Arduino API</b> : ");
httpserver.print( Feather.arduinoVersion() );
httpserver.print("<br>");
httpserver.print("<br>");
visit_count++;
httpserver.print("<b>visit count</b> : ");
httpserver.print(visit_count);
}
/**************************************************************************/
/*!
© Adafruit Industries https://learn.adafruit.com/introducing-the-adafruit-wiced-feather-wifi Page 105 of 202