Modified to run on Renesas GR Peach board

Dependents:   GR-PeachAHRSWeb

Fork of HTTP-Server by Francois Berder

Revision:
11:d03f12a19999
Parent:
10:8b4c3d605bf0
diff -r 8b4c3d605bf0 -r d03f12a19999 Formatter.cpp
--- a/Formatter.cpp	Thu Jul 18 10:10:14 2013 +0000
+++ b/Formatter.cpp	Wed Oct 07 20:35:31 2015 +0000
@@ -2,6 +2,7 @@
 #include "mbed.h"
 #include "RPCObjectManager.h"
 #include "EthernetInterface.h"
+#include "page3.h"
 
 const char *SIMPLE_HTML_CODE = "\
 <!DOCTYPE html>\
@@ -78,7 +79,7 @@
 </body> \
 </html>";
 
-static char chunk[1024];
+static char chunk[2048];
         
 Formatter::Formatter(int nb):
 currentChunk(0),
@@ -97,7 +98,8 @@
     }
     else
         currentChunk = 0;
-    
+        //strcat(chunk, Page3);
+
     return chunk;
 }    
 
@@ -113,8 +115,9 @@
 
 void SimpleHTMLFormatter::get_chunk(const int c, char* reply)
 {
-    strcat(chunk, SIMPLE_HTML_CODE);
-    
+    printf("using simple formatter\n\r");
+    strcat(chunk, Page3);
+  /*  
     if(reply != NULL && strlen(reply) != 0)
     {
         strcat(chunk, "RPC reply : ");
@@ -135,7 +138,7 @@
         strcat(chunk, "</ul>");
     }
     
-    strcat(chunk, "</body></html>");
+    strcat(chunk, "</body></html>");*/
 }
 
 InteractiveHTMLFormatter::InteractiveHTMLFormatter():
@@ -145,9 +148,12 @@
 
 void InteractiveHTMLFormatter::get_chunk(const int c, char *reply)
 {
+    printf("\n\r c for loop is %d\n\r",c);
     if(c == 0)
         sprintf(chunk, INTERACTIVE_HTML_CODE_1, EthernetInterface::getIPAddress());
 
+        //sprintf(chunk, Page3, sizeof(Page3));//, EthernetInterface::getIPAddress());
+
     else if(c == 1)
     {
         if(reply != NULL && strlen(reply) != 0)
@@ -179,6 +185,7 @@
     }
     else if(c == 2)
         strcat(chunk, INTERACTIVE_HTML_CODE_2);
+    printf("done with formatter\n\r");
 }