Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: C027_Support C12832 StatusReporter LM75B MQTT-ansond c027_radios endpoint_core endpoint_mqtt mbed-rtos mbed
Diff: MQTTTransport.cpp
- Revision:
- 161:eea2bbfbb387
- Parent:
- 160:3f373ec7ab3c
- Child:
- 162:c9e9926cdc79
diff -r 3f373ec7ab3c -r eea2bbfbb387 MQTTTransport.cpp
--- a/MQTTTransport.cpp Fri Mar 21 05:23:52 2014 +0000
+++ b/MQTTTransport.cpp Fri Mar 21 05:33:18 2014 +0000
@@ -384,8 +384,15 @@
if (this->m_mqtt->connect(id)) {
this->logger()->log("MQTT Subscribe: Topic: %s...",this->getTopic());
if (this->m_mqtt->subscribe(this->getTopic())) {
- this->logger()->log("MQTT CONNECTED.");
- this->m_connected = true;
+ if (this->m_mqtt->subscribe(MQTT_IOC_ALL_TOPIC)) {
+ this->logger()->log("MQTT CONNECTED.");
+ this->m_connected = true;
+ }
+ else {
+ this->logger()->log("MQTT Subscribe: Topic: %s FAILED",MQTT_IOC_ALL_TOPIC);
+ this->logger()->turnLEDRed();
+ this->m_connected = false;
+ }
}
else {
this->logger()->log("MQTT Subscribe: Topic: %s FAILED",this->getTopic());