Skip to content

Commit f00cfc9

Browse files
fixup! ArduinoIoTCloudTCP: switch to messages
1 parent 06cb55e commit f00cfc9

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

src/ArduinoIoTCloudTCP.cpp

-15
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ ArduinoIoTCloudTCP::ArduinoIoTCloudTCP()
7777
, _mqttClient{nullptr}
7878
, _deviceTopicOut("")
7979
, _deviceTopicIn("")
80-
, _shadowTopicOut("")
81-
, _shadowTopicIn("")
8280
, _dataTopicOut("")
8381
, _dataTopicIn("")
8482
#if OTA_ENABLED
@@ -575,14 +573,6 @@ void ArduinoIoTCloudTCP::attachThing()
575573
return;
576574
}
577575

578-
_shadowTopicIn = getTopic_shadowin();
579-
_shadowTopicOut = getTopic_shadowout();
580-
if (!_mqttClient.subscribe(_shadowTopicIn)) {
581-
DEBUG_ERROR("ArduinoIoTCloudTCP::%s could not subscribe to %s", __FUNCTION__, _shadowTopicIn.c_str());
582-
DEBUG_ERROR("Check your thing configuration, and press the reset button on your board.");
583-
return;
584-
}
585-
586576
DEBUG_INFO("Connected to Arduino IoT Cloud");
587577
DEBUG_INFO("Thing ID: %s", getThingId().c_str());
588578
execCloudEventCallback(ArduinoIoTCloudEvent::CONNECT);
@@ -595,11 +585,6 @@ void ArduinoIoTCloudTCP::detachThing()
595585
return;
596586
}
597587

598-
if (!_mqttClient.unsubscribe(_shadowTopicIn)) {
599-
DEBUG_ERROR("ArduinoIoTCloudTCP::%s could not unsubscribe from %s", __FUNCTION__, _shadowTopicIn.c_str());
600-
return;
601-
}
602-
603588
DEBUG_INFO("Disconnected from Arduino IoT Cloud");
604589
execCloudEventCallback(ArduinoIoTCloudEvent::DISCONNECT);
605590
}

src/ArduinoIoTCloudTCP.h

-5
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,6 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
168168

169169
String _deviceTopicOut;
170170
String _deviceTopicIn;
171-
String _shadowTopicOut;
172-
String _shadowTopicIn;
173171
String _messageTopicOut;
174172
String _messageTopicIn;
175173
String _dataTopicOut;
@@ -188,9 +186,6 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
188186
inline String getTopic_deviceout() { return String("/a/d/" + getDeviceId() + "/e/o");}
189187
inline String getTopic_devicein () { return String("/a/d/" + getDeviceId() + "/e/i");}
190188

191-
inline String getTopic_shadowout() { return ( getThingId().length() == 0) ? String("") : String("/a/t/" + getThingId() + "/shadow/o"); }
192-
inline String getTopic_shadowin () { return ( getThingId().length() == 0) ? String("") : String("/a/t/" + getThingId() + "/shadow/i"); }
193-
194189
inline String getTopic_messageout() { return String("/a/d/" + getDeviceId() + "/c/up");}
195190
inline String getTopic_messagein () { return String("/a/d/" + getDeviceId() + "/c/dw");}
196191

0 commit comments

Comments
 (0)