From: Nathael Pajani Date: Sat, 16 Mar 2019 16:21:32 +0000 (+0100) Subject: Use struct mqtt_topic for topic names in mqtt_pub example app X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=a03eb05de28046ae08a3fe04bc1c8a820e6319f7;p=soft%2Flpc122x%2Fexamples Use struct mqtt_topic for topic names in mqtt_pub example app --- diff --git a/mqtt_pub/mqtt_comm.c b/mqtt_pub/mqtt_comm.c index 0a7be41..cb6c4af 100644 --- a/mqtt_pub/mqtt_comm.c +++ b/mqtt_pub/mqtt_comm.c @@ -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), };