Scott Vincent / GUI
Revision:
1:1912637769a0
Parent:
0:3fb966466a8d
Child:
2:3232132ce1ea
--- a/GUI.cpp	Wed Mar 17 16:12:07 2021 +0000
+++ b/GUI.cpp	Wed Mar 17 20:10:05 2021 +0000
@@ -1,12 +1,15 @@
 #include "GUI.h"
+//#include "Defs_Sett.h"
 
 //Constructor
-GUI::GUI(char *GUI_URL,  EthernetInterface *eth):ws(GUI_URL, eth)
+GUI::GUI(char *GUI_URL,  EthernetInterface *eth, bool* flag):ws(GUI_URL, eth)
 {
     if(ws.connect()) {
         printf("WS connected\r\n");
+        *flag = true;
     } else {
         printf("WS failed\r\n");
+        *flag = false;
     }
     
     ws.send("{\"topic\":\"FRDM\"}");
@@ -37,12 +40,16 @@
             *activeTracking = doc["activeTracking"];
             msgReceived = true;
         }
-
+        
         if (doc.containsKey("powerOn")) {
             *powerOn = doc["powerOn"];
+            //*mode = (*powerOn) ? 1 : *mode; // OP_POWER_OFF
+            //*mode = (*mode == 1 && *powerOn) ? 1 : *mode; // OP_POWER_OFF, OP_NORMAL
             msgReceived = true;
         }
+        
     }
+    
         
     return msgReceived;
 }