Skip to content

Commit

Permalink
Enqueued qos0 dispatch MQTT_EVENT_PUBLISHED
Browse files Browse the repository at this point in the history
  • Loading branch information
nebkat committed Jun 3, 2024
1 parent bed1207 commit ec7b69e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mqtt_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1520,6 +1520,13 @@ static esp_err_t mqtt_resend_queued(esp_mqtt_client_handle_t client, outbox_item
if (outbox_delete_item(client->outbox, item) != ESP_OK) {
ESP_LOGE(TAG, "Failed to remove queued qos0 message from the outbox");
}

client->event.data_len = client->event.total_data_len = client->mqtt_state.connection.outbound_message.length;
client->event.current_data_offset = 0;
client->event.msg_id = client->mqtt_state.pending_msg_id;
client->event.qos = client->mqtt_state.pending_publish_qos;
client->event.event_id = MQTT_EVENT_PUBLISHED;
esp_mqtt_dispatch_event(client);
} else if (client->mqtt_state.pending_publish_qos > 0) {
#ifdef MQTT_PROTOCOL_5
if (client->mqtt_state.connection.information.protocol_ver == MQTT_PROTOCOL_V_5) {
Expand Down

0 comments on commit ec7b69e

Please sign in to comment.