Dependencies: BSP_B-L475E-IOT01
Diff: main.cpp
- Revision:
- 2:e64b4470877a
- Parent:
- 1:2c451ce6086b
--- 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; }