From 0b98c6324701e145988db5429d7711cfb232a457 Mon Sep 17 00:00:00 2001 From: yuanjm Date: Thu, 3 Mar 2022 15:40:03 +0800 Subject: [PATCH] mqtt: Add mqtt5 Kconfig --- components/mqtt/CMakeLists.txt | 11 +++++++---- components/mqtt/Kconfig | 6 ++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/components/mqtt/CMakeLists.txt b/components/mqtt/CMakeLists.txt index 629aca8..fda5220 100644 --- a/components/mqtt/CMakeLists.txt +++ b/components/mqtt/CMakeLists.txt @@ -1,7 +1,10 @@ -idf_component_register(SRCS "esp-mqtt/mqtt_client.c" - "esp-mqtt/lib/mqtt_msg.c" - "esp-mqtt/lib/mqtt_outbox.c" - "esp-mqtt/lib/platform_esp32_idf.c" +set(srcs esp-mqtt/mqtt_client.c esp-mqtt/lib/mqtt_msg.c esp-mqtt/lib/mqtt_outbox.c esp-mqtt/lib/platform_esp32_idf.c) + +if(CONFIG_MQTT_PROTOCOL_5) + list(APPEND srcs esp-mqtt/lib/mqtt5_msg.c esp-mqtt/mqtt5_client.c) +endif() + +idf_component_register(SRCS "${srcs}" INCLUDE_DIRS esp-mqtt/include PRIV_INCLUDE_DIRS "esp-mqtt/lib/include" PRIV_REQUIRES esp_timer diff --git a/components/mqtt/Kconfig b/components/mqtt/Kconfig index 06f06a1..4db6e15 100644 --- a/components/mqtt/Kconfig +++ b/components/mqtt/Kconfig @@ -6,6 +6,12 @@ menu "ESP-MQTT Configurations" help If not, this library will use MQTT protocol 3.1 + config MQTT_PROTOCOL_5 + bool "Enable MQTT protocol 5.0" + default n + help + If not, this library will not support MQTT 5.0 + config MQTT_TRANSPORT_SSL bool "Enable MQTT over SSL" default y