V3 of the fire detector project

Dependencies:   BSP_B-L475E-IOT01

Files at this revision

API Documentation at this revision

Comitter:
cadix_ach
Date:
Tue Oct 13 13:17:26 2020 +0000
Parent:
1:2c451ce6086b
Commit message:
V3 of the fire detector project

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Oct 13 12:46:38 2020 +0000
+++ b/main.cpp	Tue Oct 13 13:17:26 2020 +0000
@@ -92,7 +92,7 @@
     //Temperature reading
     BSP_TSENSOR_Init();
     float temperature_value = 0;
-
+    int fire_state=1;
     //Check fire variable
     int numReadings = 0;
 
@@ -158,7 +158,7 @@
 
                 /* Construct content of HTTP command */
                 //message à transmettre (données des capteurs)
-                sprintf(message, "{\"field1\": %0.2f}", temperature_value);
+                sprintf(message, "{\"field1\": %0.2f, \"field2\": %d}", temperature_value,fire_state);
                 printf("Content Length = %d\r\n", (int)strlen(message));
 
                 /* Construct HTTP command to send */
@@ -196,7 +196,7 @@
                 }
                 // Close the socket to return its memory and bring down the network interface
                 socket.close();
-               
+               fire_state=0;
             }