able to subscribe for >10hrs and still running

Dependencies:   ADE7758_v1 Crypto DHT11 MQTT MbedJSONValue SDFileSystem SPI_TFT_ILI9341 SWSPI SetRTC TFT_fonts Touch W5500Interface mbed-rtos mbed-src tuanpm

Fork of PB_emma_controller_mbed_src by Emma

Files at this revision

API Documentation at this revision

Comitter:
arsenalist
Date:
Fri Jul 03 07:15:29 2015 +0000
Parent:
0:f4e449fa34d7
Child:
2:fdfdeb5fd6fd
Commit message:
Update previous commit.

Changed in this revision

emmaCode.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/emmaCode.cpp	Fri Jul 03 07:05:21 2015 +0000
+++ b/emmaCode.cpp	Fri Jul 03 07:15:29 2015 +0000
@@ -770,7 +770,6 @@
             //}
             
             //check for new command
-            /*
             if(newCommand) {
                 DBG.printf("newCommand\r\n");
                 MbedJSONValue jsonValue;
@@ -797,11 +796,15 @@
                     else if(commandNType == "1") {  //node with mac address
                         DBG.printf("command for node\r\n");
                         //get node ip address based on node mac address
-                        string nodeIP = readNodeIP(commandNAddr);
+                        string nodeIP;
+                        //nodeIp = readNodeIP(commandNAddr);
+                        nodeIP = "192.168.2.15";
                         //DBG.printf("nodeIP: %s\r\n",nodeIP.c_str());
                         
                         //get cmd string based on device type and command number
-                        string nodeCmd = readNodeCmd(commandDType,commandCmd);
+                        string nodeCmd;
+                        //nodeCmd = readNodeCmd(commandDType,commandCmd);
+                        nodeCmd = "020129A0163B161315131613153C151316131514143C153C16141414141415151315141414141514141415141414143D1514143D141415141414143D14000D";
                         //DBG.printf("nodeCmd: %s\r\n",nodeCmd.c_str());
                         
                         //execute command
@@ -852,8 +855,7 @@
                     }
                 }
                 newCommand = false;
-            }
-            */    
+            }    
         }
     }
     //operation eth
@@ -1183,13 +1185,13 @@
     }
 }
 void mqttConnected(void* response) {
-    DBG.printf("Connected\r\n");
+    DBG.printf("MQTT Connected\r\n");
     char mqttTopic[64];
     sprintf(mqttTopic,"%s/%s/command",platformDOMAIN.c_str(),emmaUID.c_str());
     mqtt.subscribe(mqttTopic);
 }
 void mqttDisconnected(void* response) {
-    DBG.printf("Disconnected\r\n");    
+    DBG.printf("MQTT Disconnected\r\n");    
 }
 void mqttData(void* response) {
     RESPONSE res(response);