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 17, 2024
1 parent cac1552 commit 1cc5813
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mqtt_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1517,7 +1517,6 @@ static esp_err_t mqtt_resend_queued(esp_mqtt_client_handle_t client, outbox_item
esp_mqtt_abort_connection(client);
return ESP_FAIL;
}

return ESP_OK;
}

Expand Down Expand Up @@ -1670,6 +1669,13 @@ static void esp_mqtt_task(void *pv)
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);
}
if (client->mqtt_state.pending_publish_qos > 0) {
outbox_set_pending(client->outbox, client->mqtt_state.pending_msg_id, TRANSMITTED);
Expand Down

0 comments on commit 1cc5813

Please sign in to comment.