emma controller code in production board v1

Dependencies:   ADE7758_v1 Crypto DHT11 MQTT MbedJSONValueEmma SDFileSystem TFT_ILI9341 SWSPI SetRTC TFT_fonts Touch W5500Interface mbed-rtos mbed-src SoftSerial

Fork of emma_controller_energy by Emma

Revision:
48:053e92b6dc1e
Parent:
47:97eadcb478b2
Child:
50:50d98fe6cc15
diff -r 97eadcb478b2 -r 053e92b6dc1e emmaCode.h
--- a/emmaCode.h	Fri Aug 28 04:17:31 2015 +0000
+++ b/emmaCode.h	Tue Sep 01 11:52:52 2015 +0000
@@ -8,6 +8,7 @@
 //#include "MQTTClient.h"         //eth mqtt
 //#include "MQTTEthernet.h"       //eth mqtt
 #include "EthernetInterface.h"  //eth rest
+#include "SoftSerial.h"         //gprs rest and other software serial
 #include "MbedJSONValue.h"      //json
 #include "SDFileSystem.h"       //sd card
 #include "Crypto.h"             //hash calculation
@@ -97,6 +98,17 @@
 void checkVoltagePower(void);
 /*end energy related*/
 
+/*start eth mqtt*/
+//int publish(MQTT::Client<MQTTEthernet, Countdown, MQTT_MAX_PACKET_SIZE>* client, MQTTEthernet* ipstack);
+//void ethMQTTMessageArrived(MQTT::MessageData& md);
+//int ethMQTTConnect(MQTT::Client<MQTTEthernet, Countdown, MQTT_MAX_PACKET_SIZE>* client, MQTTEthernet* ipstack);
+//void ethMQTTAttemptConnect(MQTT::Client<MQTTEthernet, Countdown, MQTT_MAX_PACKET_SIZE>* client, MQTTEthernet* ipstack);
+/*end eth mqtt*/
+
+/*start eth rest*/
+string ethREST(string host, int port, string data);
+/*end eth rest*/
+
 /*start wifi mqtt*/
 void mqttConnected(void* response);
 void mqttDisconnected(void* response);
@@ -106,14 +118,15 @@
 void wifiCb(void* response);
 void rxInterrupt(void);
 void checkRxBuffer(void);
+void wifiRcvReply(char *r, int to);
 /*end wifi rest*/
 
-/*start eth mqtt*/
-//int publish(MQTT::Client<MQTTEthernet, Countdown, MQTT_MAX_PACKET_SIZE>* client, MQTTEthernet* ipstack);
-//void ethMQTTMessageArrived(MQTT::MessageData& md);
-//int ethMQTTConnect(MQTT::Client<MQTTEthernet, Countdown, MQTT_MAX_PACKET_SIZE>* client, MQTTEthernet* ipstack);
-//void ethMQTTAttemptConnect(MQTT::Client<MQTTEthernet, Countdown, MQTT_MAX_PACKET_SIZE>* client, MQTTEthernet* ipstack);
-/*end eth mqtt*/
+/*start gprs rest*/
+void gprsReset(void);
+string gprsInit(string APN);
+string gprsREST(string host, int port, string data);
+void gprsRcvReply(char *r, int to);
+/*end gprs rest*/
 
 /*start emma settings*/
 string getUID(void);
@@ -128,17 +141,12 @@
 string wifiGetNodeTemp(string macAddr);
 /*end nodes*/
 
-/*start emma connection function*/
-string ethREST(string host, int port, string data);
-/*end emma connection function*/
-
 /*start emma private function*/
 void isEthAvailable(void);
 void isEthConnected(void);
 void isWiFiConnected(void);
 void isGprsConnected(void);
 void addChar(char *s, char c);
-void rcvReply(char *r, int to);
 string calculateMD5(string text);
 bool writeFirmwareHexToChar(string value);
 bool clearFirmware(void);