表示された文字の修正

Dependencies:   RemoteIR TextLCD

Revision:
61:85daf80c7727
Parent:
60:8a4869455ee6
Child:
62:5b4e62edaac4
--- a/main.cpp	Mon Sep 07 02:01:27 2020 +0000
+++ b/main.cpp	Mon Sep 07 05:27:16 2020 +0000
@@ -4,9 +4,9 @@
  */
  
  /*
- Version    0.03
+ Version    0.04
  Date       2020/09/07
- Uploader   Tomotsugu Ogawa
+ Uploader   Taku Nishimura
  
  更新するときにここも変える!
  
@@ -208,6 +208,7 @@
 char replybuff[1024];
 char webdata[1024]; // This may need to be bigger depending on WEB browser used
 char webbuff[4096];     // Currently using 1986 characters, Increase this if more web page data added
+char httpbuff[4096];
 int port        =80;  // set server port
 int SERVtimeout =5;    // set server timeout in seconds in case link breaks.
 char ssid[32] = "mbed05"; // enter WiFi router ssid inside the quotes
@@ -943,8 +944,8 @@
 {
 // WEB page data
  
-    strcpy(webbuff, "HTTP/1.1 200 OK\nDate: Thu, 03 Sep 2020 07:43:28 GMT\nContent-Type: text/html\nContent-Length: 2843\nConnection: keep-alive\n\n");
-    strcat(webbuff, "<!DOCTYPE html>");
+    //strcpy(webbuff, "HTTP/1.1 200 OK\nDate: Thu, 03 Sep 2020 07:43:28 GMT\nContent-Type: text/html\nContent-Length: 2843\nConnection: keep-alive\n\n");
+    strcpy(webbuff, "<!DOCTYPE html>");
     strcat(webbuff, "<html><head><title>RobotCar</title><meta name='viewport' content='width=device-width'/>");
     //strcat(webbuff, "<meta http-equiv=\"refresh\" content=\"5\"; >");
     strcat(webbuff, "<style type=\"text/css\">.noselect{ width:100px;height:60px;}.light{ width:100px;height:60px;background-color:#00ff66;}.load{ width: 50px; height: 30px;font-size:10px}</style>");
@@ -1181,6 +1182,11 @@
     strcat(webbuff, "}");
     strcat(webbuff, "</script>");
     
+    bufl = strlen(webbuff); // get total page buffer length
+ 
+    sprintf(httpbuff, "%s",webbuff);
+    sprintf(webbuff, "HTTP/1.1 200 OK\nDate: Thu, 03 Sep 2020 07:43:28 GMT\nContent-Type: text/html\nContent-Length: %d\nConnection: keep-alive\n\n%s",bufl,httpbuff);
+    //pc.printf("\r\n*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\r\n%s\r\n",webbuff);
     
 // end of WEB page data
     bufl = strlen(webbuff); // get total page buffer length