Skip to content

Commit

Permalink
fixup! ArduinoIoTCloudTCP: switch to messages
Browse files Browse the repository at this point in the history
  • Loading branch information
andreagilardoni committed Apr 19, 2024
1 parent 06cb55e commit f00cfc9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
15 changes: 0 additions & 15 deletions src/ArduinoIoTCloudTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ ArduinoIoTCloudTCP::ArduinoIoTCloudTCP()
, _mqttClient{nullptr}
, _deviceTopicOut("")
, _deviceTopicIn("")
, _shadowTopicOut("")
, _shadowTopicIn("")
, _dataTopicOut("")
, _dataTopicIn("")
#if OTA_ENABLED
Expand Down Expand Up @@ -575,14 +573,6 @@ void ArduinoIoTCloudTCP::attachThing()
return;
}

_shadowTopicIn = getTopic_shadowin();
_shadowTopicOut = getTopic_shadowout();
if (!_mqttClient.subscribe(_shadowTopicIn)) {
DEBUG_ERROR("ArduinoIoTCloudTCP::%s could not subscribe to %s", __FUNCTION__, _shadowTopicIn.c_str());
DEBUG_ERROR("Check your thing configuration, and press the reset button on your board.");
return;
}

DEBUG_INFO("Connected to Arduino IoT Cloud");
DEBUG_INFO("Thing ID: %s", getThingId().c_str());
execCloudEventCallback(ArduinoIoTCloudEvent::CONNECT);
Expand All @@ -595,11 +585,6 @@ void ArduinoIoTCloudTCP::detachThing()
return;
}

if (!_mqttClient.unsubscribe(_shadowTopicIn)) {
DEBUG_ERROR("ArduinoIoTCloudTCP::%s could not unsubscribe from %s", __FUNCTION__, _shadowTopicIn.c_str());
return;
}

DEBUG_INFO("Disconnected from Arduino IoT Cloud");
execCloudEventCallback(ArduinoIoTCloudEvent::DISCONNECT);
}
Expand Down
5 changes: 0 additions & 5 deletions src/ArduinoIoTCloudTCP.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass

String _deviceTopicOut;
String _deviceTopicIn;
String _shadowTopicOut;
String _shadowTopicIn;
String _messageTopicOut;
String _messageTopicIn;
String _dataTopicOut;
Expand All @@ -188,9 +186,6 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
inline String getTopic_deviceout() { return String("/a/d/" + getDeviceId() + "/e/o");}
inline String getTopic_devicein () { return String("/a/d/" + getDeviceId() + "/e/i");}

inline String getTopic_shadowout() { return ( getThingId().length() == 0) ? String("") : String("/a/t/" + getThingId() + "/shadow/o"); }
inline String getTopic_shadowin () { return ( getThingId().length() == 0) ? String("") : String("/a/t/" + getThingId() + "/shadow/i"); }

inline String getTopic_messageout() { return String("/a/d/" + getDeviceId() + "/c/up");}
inline String getTopic_messagein () { return String("/a/d/" + getDeviceId() + "/c/dw");}

Expand Down

0 comments on commit f00cfc9

Please sign in to comment.