mqtt specific components for the impact mbed endpoint library

Dependents:   mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_mqtt_endpoint_nxp

Files at this revision

API Documentation at this revision

Comitter:
ansond
Date:
Tue Apr 01 20:06:30 2014 +0000
Parent:
19:194cdc5e5a1e
Child:
21:54e3ad1c5c2e
Commit message:
updates

Changed in this revision

MQTTDefinitions.h Show annotated file Show diff for this revision Revisions of this file
MQTTTransport.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/MQTTDefinitions.h	Tue Apr 01 03:23:25 2014 +0000
+++ b/MQTTDefinitions.h	Tue Apr 01 20:06:30 2014 +0000
@@ -94,7 +94,7 @@
 #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                            // Send ping to GW every 1200'th 250ms iterations (5 minutes)
+#define MQTT_PING_COUNTDOWN         3600                            // Send ping to GW every 3600'th 250ms iteration (approx 15 minutes)
 #define MQTT_MAX_COUNTER            32768                           // largest Ping counter before reset back to 1
 
 #endif // _MQTT_DEFINITIONS_H_
\ No newline at end of file
--- a/MQTTTransport.cpp	Tue Apr 01 03:23:25 2014 +0000
+++ b/MQTTTransport.cpp	Tue Apr 01 20:06:30 2014 +0000
@@ -360,15 +360,18 @@
          wait_ms(1000);
      }
      else {
+         // fail silently now...
+         ; 
+         
          // send failed! - reconnect
-         this->logger()->log("PING send %d FAILED... (re)connecting...",this->m_ping_counter);
+         //this->logger()->log("PING send %d FAILED... (re)connecting...",this->m_ping_counter);
          
          // attempt reconnect
-         this->logger()->log("PING send failed - re-connecting MQTT...");
-         this->disconnect();
-         sent = this->connect();
-         if (sent) this->logger()->log("PING %d: MQTT reconnection successful...",this->m_ping_counter);
-         else this->logger()->log("PING %d: resend failed giving up...",this->m_ping_counter);
+         //this->logger()->log("PING send failed - re-connecting MQTT...");
+         //this->disconnect();
+         //sent = this->connect();
+         //if (sent) this->logger()->log("PING %d: MQTT reconnection successful...",this->m_ping_counter);
+         //else this->logger()->log("PING %d: resend failed giving up...",this->m_ping_counter);
      }
      
      // return our status