"Server: LUFA RNDIS\r\n"\r
"Connection: close\r\n\r\n";\r
\r
-/****************************************************************************************/\r
/** HTTP page to serve to the host when a HTTP request is made. This page is too long for a single response, thus it is automatically\r
* broken up into smaller blocks and sent as a series of packets each time the webserver application callback is run.\r
*/\r
" </body>"\r
"</html>";\r
\r
-void WebserverAppCallback(void)\r
+/** Initialization function for the simple HTTP webserver. */\r
+void WebserverApp_Init(void)\r
+{\r
+ /* Listen on port 80 for HTTP connections from hosts */\r
+ uip_listen(HTONS(80));\r
+}\r
+\r
+/** uIP stack application callback for the simple HTTP webserver. This function must be called each time the\r
+ * TCP/IP stack needs a TCP packet to be processed.\r
+ */\r
+void WebserverApp_Callback(void)\r
{\r
char* AppDataPtr = (char*)uip_appdata;\r
uint16_t AppDataSize = 0;\r
}\r
else if (BytesRemaining > MaxSegSize)\r
{\r
+ /* More bytes remaining to send than the maximum segment size, send next chunk */\r
AppDataSize = MaxSegSize;\r
}\r
else\r
{\r
+ /* Less bytes than the segment size remaining, send all remaining bytes in the one packet */\r
AppDataSize = BytesRemaining;\r
}\r
\r