Skip to content

Commit e726133

Browse files
Mattia Bertorellomattiabertorello
Mattia Bertorello
authored andcommitted
Restore origin topic format for the "cloud serial" /ORG_ID/d/DEVICE_ID/*
Because the cloud serial is a part of the device so is not semantically correct send data to the thing topic
1 parent e81a21e commit e726133

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/ArduinoIoTCloud.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,13 @@ int ArduinoIoTCloudClass::begin(Client& net, String brokerAddress)
7171
void ArduinoIoTCloudClass::mqttClientBegin(Client& net)
7272
{
7373
// MQTT topics definition
74+
_stdoutTopic = "/a/d/" + _id + "/s/o";
75+
_stdinTopic = "/a/d/" + _id + "/s/i";
7476
if(_thing_id == "") {
75-
_stdoutTopic = "/a/d/" + _id + "/s/o";
76-
_stdinTopic = "/a/d/" + _id + "/s/i";
7777
_dataTopicIn = "/a/d/" + _id + "/e/i";
7878
_dataTopicOut = "/a/d/" + _id + "/e/o";
7979
}
8080
else {
81-
_stdoutTopic = "/a/t/" + _thing_id + "/s/o";
82-
_stdinTopic = "/a/t/" + _thing_id + "/s/i";
8381
_dataTopicIn = "/a/t/" + _thing_id + "/e/i";
8482
_dataTopicOut = "/a/t/" + _thing_id + "/e/o";
8583
}

0 commit comments

Comments
 (0)