MBED MQTT Lighting Endpoint for NXP Ublox (Ethernet enabled)

Dependencies:   C027 C12832 EthernetInterface StatusReporter LM75B MQTT-ansond endpoint_core endpoint_mqtt mbed-rtos mbed

Revision:
129:c4fa24308e33
Parent:
125:f47543f28298
Child:
130:9c52e163e733
--- a/Definitions.h	Sun Mar 16 06:16:04 2014 +0000
+++ b/Definitions.h	Sun Mar 16 17:30:59 2014 +0000
@@ -101,6 +101,9 @@
 // Index for Transport to use for Update/Load
 #define LOAD_TRANSPORT              1                               // 0 - MQTT, 1 - HTTP
 
+// largest MQTT message that PubSubClient will send
+#define MAX_MQTT_MESSAGE_LENGTH     128
+
 // MQTT connect information
 #define MQTT_HOSTNAME               "iocana.bcu.ac.uk"              // IOC MQTT Broker Host - iocana.bcu.ac.uk
 #define MQTT_HOSTPORT               1883                            // IOC MQTT Broker Port
@@ -109,10 +112,14 @@
 #define MQTT_ENDPOINT_IDLEN         64                              // IOC MQTT Endpoint ID length (max)
 #define MQTT_IOC_TOPIC              "ARM/sensinode/control/%s"      // IOC MQTT Topic 
 #define MQTT_IOC_ANNOUNCE_TOPIC     "ARM/sensinode/control/all"     // IOC MQTT Topic (since MQTT on MBED cannot seem to handle wildcards)
+#define MQTT_PING_TOPIC             "ARM/mqtt/ping"                 // GW-Node Ping/Pong topic (to keep this endpoint MQTT connection alive)
 #define MQTT_IOC_ALL_ENDPOINT       "all"                           // must be the same as the last element of MATT_IOC_ANNOUNCE_TOPIC
 #define MQTT_IOC_TOPIC_LEN          64                              // max length for the topic string
 #define MQTT_PAYLOAD_SEGMENT_LEN    64                              // max length for a segment of the payload
 #define MQTT_USERNAME               ""                              // IOC MQTT Username
 #define MQTT_PASSWORD               ""                              // IOC MQTT Password
+#define MQTT_PING_VERB_LEN          10                              // Ping or Pong
+#define MQTT_PING_COUNTDOWN         1200                            // every 1200 250ms iterations (5 minutes)
+#define MQTT_MAX_COUNTER            32768                           // largest Ping counter before reset back to 1
 
 #endif // _DEFINITIONS_H
\ No newline at end of file