Skip to content

Commit 2c8e67b

Browse files
authored
Removing stdin/stdout topic strings since we currently don't need those topics anymore (we might need them again once we reintegrate cloud serial but right now they just consume memory (#190)
1 parent 714df56 commit 2c8e67b

File tree

3 files changed

+1
-16
lines changed

3 files changed

+1
-16
lines changed

src/AIoTC_Config.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#endif
4444

4545
#ifndef DBG_VERBOSE
46-
#define DBG_VERBOSE(fmt, ...) //Debug.print(DBG_VERBOSE, fmt, ## __VA_ARGS__)
46+
#define DBG_VERBOSE(fmt, ...) Debug.print(DBG_VERBOSE, fmt, ## __VA_ARGS__)
4747
#endif
4848

4949
/******************************************************************************

src/ArduinoIoTCloudTCP.cpp

-10
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ ArduinoIoTCloudTCP::ArduinoIoTCloudTCP()
6565
, _password("")
6666
#endif
6767
, _mqttClient{nullptr}
68-
, _stdinTopic("")
69-
, _stdoutTopic("")
7068
, _shadowTopicOut("")
7169
, _shadowTopicIn("")
7270
, _dataTopicOut("")
@@ -132,8 +130,6 @@ int ArduinoIoTCloudTCP::begin(String brokerAddress, uint16_t brokerPort)
132130
_mqttClient.setConnectionTimeout(1500);
133131
_mqttClient.setId(getDeviceId().c_str());
134132

135-
_stdinTopic = getTopic_stdin();
136-
_stdoutTopic = getTopic_stdout();
137133
_shadowTopicOut = getTopic_shadowout();
138134
_shadowTopicIn = getTopic_shadowin();
139135
_dataTopicOut = getTopic_dataout();
@@ -220,12 +216,6 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectMqttBroker()
220216

221217
ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SubscribeMqttTopics()
222218
{
223-
if (!_mqttClient.subscribe(_stdinTopic))
224-
{
225-
DBG_ERROR("ArduinoIoTCloudTCP::%s could not subscribe to %s", __FUNCTION__, _stdinTopic.c_str());
226-
return State::SubscribeMqttTopics;
227-
}
228-
229219
if (!_mqttClient.subscribe(_dataTopicIn))
230220
{
231221
DBG_ERROR("ArduinoIoTCloudTCP::%s could not subscribe to %s", __FUNCTION__, _dataTopicIn.c_str());

src/ArduinoIoTCloudTCP.h

-5
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,6 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
108108

109109
MqttClient _mqttClient;
110110

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

126-
inline String getTopic_stdin () { return String("/a/d/" + getDeviceId() + "/s/i"); }
127-
inline String getTopic_stdout () { return String("/a/d/" + getDeviceId() + "/s/o"); }
128123
inline String getTopic_shadowout() { return ( getThingId().length() == 0) ? String("") : String("/a/t/" + getThingId() + "/shadow/o"); }
129124
inline String getTopic_shadowin () { return ( getThingId().length() == 0) ? String("") : String("/a/t/" + getThingId() + "/shadow/i"); }
130125
inline String getTopic_dataout () { return ( getThingId().length() == 0) ? String("/a/d/" + getDeviceId() + "/e/o") : String("/a/t/" + getThingId() + "/e/o"); }

0 commit comments

Comments
 (0)