Skip to content

Removing stdin/stdout topic strings ... #190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/AIoTC_Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#endif

#ifndef DBG_VERBOSE
#define DBG_VERBOSE(fmt, ...) //Debug.print(DBG_VERBOSE, fmt, ## __VA_ARGS__)
#define DBG_VERBOSE(fmt, ...) Debug.print(DBG_VERBOSE, fmt, ## __VA_ARGS__)
#endif

/******************************************************************************
Expand Down
10 changes: 0 additions & 10 deletions src/ArduinoIoTCloudTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ ArduinoIoTCloudTCP::ArduinoIoTCloudTCP()
, _password("")
#endif
, _mqttClient{nullptr}
, _stdinTopic("")
, _stdoutTopic("")
, _shadowTopicOut("")
, _shadowTopicIn("")
, _dataTopicOut("")
Expand Down Expand Up @@ -132,8 +130,6 @@ int ArduinoIoTCloudTCP::begin(String brokerAddress, uint16_t brokerPort)
_mqttClient.setConnectionTimeout(1500);
_mqttClient.setId(getDeviceId().c_str());

_stdinTopic = getTopic_stdin();
_stdoutTopic = getTopic_stdout();
_shadowTopicOut = getTopic_shadowout();
_shadowTopicIn = getTopic_shadowin();
_dataTopicOut = getTopic_dataout();
Expand Down Expand Up @@ -220,12 +216,6 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectMqttBroker()

ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SubscribeMqttTopics()
{
if (!_mqttClient.subscribe(_stdinTopic))
{
DBG_ERROR("ArduinoIoTCloudTCP::%s could not subscribe to %s", __FUNCTION__, _stdinTopic.c_str());
return State::SubscribeMqttTopics;
}

if (!_mqttClient.subscribe(_dataTopicIn))
{
DBG_ERROR("ArduinoIoTCloudTCP::%s could not subscribe to %s", __FUNCTION__, _dataTopicIn.c_str());
Expand Down
5 changes: 0 additions & 5 deletions src/ArduinoIoTCloudTCP.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass

MqttClient _mqttClient;

// Class attribute to define MTTQ topics 2 for stdIn/out and 2 for data, in order to avoid getting previous pupblished payload
String _stdinTopic;
String _stdoutTopic;
String _shadowTopicOut;
String _shadowTopicIn;
String _dataTopicOut;
Expand All @@ -123,8 +120,6 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
bool _ota_req;
#endif /* OTA_ENABLED */

inline String getTopic_stdin () { return String("/a/d/" + getDeviceId() + "/s/i"); }
inline String getTopic_stdout () { return String("/a/d/" + getDeviceId() + "/s/o"); }
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_dataout () { return ( getThingId().length() == 0) ? String("/a/d/" + getDeviceId() + "/e/o") : String("/a/t/" + getThingId() + "/e/o"); }
Expand Down