From fe9c6fb44333311fda9582b7e1197e6ed674cbb4 Mon Sep 17 00:00:00 2001 From: alanlhc Date: Mon, 4 Oct 2021 11:28:53 +0800 Subject: [PATCH 1/8] Modify iotconnect_sdk_send_packet() to take in assigned msg id for this message send. --- iotconnect-sdk/src/iotconnect.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/iotconnect-sdk/src/iotconnect.c b/iotconnect-sdk/src/iotconnect.c index 3dfb88e..2f9fb72 100644 --- a/iotconnect-sdk/src/iotconnect.c +++ b/iotconnect-sdk/src/iotconnect.c @@ -193,7 +193,11 @@ static void on_iotconnect_status(IotconnectConnectionStatus status) { } } - +static void on_msg_send_status(uint32_t msg_id, IotconnectMsgSendStatus status) { + if (config.msg_send_status_cb) { + config.msg_send_status_cb(msg_id, status); + } +} /////////////////////////////////////////////////////////////////////////////////// // Get All twin property from C2D void iotconnect_sdk_disconnect() { @@ -202,8 +206,12 @@ void iotconnect_sdk_disconnect() { k_msleep(100); } -void iotconnect_sdk_send_packet(const char *data) { - if (0 != iotc_nrf_mqtt_publish(&client, sync_response->broker.pub_topic, MQTT_QOS_0_AT_MOST_ONCE, data, strlen(data))) { +// Send MQTT message. +// p_msg_id points to a 32-bit variable that store the assigned message id of the message +// being sent. +void iotconnect_sdk_send_packet(const char *data, uint32_t *p_msg_id) { + if (0 != iotc_nrf_mqtt_publish(&client, sync_response->broker.pub_topic, MQTT_QOS_1_AT_LEAST_ONCE, data, strlen(data), + p_msg_id)) { printk("\n\t Device_Attributes_Data Publish failure"); } } @@ -302,6 +310,7 @@ int iotconnect_sdk_init() { mqtt_config.tls_verify = CONFIG_PEER_VERIFY; mqtt_config.data_cb = iotc_on_mqtt_data; mqtt_config.status_cb = on_iotconnect_status; + mqtt_config.msg_send_status_cb = on_msg_send_status; if (!iotc_nrf_mqtt_init(&mqtt_config, sync_response)) { return -8; From a12d12f8c6bdb868f40d84e76e690b8cfee8eab3 Mon Sep 17 00:00:00 2001 From: alanlhc Date: Mon, 4 Oct 2021 11:34:29 +0800 Subject: [PATCH 2/8] - add IotconnectMsgSendStatus type define. - add IotConnectMsgSendStatusCallback() function type define. - add msg_send_status_cb function pointer to IotconnectClientConfig type define. - declare iotconnect_sdk_send_packet() to accept assigned msg id for the message send. --- iotconnect-sdk/include/iotconnect.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/iotconnect-sdk/include/iotconnect.h b/iotconnect-sdk/include/iotconnect.h index b007130..c0eff9b 100644 --- a/iotconnect-sdk/include/iotconnect.h +++ b/iotconnect-sdk/include/iotconnect.h @@ -26,6 +26,13 @@ typedef enum { // TODO: Sync statuses etc. } IotconnectConnectionStatus; +typedef enum { + MSG_SEND_SUCCESS, //Received PUBACK for the respective message. + MSG_SEND_TIMEOUT, //Message drop from queue due to maximum retry with PUBACK timeout. + MSG_SEND_FAILED, //Message drop from queue due to disconnection. +} IotconnectMsgSendStatus; + +typedef void (*IotConnectMsgSendStatusCallback)(uint32_t msg_id, IotconnectMsgSendStatus status); typedef void (*IotConnectStatusCallback)(IotconnectConnectionStatus data); @@ -37,6 +44,7 @@ typedef struct { IotclCommandCallback cmd_cb; // callback for command events. IotclMessageCallback msg_cb; // callback for ALL messages, including the specific ones like cmd or ota callback. IotConnectStatusCallback status_cb; // callback for connection status + IotConnectMsgSendStatusCallback msg_send_status_cb; // callback for MQTT message send status. } IotconnectClientConfig; @@ -48,7 +56,7 @@ bool iotconnect_sdk_is_connected(); IotclConfig *iotconnect_sdk_get_lib_config(); -void iotconnect_sdk_send_packet(const char *data); +void iotconnect_sdk_send_packet(const char *data, uint32_t *p_msg_id); void iotconnect_sdk_loop(); From c2f906f34b540571d21b7064313bb84623070dc6 Mon Sep 17 00:00:00 2001 From: alanlhc Date: Mon, 4 Oct 2021 11:41:09 +0800 Subject: [PATCH 3/8] - add msg_send_status_cb function pointer to IotconnectMqttConfig type define. - modify iotc_nrf_mqtt_publish() to accept assigned msg id for the message send. --- iotconnect-sdk/nrf-layer-lib/include/iotconnect_mqtt.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iotconnect-sdk/nrf-layer-lib/include/iotconnect_mqtt.h b/iotconnect-sdk/nrf-layer-lib/include/iotconnect_mqtt.h index 71f892c..1a0d2d3 100644 --- a/iotconnect-sdk/nrf-layer-lib/include/iotconnect_mqtt.h +++ b/iotconnect-sdk/nrf-layer-lib/include/iotconnect_mqtt.h @@ -23,6 +23,7 @@ typedef struct { const char *env; // Environment name. Contact your representative for details. Same as telemetry config. IotconnectMqttOnDataCallback data_cb; // callback for OTA events. IotConnectStatusCallback status_cb; // callback for command events. + IotConnectMsgSendStatusCallback msg_send_status_cb; // callback for message send status. } IotconnectMqttConfig; bool iotc_nrf_mqtt_init(IotconnectMqttConfig *config, IotclSyncResponse *sr); @@ -31,7 +32,8 @@ void iotc_nrf_mqtt_loop(); bool iotc_nrf_mqtt_is_connected(); -int iotc_nrf_mqtt_publish(struct mqtt_client *c, const char *topic, enum mqtt_qos qos, const uint8_t *data, size_t len); +int iotc_nrf_mqtt_publish(struct mqtt_client *c, const char *topic, enum mqtt_qos qos, const uint8_t *data, + size_t len, uint32_t *p_msg_id); void iotc_nrf_mqtt_abort(); From c65d5303134f3a4cbd1bd986dc016eaa5363ce39 Mon Sep 17 00:00:00 2001 From: alanlhc Date: Mon, 4 Oct 2021 11:50:53 +0800 Subject: [PATCH 4/8] - remove blocking codes in the iotc_nrf_mqtt_publish() to resolve deadlock issue. - add message queue to store and re-send messages using QOS 1. - perform checking of timeout and re-send messages in the mqtt_loop(). - modify iotc_nrf_mqtt_publish() to return assigned msg id for the message send. - add msg_send_status_cb function pointer to allow user callback when msg sent successfully or timeout. --- .../nrf-layer-lib/src/iotconnect_mqtt.c | 251 +++++++++++++----- 1 file changed, 185 insertions(+), 66 deletions(-) diff --git a/iotconnect-sdk/nrf-layer-lib/src/iotconnect_mqtt.c b/iotconnect-sdk/nrf-layer-lib/src/iotconnect_mqtt.c index c0096e1..c16698a 100644 --- a/iotconnect-sdk/nrf-layer-lib/src/iotconnect_mqtt.c +++ b/iotconnect-sdk/nrf-layer-lib/src/iotconnect_mqtt.c @@ -20,10 +20,21 @@ #include "nrf_cert_store.h" #define MQTT_PUBACK_TIMEOUT_S 5 //5 secs - -SYS_MUTEX_DEFINE(mutex_mqtt_pub); -static unsigned int pending_ack_msg_id = 0; -static bool msg_ack_pending = false; +#define MAXIMUM_MSG_QUEUE 4 +#define MAXIMUM_MSG_RESEND 1 +typedef struct { + bool in_used; + uint32_t msg_id; + const char *p_pub_topic; + uint8_t *p_msg; + uint32_t msg_len; + uint32_t start_tick; + uint8_t resend_count; +} msg_q_object_t; + +static msg_q_object_t msg_queue[MAXIMUM_MSG_QUEUE]; +SYS_MUTEX_DEFINE(mutex_msg_q); +static bool msg_queue_initialized = false; extern struct mqtt_client client; static IotconnectMqttConfig *config; @@ -52,6 +63,125 @@ static int fds_init(struct mqtt_client *c); static void mqtt_evt_handler(struct mqtt_client *const c, const struct mqtt_evt *evt); +static int nrf_mqtt_publish(struct mqtt_client *c, const char *topic, enum mqtt_qos qos, + const uint8_t *data, size_t len, uint32_t *p_msg_id); + +static void msg_queue_clear(bool invoke_cb) { + if (msg_queue_initialized) { + //mutex lock + sys_mutex_lock(&mutex_msg_q, K_FOREVER); + for (int i=0; imsg_send_status_cb) { + config->msg_send_status_cb(msg_id, MSG_SEND_FAILED); + } + } + } + //printk("msg queue cleared\n"); + //mutex unlock + sys_mutex_unlock(&mutex_msg_q); + } +} + +static void msg_queue_init(void) { + if (!msg_queue_initialized) { + for (int i=0; i= (MQTT_PUBACK_TIMEOUT_S * 1000)) { + //printk("ERR: Send message timeout! (msg id: %d)\n", msg_queue[i].msg_id); + if (msg_queue[i].resend_count) { + printk("Re-send message again. (msg id: %d)\n", msg_queue[i].msg_id); + uint32_t msg_id = msg_queue[i].msg_id; + int err = nrf_mqtt_publish(&client, msg_queue[i].p_pub_topic, MQTT_QOS_1_AT_LEAST_ONCE, + msg_queue[i].p_msg, msg_queue[i].msg_len, &msg_id); + if (err) { + printk("message resend failed! %d\n", err); + } + msg_queue[i].start_tick = k_uptime_get_32(); + msg_queue[i].resend_count--; + } + else { + //printk("Maximum re-send reached! Abort message! (msg id: %d)\n", msg_queue[i].msg_id); + uint32_t msg_id = msg_queue[i].msg_id; + msg_queue_delete(msg_id); + if (config->msg_send_status_cb) { + config->msg_send_status_cb(msg_id, MSG_SEND_TIMEOUT); + } + } + } + } + } + //mutex unlock + sys_mutex_unlock(&mutex_msg_q); + } +} static unsigned int get_next_message_id() { if (rolling_message_id + 1 >= UINT_MAX) { @@ -221,71 +351,55 @@ static bool client_init() { return true; } - -/**@brief Function to publish data on the configured topic - */ -int iotc_nrf_mqtt_publish(struct mqtt_client *c, const char *topic, enum mqtt_qos qos, - const uint8_t *data, size_t len) { +static int nrf_mqtt_publish(struct mqtt_client *c, const char *topic, enum mqtt_qos qos, + const uint8_t *data, size_t len, uint32_t *p_msg_id) { struct mqtt_publish_param param; - int retry_count = 2; int code; - //mutex lock - sys_mutex_lock(&mutex_mqtt_pub, K_FOREVER); - - do { - - param.message.topic.qos = qos; - param.message.topic.topic.utf8 = (uint8_t *) topic; - param.message.topic.topic.size = strlen(param.message.topic.topic.utf8); - param.message.payload.data = (uint8_t *) data; - param.message.payload.len = len; + param.message.topic.qos = qos; + param.message.topic.topic.utf8 = (uint8_t *) topic; + param.message.topic.topic.size = strlen(param.message.topic.topic.utf8); + param.message.payload.data = (uint8_t *) data; + param.message.payload.len = len; + // if p_msg_id contains non-zero value, the message is re-send from msg_queue_proc(). + // Assign this message with assigned messsage id in p_msg_id. + // else assign current running message id to this message. + if (p_msg_id && *p_msg_id) { + param.message_id = *p_msg_id; + } + else { param.message_id = get_next_message_id(); - param.dup_flag = 0; - param.retain_flag = 0; - - code = mqtt_publish(c, ¶m); - if (code != 0) { - goto publish_done; - } - - if (param.message.topic.qos == MQTT_QOS_1_AT_LEAST_ONCE) { - - pending_ack_msg_id = param.message_id; - msg_ack_pending = true; - - uint32_t start_ticks = k_uptime_get_32(); - - do { - - iotc_nrf_mqtt_loop(); - k_msleep(1); - - } while (msg_ack_pending && - (k_uptime_get_32() - start_ticks) < (MQTT_PUBACK_TIMEOUT_S * 1000)); - - if (!msg_ack_pending) { - code = 0; - break; - } - - if (retry_count > 0) { - retry_count--; - if (retry_count == 0) { - msg_ack_pending = false; - code = -ETIMEDOUT; - } - } + } + param.dup_flag = 0; + param.retain_flag = 0; + + code = mqtt_publish(c, ¶m); + + // Only add the message to msg queue when: + // mqtt_publish() is successful. + // p_msg_id is NULL or contains zero. (not re-send from msg_queue_proc()) + // QOS is 1. + if (!code && !(p_msg_id && *p_msg_id) && (qos == MQTT_QOS_1_AT_LEAST_ONCE)) { + msg_queue_add(param.message_id, topic, (uint8_t *)data, len); + // Return back the assigned message id if p_msg_id is not NULL. + if (p_msg_id) { + *p_msg_id = param.message_id; } + } - } while ((param.message.topic.qos == MQTT_QOS_1_AT_LEAST_ONCE) && (retry_count > 0)); - -publish_done: + return code; +} - //mutex unlock - sys_mutex_unlock(&mutex_mqtt_pub); +/**@brief Function to publish data on the configured topic + */ +int iotc_nrf_mqtt_publish(struct mqtt_client *c, const char *topic, enum mqtt_qos qos, + const uint8_t *data, size_t len, uint32_t *p_msg_id) { - return code; + if (p_msg_id ) { + //New message. Force p_msg_id to zero. + *p_msg_id = 0; + } + return nrf_mqtt_publish(c, topic, qos, data, len, p_msg_id); } static void mqtt_evt_handler(struct mqtt_client *const c, @@ -317,6 +431,7 @@ static void mqtt_evt_handler(struct mqtt_client *const c, if (config->status_cb) { config->status_cb(MQTT_DISCONNECTED); } + msg_queue_clear(true); break; case MQTT_EVT_PUBLISH: { @@ -351,11 +466,9 @@ static void mqtt_evt_handler(struct mqtt_client *const c, } printk("Packet id: %u acknowledged\n", evt->param.puback.message_id); - - if (msg_ack_pending) { - if (pending_ack_msg_id == evt->param.puback.message_id) { - msg_ack_pending = false; - } + msg_queue_delete(evt->param.puback.message_id); + if (config->msg_send_status_cb) { + config->msg_send_status_cb(evt->param.puback.message_id, MSG_SEND_SUCCESS); } break; @@ -429,6 +542,9 @@ bool iotc_nrf_mqtt_init(IotconnectMqttConfig *c, IotclSyncResponse *sr) { return false; } + //init msg queue + msg_queue_init(); + fds.fd = -1; sync_response = sr; config = c; @@ -458,6 +574,9 @@ bool iotc_nrf_mqtt_init(IotconnectMqttConfig *c, IotclSyncResponse *sr) { void iotc_nrf_mqtt_loop(void) { int err; + // process msg queue procedure + msg_queue_proc(); + //if no FD return. if (fds.fd == -1) { return; From 108cd48b19cb6e5a2a16f514593f89491180ed79 Mon Sep 17 00:00:00 2001 From: alanlhc Date: Mon, 4 Oct 2021 11:55:24 +0800 Subject: [PATCH 5/8] - add message send status callback to receive message send status. - add code to wait for PUBACK for the last telemetry message sent before sending the next one. --- samples/iotc-basic/src/main.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/samples/iotc-basic/src/main.c b/samples/iotc-basic/src/main.c index fd4ed6f..aaa6999 100644 --- a/samples/iotc-basic/src/main.c +++ b/samples/iotc-basic/src/main.c @@ -61,6 +61,8 @@ static bool lte_link_up = false; static bool connecting_to_iotconnect = false; static bool time_updated = false; +static uint32_t ack_pending_msg_id = 0; + #if !defined(CONFIG_NRF_MODEM_LIB_SYS_INIT) /* Initialize AT communications */ @@ -184,7 +186,7 @@ static void on_ota(IotclEventData data) { const char *ack = iotcl_create_ack_string_and_destroy_event(data, success, message); if (NULL != ack) { printk("Sent OTA ack: %s\n", ack); - iotconnect_sdk_send_packet(ack); + iotconnect_sdk_send_packet(ack, NULL); free((void *) ack); } } @@ -198,7 +200,7 @@ static void on_command(IotclEventData data) { const char *ack = iotcl_create_ack_string_and_destroy_event(data, false, "Not implemented"); if (NULL != ack) { printk("Sent CMD ack: %s\n", ack); - iotconnect_sdk_send_packet(ack); + iotconnect_sdk_send_packet(ack, NULL); free((void *) ack); } else { printk("Error while creating the ack JSON"); @@ -222,15 +224,35 @@ static void on_connection_status(IotconnectConnectionStatus status) { case MQTT_DISCONNECTED: printk("IoTConnect MQTT Disconnected\n"); ui_led_set_rgb(LED_MAX, 0, 0); + ack_pending_msg_id = 0; break; case MQTT_FAILED: default: printk("IoTConnect MQTT ERROR\n"); ui_led_set_rgb(0, LED_MAX, 0); + connecting_to_iotconnect = false; break; } } +static void on_msg_send_status(uint32_t msg_id, IotconnectMsgSendStatus status) { + switch(status) { + case MSG_SEND_SUCCESS: + printk("Message sent. (msg id: %d)\n", msg_id); + break; + case MSG_SEND_TIMEOUT: + printk("Message send timeout! (msg id: %d)\n", msg_id); + break; + case MSG_SEND_FAILED: + printk("Message send failed! (msg id: %d)\n", msg_id); + break; + } + // clear ack_pending_msg_id if msg id matched. + if (ack_pending_msg_id && (ack_pending_msg_id == msg_id)) { + ack_pending_msg_id = 0; + } +} + static void publish_telemetry() { IotclMessageHandle msg = iotcl_telemetry_create(iotconnect_sdk_get_lib_config()); @@ -246,7 +268,7 @@ static void publish_telemetry() { const char *str = iotcl_create_serialized_string(msg, false); iotcl_telemetry_destroy(msg); printk("Sending: %s\n", str); - iotconnect_sdk_send_packet(str); + iotconnect_sdk_send_packet(str, &ack_pending_msg_id); iotcl_destroy_serialized(str); } @@ -515,7 +537,7 @@ static int sdk_run() { now = time(NULL); if (iotconnect_sdk_is_connected() && now - last_send_time >= CONFIG_TELEMETRY_SEND_INTERVAL_SECS) { last_send_time = now; - if (!fota_in_progress) { + if (!fota_in_progress && !ack_pending_msg_id) { publish_telemetry(); } @@ -663,6 +685,7 @@ void main(void) { config->cmd_cb = on_command; config->ota_cb = on_ota; config->status_cb = on_connection_status; + config->msg_send_status_cb = on_msg_send_status; #pragma clang diagnostic push #pragma ide diagnostic ignored "EndlessLoop" From 16c8e206ad126a834b9e4eb7eb248ebb20c992cd Mon Sep 17 00:00:00 2001 From: alanlhc Date: Mon, 4 Oct 2021 11:55:44 +0800 Subject: [PATCH 6/8] - add message send status callback to receive message send status. - add code to wait for PUBACK for the last telemetry message sent before sending the next one. --- samples/iotc-sensors-gps/src/main.c | 30 ++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/samples/iotc-sensors-gps/src/main.c b/samples/iotc-sensors-gps/src/main.c index eab5d2c..45954e9 100644 --- a/samples/iotc-sensors-gps/src/main.c +++ b/samples/iotc-sensors-gps/src/main.c @@ -81,6 +81,8 @@ static bool time_updated = false; static float gps_lat = INVALID_LAT_LON; static float gps_lng = INVALID_LAT_LON; +static uint32_t ack_pending_msg_id = 0; + static int setup_modem_gps(void); @@ -207,7 +209,7 @@ static void on_ota(IotclEventData data) { const char *ack = iotcl_create_ack_string_and_destroy_event(data, success, message); if (NULL != ack) { printk("Sent OTA ack: %s\n", ack); - iotconnect_sdk_send_packet(ack); + iotconnect_sdk_send_packet(ack, NULL); free((void *) ack); } } @@ -240,15 +242,34 @@ static void on_connection_status(IotconnectConnectionStatus status) { case MQTT_DISCONNECTED: printk("IoTConnect MQTT Disconnected\n"); ui_led_set_rgb(LED_MAX, 0, 0); + ack_pending_msg_id = 0; break; case MQTT_FAILED: default: printk("IoTConnect MQTT ERROR\n"); ui_led_set_rgb(0, LED_MAX, 0); + connecting_to_iotconnect = false; break; } } +static void on_msg_send_status(uint32_t msg_id, IotconnectMsgSendStatus status) { + switch(status) { + case MSG_SEND_SUCCESS: + printk("Message sent. (msg id: %d)\n", msg_id); + break; + case MSG_SEND_TIMEOUT: + printk("Message send timeout! (msg id: %d)\n", msg_id); + break; + case MSG_SEND_FAILED: + printk("Message send failed! (msg id: %d)\n", msg_id); + break; + } + if (ack_pending_msg_id && (ack_pending_msg_id == msg_id)) { + ack_pending_msg_id = 0; + } +} + static void publish_telemetry() { IotclMessageHandle msg = iotcl_telemetry_create(iotconnect_sdk_get_lib_config()); @@ -312,7 +333,7 @@ static void publish_telemetry() { const char *str = iotcl_create_serialized_string(msg, false); iotcl_telemetry_destroy(msg); printk("Sending: %s\n", str); - iotconnect_sdk_send_packet(str); + iotconnect_sdk_send_packet(str, &ack_pending_msg_id); iotcl_destroy_serialized(str); } @@ -580,6 +601,8 @@ static int sdk_run() { connecting_to_iotconnect = false; time_updated = false; + ack_pending_msg_id = 0; + err = lte_lc_connect_async(nrf_lte_evt_cb); if (err) { printk("Failed to connect to the LTE network, err %d\n", err); @@ -609,7 +632,7 @@ static int sdk_run() { now = time(NULL); if (iotconnect_sdk_is_connected() && now - last_send_time >= CONFIG_TELEMETRY_SEND_INTERVAL_SECS) { last_send_time = now; - if (!fota_in_progress) { + if (!fota_in_progress && !ack_pending_msg_id) { publish_telemetry(); } @@ -917,6 +940,7 @@ void main(void) { config->cmd_cb = on_command; config->ota_cb = on_ota; config->status_cb = on_connection_status; + config->msg_send_status_cb = on_msg_send_status; #pragma clang diagnostic push #pragma ide diagnostic ignored "EndlessLoop" From e3d6f69a7aff3935c921e264fefb54f208654b17 Mon Sep 17 00:00:00 2001 From: alanlhc Date: Mon, 4 Oct 2021 11:57:29 +0800 Subject: [PATCH 7/8] - modify iotconnect_sdk_send_packet() to set 2nd parameter as NULL to ignore the returned msg id for ACK msg. --- samples/iotc-sensors-gps/src/command_handling.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/iotc-sensors-gps/src/command_handling.c b/samples/iotc-sensors-gps/src/command_handling.c index 0bdeb69..c9e7da1 100644 --- a/samples/iotc-sensors-gps/src/command_handling.c +++ b/samples/iotc-sensors-gps/src/command_handling.c @@ -17,7 +17,7 @@ void command_status(IotclEventData data, bool status, const char *command_name, const char *ack = iotcl_create_ack_string_and_destroy_event(data, status, message); printk("command: %s status=%s: %s\n", command_name, status ? "OK" : "Failed", message); printk("Sent CMD ack: %s\n", ack); - iotconnect_sdk_send_packet(ack); + iotconnect_sdk_send_packet(ack, NULL); free((void *) ack); } From dbb544b8e9af81a747ded94358dc171869a77d84 Mon Sep 17 00:00:00 2001 From: alanlhc Date: Mon, 4 Oct 2021 14:38:33 +0800 Subject: [PATCH 8/8] - change tab to space. --- iotconnect-sdk/src/iotconnect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iotconnect-sdk/src/iotconnect.c b/iotconnect-sdk/src/iotconnect.c index 2f9fb72..07dca65 100644 --- a/iotconnect-sdk/src/iotconnect.c +++ b/iotconnect-sdk/src/iotconnect.c @@ -211,7 +211,7 @@ void iotconnect_sdk_disconnect() { // being sent. void iotconnect_sdk_send_packet(const char *data, uint32_t *p_msg_id) { if (0 != iotc_nrf_mqtt_publish(&client, sync_response->broker.pub_topic, MQTT_QOS_1_AT_LEAST_ONCE, data, strlen(data), - p_msg_id)) { + ....p_msg_id)) { printk("\n\t Device_Attributes_Data Publish failure"); } }