MQTT: Add runtime selection of mqtt protocol version

Add config option for selecting protocol version at runtime.

This also fixed MQTT protocol version 3.1 which wasnt working with the original implementation

Closes https://github.com/espressif/esp-idf/issues/4448
Closes IDFGH-2311
Closes IDF-1320
This commit is contained in:
Marius Vikhammer
2020-01-09 11:50:40 +08:00
parent 86fc8b7584
commit 7ac0a42831
5 changed files with 66 additions and 38 deletions

View File

@@ -1,6 +1,7 @@
#ifndef MQTT_MSG_H
#define MQTT_MSG_H
#include "mqtt_config.h"
#include "mqtt_client.h"
#ifdef __cplusplus
extern "C" {
#endif
@@ -84,6 +85,7 @@ typedef struct mqtt_connect_info {
int will_qos;
int will_retain;
int clean_session;
esp_mqtt_protocol_ver_t protocol_ver;
} mqtt_connect_info_t;