This is a non working version of my ethernet with sd card, i do not know why
Dependencies: SDFileSystem mbed
Fork of eth_v13 by
Diff: httpServer.cpp
- Revision:
- 4:01cb86c138d8
- Parent:
- 3:79dc3337d9da
--- a/httpServer.cpp Fri Mar 21 00:18:33 2014 +0000 +++ b/httpServer.cpp Thu Mar 27 21:58:15 2014 +0000 @@ -36,7 +36,7 @@ // Größe des Empfangspuffers einlesen int size = tcpSocket.getRxSize(); -counter++; + counter++; pc.printf("\n\n!! Was empfangen (%d)(%d)\n\n", _port, size); @@ -54,7 +54,7 @@ // Erkenne die Anfrage ptrToken = strtok(NULL, " /&\r\n"); - if (strncmp(ptrToken, "heiko", strlen("heiko")) == 0) { + if (strncmp(ptrToken, "test", strlen("test")) == 0) { tcpSocket.send(c_HTTP_200_OK, strlen(c_HTTP_200_OK)); tcpSocket.send(c_HTTP_CacheControl_NoCache, strlen(c_HTTP_CacheControl_NoCache)); tcpSocket.send(c_HTTP_Content_HTML, strlen(c_HTTP_Content_HTML)); @@ -65,18 +65,27 @@ } else if (strncmp(ptrToken, "zeit", strlen("zeit")) == 0) { tcpSocket.send(c_HTTP_200_OK, strlen(c_HTTP_200_OK)); tcpSocket.send(c_HTTP_CacheControl_NoCache, strlen(c_HTTP_CacheControl_NoCache)); + tcpSocket.send(http_refresh, strlen(http_refresh)); + tcpSocket.send(c_HTTP_Content_HTML, strlen(c_HTTP_Content_HTML)); tcpSocket.send(c_HTTP_EmptyLine, strlen(c_HTTP_EmptyLine)); tcpSocket.send(html_head, strlen(html_head)); - - sprintf(buf, "Zaehler : %d \r\n\r\n", counter); + + //sprintf(buf, "Zaehler : %d \r\n\r\n", counter); + + tcpSocket.send(html_table_head, strlen(html_table_head)); - for (int i=0; i<1000; i++) tcpSocket.send(buf, strlen(buf)); - + for (int i=0; i<10; i++) { + //sprintf(buf, "Zaehler : %d, %d \r\n\r\n", counter, i); + sprintf(buf, "<tr><th>%d</th><th>%d</th><th>%d</th></tr>", counter, i, counter*counter); + tcpSocket.send(buf, strlen(buf)); + } + + tcpSocket.send(html_table_foot, strlen(html_table_foot)); tcpSocket.send(html_foot, strlen(html_foot)); - - + + } else { tcpSocket.send(c_HTTP_404_NotFound, strlen(c_HTTP_404_NotFound)); tcpSocket.send(c_HTTP_CacheControl_NoCache, strlen(c_HTTP_CacheControl_NoCache));