Use struct mqtt_topic for topic names in mqtt_pub example app
authorNathael Pajani <nathael.pajani@ed3l.fr>
Sat, 16 Mar 2019 16:21:32 +0000 (17:21 +0100)
committerNathael Pajani <nathael.pajani@ed3l.fr>
Tue, 8 Nov 2022 16:14:23 +0000 (17:14 +0100)
mqtt_pub/mqtt_comm.c

index 0a7be41..cb6c4af 100644 (file)
@@ -45,11 +45,10 @@ const struct mqtt_connect_pkt mqtt_conn = {
        .keep_alive_seconds = 600,
        .clean_session_flag = MQTT_SESSION_RESUME,
        .client_id = "test",
-       .will_topic = "will/temp/test",
+       .will_topic = { .name = "will/temp/test", .QoS = MQTT_QoS_0 },
+       .will_retain = 1,
        .will_msg_size = 4,
        .will_msg = (uint8_t*)"Bye",
-       .will_QoS = 0,
-       .will_retain = 1,
        .username = "test",
        .password = "pass",
 };
@@ -108,8 +107,7 @@ int mqtt_init(int comm_uart, int dbg_uart)
 
 
 struct mqtt_publish_pkt pub_pkt = {
-       .topic = "temp/test",
-       .QoS = 1,
+       .topic = { .name = "temp/test", .QoS = 1, },
        .retain_flag = 1,
        .message_size = sizeof(int),
 };