Skip to content

Commit

Permalink
Adds debug information on sending dup messages
Browse files Browse the repository at this point in the history
- To support debug of resending dup messages QoS 1 and 2 a debug
  log was added.
  • Loading branch information
euripedesrocha committed Oct 3, 2022
1 parent a87fd9c commit 47b3f9b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mqtt_client.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "esp_log.h"
#include "mqtt_client_priv.h"

_Static_assert(sizeof(uint64_t) == sizeof(outbox_tick_t), "mqtt-client tick type size different from outbox tick type");
Expand Down Expand Up @@ -1424,6 +1425,7 @@ static esp_err_t mqtt_resend_queued(esp_mqtt_client_handle_t client, outbox_item
// set duplicate flag for QoS-1 and QoS-2 messages
if (client->mqtt_state.pending_msg_type == MQTT_MSG_TYPE_PUBLISH && client->mqtt_state.pending_publish_qos > 0 && (outbox_item_get_pending(item) == TRANSMITTED)) {
mqtt_set_dup(client->mqtt_state.outbound_message->data);
ESP_LOGD(TAG,"Sending Duplicated QoS%d message with id=%d", client->mqtt_state.pending_publish_qos, client->mqtt_state.pending_msg_id);
}

// try to resend the data
Expand Down

0 comments on commit 47b3f9b

Please sign in to comment.