Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BSP_B-L475E-IOT01
Revision 2:e64b4470877a, committed 2020-10-13
- 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;
             }