I want to create a simple web server on a SAM4E. I have found a example but I would like to change the website. Now it's just plain html code:
if(( NULL != pcRxString)
&& ( !strncmp( pcRxString, "GET", 3 ) ))
{
/* Update the hit count. */
ulPageHits++;
sprintf( cPageHits, "%d", (int)ulPageHits );
/* Write out the HTTP OK header. */
netconn_write( pxNetCon, webHTTP_OK, (u16_t) strlen( webHTTP_OK ), NETCONN_COPY );
/* Generate the dynamic page... First the page header. */
strcpy( cDynamicPage, webHTML_START );
/* ... Then the hit count... */
strcat( cDynamicPage, cPageHits );
strcat( cDynamicPage, "<p><pre>Task State Priority Stack #<br>************************************************<br>" );
/* ... Then the list of tasks and their status... */
vTaskList( ( signed portCHAR * ) cDynamicPage + strlen( cDynamicPage ) );
/* ... Finally the page footer. */
strcat( cDynamicPage, webHTML_END );
/* Write out the dynamically generated page. */
netconn_write( pxNetCon, cDynamicPage, (u16_t) strlen( cDynamicPage ), NETCONN_COPY );
}
Is it possible to include an index.html and include that in the build? So I don't have to write the entire code but only include a simple html file.
fopen()has little to do with the language or hardware, and everything to do with the system software or custom components being run on the device, which is unspecified here. – Chris Stratton Nov 13 '17 at 21:35