Skip to content

Commit c7ce0d1

Browse files
committed
Use device id for defining all topic names if no thing id is set.
This is a first step into removing thing-id dependency from all cloud sketches.
1 parent 516ad1b commit c7ce0d1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ArduinoIoTCloudTCP.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
132132
bool _ota_req;
133133
#endif /* OTA_ENABLED */
134134

135-
inline String getTopic_shadowout() { return ( getThingId().length() == 0) ? String("") : String("/a/t/" + getThingId() + "/shadow/o"); }
136-
inline String getTopic_shadowin () { return ( getThingId().length() == 0) ? String("") : String("/a/t/" + getThingId() + "/shadow/i"); }
137-
inline String getTopic_dataout () { return ( getThingId().length() == 0) ? String("/a/d/" + getDeviceId() + "/e/o") : String("/a/t/" + getThingId() + "/e/o"); }
138-
inline String getTopic_datain () { return ( getThingId().length() == 0) ? String("/a/d/" + getDeviceId() + "/e/i") : String("/a/t/" + getThingId() + "/e/i"); }
135+
inline String getTopic_shadowout() { return ( getThingId().length() == 0) ? String("/a/d/" + getDeviceId() + "/shadow/o") : String("/a/t/" + getThingId() + "/shadow/o"); }
136+
inline String getTopic_shadowin () { return ( getThingId().length() == 0) ? String("/a/d/" + getDeviceId() + "/shadow/i") : String("/a/t/" + getThingId() + "/shadow/i"); }
137+
inline String getTopic_dataout () { return ( getThingId().length() == 0) ? String("/a/d/" + getDeviceId() + "/e/o") : String("/a/t/" + getThingId() + "/e/o"); }
138+
inline String getTopic_datain () { return ( getThingId().length() == 0) ? String("/a/d/" + getDeviceId() + "/e/i") : String("/a/t/" + getThingId() + "/e/i"); }
139139

140140
State handle_ConnectPhy();
141141
State handle_SyncTime();

0 commit comments

Comments
 (0)