Skip to content

Commit 94db611

Browse files
committed
MCU8MASS-2364 Update test sketch for Azure
1 parent d7a502c commit 94db611

File tree

2 files changed

+7
-21
lines changed

2 files changed

+7
-21
lines changed

examples/mqtt_azure/mqtt_azure.ino

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <mqtt_client.h>
1414

1515
const 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

1818
static char mqtt_sub_topic[128];
1919
static 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
}

test/test_examples.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)