File tree Expand file tree Collapse file tree 2 files changed +7
-21
lines changed
Expand file tree Collapse file tree 2 files changed +7
-21
lines changed Original file line number Diff line number Diff line change 1313#include < mqtt_client.h>
1414
1515const char MQTT_PUB_TOPIC_FMT[] PROGMEM = " devices/%s/messages/events/" ;
16- const char MQTT_SUB_TOPIC_FMT[] PROGMEM = " devices/%s/messages/events/ " ;
16+ const char MQTT_SUB_TOPIC_FMT[] PROGMEM = " devices/%s/messages/devicebound/# " ;
1717
1818static char mqtt_sub_topic[128 ];
1919static char mqtt_pub_topic[128 ];
@@ -34,20 +34,15 @@ bool initTopics() {
3434 ECC608.readProvisionItem (AZURE_DEVICE_ID, device_id, &device_id_length);
3535
3636 if (status != ATCA_SUCCESS) {
37- Log.errorf (
38- F (" Could not retrieve device ID from the ECC, error code: %X\r\n " ),
39- status);
37+ Log.errorf (F (" Could not retrieve device ID from the ECC, error code: "
38+ " %X. Please provision the device with the provision "
39+ " example sketch.\r\n " ),
40+ status);
4041 return false ;
4142 }
4243
43- snprintf_P (mqtt_sub_topic,
44- sizeof (mqtt_sub_topic),
45- MQTT_SUB_TOPIC_FMT,
46- device_id);
47- snprintf_P (mqtt_pub_topic,
48- sizeof (mqtt_pub_topic),
49- MQTT_PUB_TOPIC_FMT,
50- device_id);
44+ sprintf_P (mqtt_sub_topic, MQTT_SUB_TOPIC_FMT, device_id);
45+ sprintf_P (mqtt_pub_topic, MQTT_PUB_TOPIC_FMT, device_id);
5146
5247 return true ;
5348}
Original file line number Diff line number Diff line change @@ -350,21 +350,12 @@ def example_test_data():
350350 {
351351 "expectation" : "\\ [INFO\\ ] Published message"
352352 },
353- {
354- "expectation" : "\\ [INFO\\ ] Got new message: \\ {\\ \" light\\ \" : 9, \\ \" temp\\ \" : 9\\ }"
355- },
356353 {
357354 "expectation" : "\\ [INFO\\ ] Published message"
358355 },
359- {
360- "expectation" : "\\ [INFO\\ ] Got new message: \\ {\\ \" light\\ \" : 9, \\ \" temp\\ \" : 9\\ }"
361- },
362356 {
363357 "expectation" : "\\ [INFO\\ ] Published message"
364358 },
365- {
366- "expectation" : "\\ [INFO\\ ] Got new message: \\ {\\ \" light\\ \" : 9, \\ \" temp\\ \" : 9\\ }"
367- },
368359 {
369360 "expectation" : "\\ [INFO\\ ] Closing MQTT connection"
370361 }
You can’t perform that action at this time.
0 commit comments