add qos and dup to MQTT_EVENT_DATA

This commit is contained in:
Bert Melis
2021-09-20 12:07:53 +02:00
committed by David Cermak
parent 89894bd0c6
commit e1d5a9402f
2 changed files with 4 additions and 0 deletions

View File

@ -153,6 +153,8 @@ typedef struct {
int session_present; /*!< MQTT session_present flag for connection event */
esp_mqtt_error_codes_t *error_handle; /*!< esp-mqtt error handle including esp-tls errors as well as internal mqtt errors */
bool retain; /*!< Retained flag of the message associated with this event */
int qos; /*!< qos of the messages associated with this event */
int dup; /*!< Dup flag of the message associated with this event */
} esp_mqtt_event_t;
typedef esp_mqtt_event_t *esp_mqtt_event_handle_t;

View File

@ -981,6 +981,8 @@ static esp_err_t deliver_publish(esp_mqtt_client_handle_t client)
// post data event
client->event.retain = mqtt_get_retain(msg_buf);
client->event.msg_id = mqtt_get_id(msg_buf, msg_data_len);
client->event.qos = mqtt_get_qos(msg_buf);
client->event.dup = mqtt_get_dup(msg_buff);
client->event.total_data_len = msg_data_len + msg_total_len - msg_read_len;
post_data_event: