Time: 17:33 Date: 10/12/2017 Description: Task 1,7,8 Currently Functioning

Dependencies:   BME280 BMP280 TextLCD

Working Repository

Revision:
36:a0098306fc58
Parent:
35:26b0a9b55d82
Child:
37:7c4d7f206039
--- a/NETWORK.cpp	Sun Jan 07 13:32:54 2018 +0000
+++ b/NETWORK.cpp	Sun Jan 07 16:17:24 2018 +0000
@@ -26,28 +26,48 @@
     /* Can handle 5 simultaneous connections */
     srv.listen(5);
 }
-void Networking()
+void Networking(int network_day, int network_month, int network_year, int network_hours, int network_minute, float network_temperature, float network_pressure, float network_light)
 {    
         //using namespace std;
         //Block and wait on an incoming connection
         srv.accept(&clt_sock, &clt_addr);
         printf("accept %s:%d\n", clt_addr.get_ip_address(), clt_addr.get_port());
-        
+        printf("In networking");
         //Uses a C++ string to make it easier to concatinate
         string response;
         //This is a C string
-        char ldr_str[64];
+        char output1_str[64];
+        char output2_str[64];
+        char output3_str[64];
+        char output4_str[64];
+        char output5_str[64];
+        char output6_str[64];
+        char output7_str[64];
+        char output8_str[64];
+        
         
-        //Read the LDR value
-        float u = ldr;
+     
+        //Convert to a C String
+        sprintf(output1_str, "%d/" , network_day);
+        sprintf(output2_str, "%d/" , network_month);
+        sprintf(output3_str, "%d   " , network_year);
+        sprintf(output4_str, "Time:%d:" , network_hours);
+        sprintf(output5_str, "%d   " , network_minute);
+        sprintf(output6_str, "Temperature is : %1.1f   " , network_temperature);
+        sprintf(output7_str, "Pressure is : %1.1f   " , network_pressure);
+        sprintf(output8_str, "Light is : %5.3f   " , network_light);
         
-        //Convert to a C String
-        sprintf(ldr_str, "%5.3f", u );
-        printf("LDR: %5.3f\n\r", u);
         
         //Build the C++ string response
         response = HTTP_MESSAGE_BODY1;
-        response += ldr_str;
+        response +=output1_str;
+        response +=output2_str;
+        response +=output3_str;
+        response +=output4_str;
+        response +=output5_str;
+        response +=output6_str;
+        response +=output7_str;
+        response +=output8_str;
         response += HTTP_MESSAGE_BODY2;
         
         //Send static HTML response (as a C string)