Skip to content

Commit 08ed934

Browse files
committed
Merge branch 'feature/update_mqtt_component_examples_from_idf' into 'master'
Feature/update mqtt component examples from idf See merge request sdk/ESP8266_RTOS_SDK!1314
2 parents c11d8d6 + 6d784f8 commit 08ed934

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1086
-3005
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@
99
[submodule "components/lwip/lwip"]
1010
path = components/lwip/lwip
1111
url = ../../espressif/esp-lwip.git
12+
13+
[submodule "components/mqtt/esp-mqtt"]
14+
path = components/mqtt/esp-mqtt
15+
url = ../../espressif/esp-mqtt.git

components/mqtt/CMakeLists.txt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
set(COMPONENT_ADD_INCLUDEDIRS "esp-mqtt/include")
2-
set(COMPONENT_PRIV_INCLUDEDIRS "esp-mqtt/lib/include")
3-
set(COMPONENT_SRCS "esp-mqtt/mqtt_client.c"
4-
"esp-mqtt/lib/mqtt_msg.c"
5-
"esp-mqtt/lib/mqtt_outbox.c"
6-
"esp-mqtt/lib/platform_idf.c")
1+
idf_component_register(SRCS "esp-mqtt/mqtt_client.c"
2+
"esp-mqtt/lib/mqtt_msg.c"
3+
"esp-mqtt/lib/mqtt_outbox.c"
4+
"esp-mqtt/lib/platform_esp32_idf.c"
5+
INCLUDE_DIRS esp-mqtt/include
6+
PRIV_INCLUDE_DIRS "esp-mqtt/lib/include"
7+
REQUIRES lwip http_parser mbedtls tcp_transport)
78

8-
set(COMPONENT_REQUIRES lwip http_parser tcp_transport freertos lwip mbedtls openssl)
9-
10-
register_component()
9+
target_compile_definitions(${COMPONENT_LIB} PUBLIC -DMQTT_SUPPORTED_FEATURE_WS_SUBPROTOCOL -DMQTT_SUPPORTED_FEATURE_TRANSPORT_ERR_REPORTING)

components/mqtt/Kconfig

Lines changed: 108 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,111 @@
1-
menu "MQTT"
2-
3-
config MQTT_PROTOCOL_311
4-
bool "Enable MQTT protocol 3.1.1"
5-
default y
6-
help
7-
If not, this library will use MQTT protocol 3.1
8-
9-
config MQTT_TRANSPORT_SSL
10-
bool "Enable MQTT over SSL"
11-
default y
12-
help
13-
Enable MQTT transport over SSL with mbedtls
14-
15-
config MQTT_TRANSPORT_WEBSOCKET
16-
bool "Enable MQTT over Websocket"
17-
default y
18-
help
19-
Enable MQTT transport over Websocket.
20-
21-
config MQTT_TRANSPORT_WEBSOCKET_SECURE
22-
bool "Enable MQTT over Websocket Secure"
23-
default y
24-
depends on MQTT_TRANSPORT_WEBSOCKET
25-
depends on MQTT_TRANSPORT_SSL
26-
help
27-
Enable MQTT transport over Websocket Secure.
28-
29-
config MQTT_USE_CUSTOM_CONFIG
30-
bool "MQTT Using custom configurations"
31-
default n
32-
help
33-
Custom MQTT configurations.
34-
35-
config MQTT_TCP_DEFAULT_PORT
36-
int "Default MQTT over TCP port"
37-
default 1883
38-
depends on MQTT_USE_CUSTOM_CONFIG
39-
help
40-
Default MQTT over TCP port
41-
42-
config MQTT_SSL_DEFAULT_PORT
43-
int "Default MQTT over SSL port"
44-
default 8883
45-
depends on MQTT_USE_CUSTOM_CONFIG
46-
depends on MQTT_TRANSPORT_SSL
47-
help
48-
Default MQTT over SSL port
49-
50-
config MQTT_WS_DEFAULT_PORT
51-
int "Default MQTT over Websocket port"
52-
default 80
53-
depends on MQTT_USE_CUSTOM_CONFIG
54-
depends on MQTT_TRANSPORT_WEBSOCKET
55-
help
56-
Default MQTT over Websocket port
57-
58-
config MQTT_WSS_DEFAULT_PORT
59-
int "Default MQTT over Websocket Secure port"
60-
default 443
61-
depends on MQTT_USE_CUSTOM_CONFIG
62-
depends on MQTT_TRANSPORT_WEBSOCKET
63-
depends on MQTT_TRANSPORT_WEBSOCKET_SECURE
64-
help
65-
Default MQTT over Websocket Secure port
66-
67-
config MQTT_BUFFER_SIZE
68-
int "Default MQTT Buffer Size"
69-
default 1024
70-
depends on MQTT_USE_CUSTOM_CONFIG
71-
help
72-
This buffer size using for both transmit and receive
73-
74-
config MQTT_TASK_STACK_SIZE
75-
int "MQTT task stack size"
76-
default 6144
77-
depends on MQTT_USE_CUSTOM_CONFIG
78-
help
79-
MQTT task stack size
80-
81-
config MQTT_TASK_CORE_SELECTION_ENABLED
82-
bool "Enable MQTT task core selection"
83-
default false
84-
help
85-
This will enable core selection
86-
87-
choice MQTT_TASK_CORE_SELECTION
88-
depends on MQTT_TASK_CORE_SELECTION_ENABLED
89-
prompt "Core to use ?"
90-
config MQTT_USE_CORE_0
91-
bool "Core 0"
92-
config MQTT_USE_CORE_1
93-
bool "Core 1"
94-
endchoice
95-
96-
config MQTT_CUSTOM_OUTBOX
97-
bool "Enable custom outbox implementation"
98-
default n
99-
help
100-
Set to true if a specific implementation of message outbox is needed (e.g. persistant outbox in NVM or similar).
1+
menu "ESP-MQTT Configurations"
1012

3+
config MQTT_PROTOCOL_311
4+
bool "Enable MQTT protocol 3.1.1"
5+
default y
6+
help
7+
If not, this library will use MQTT protocol 3.1
8+
9+
config MQTT_TRANSPORT_SSL
10+
bool "Enable MQTT over SSL"
11+
default y
12+
help
13+
Enable MQTT transport over SSL with mbedtls
14+
15+
config MQTT_TRANSPORT_WEBSOCKET
16+
bool "Enable MQTT over Websocket"
17+
default y
18+
help
19+
Enable MQTT transport over Websocket.
20+
21+
config MQTT_TRANSPORT_WEBSOCKET_SECURE
22+
bool "Enable MQTT over Websocket Secure"
23+
default y
24+
depends on MQTT_TRANSPORT_WEBSOCKET
25+
depends on MQTT_TRANSPORT_SSL
26+
help
27+
Enable MQTT transport over Websocket Secure.
28+
29+
config MQTT_USE_CUSTOM_CONFIG
30+
bool "MQTT Using custom configurations"
31+
default n
32+
help
33+
Custom MQTT configurations.
34+
35+
config MQTT_TCP_DEFAULT_PORT
36+
int "Default MQTT over TCP port"
37+
default 1883
38+
depends on MQTT_USE_CUSTOM_CONFIG
39+
help
40+
Default MQTT over TCP port
41+
42+
config MQTT_SSL_DEFAULT_PORT
43+
int "Default MQTT over SSL port"
44+
default 8883
45+
depends on MQTT_USE_CUSTOM_CONFIG
46+
depends on MQTT_TRANSPORT_SSL
47+
help
48+
Default MQTT over SSL port
49+
50+
config MQTT_WS_DEFAULT_PORT
51+
int "Default MQTT over Websocket port"
52+
default 80
53+
depends on MQTT_USE_CUSTOM_CONFIG
54+
depends on MQTT_TRANSPORT_WEBSOCKET
55+
help
56+
Default MQTT over Websocket port
57+
58+
config MQTT_WSS_DEFAULT_PORT
59+
int "Default MQTT over Websocket Secure port"
60+
default 443
61+
depends on MQTT_USE_CUSTOM_CONFIG
62+
depends on MQTT_TRANSPORT_WEBSOCKET
63+
depends on MQTT_TRANSPORT_WEBSOCKET_SECURE
64+
help
65+
Default MQTT over Websocket Secure port
66+
67+
config MQTT_BUFFER_SIZE
68+
int "Default MQTT Buffer Size"
69+
default 1024
70+
depends on MQTT_USE_CUSTOM_CONFIG
71+
help
72+
This buffer size using for both transmit and receive
73+
74+
config MQTT_TASK_STACK_SIZE
75+
int "MQTT task stack size"
76+
default 6144
77+
depends on MQTT_USE_CUSTOM_CONFIG
78+
help
79+
MQTT task stack size
80+
81+
config MQTT_DISABLE_API_LOCKS
82+
bool "Disable API locks"
83+
default n
84+
depends on MQTT_USE_CUSTOM_CONFIG
85+
help
86+
Default config employs API locks to protect internal structures. It is possible to disable
87+
these locks if the user code doesn't access MQTT API from multiple concurrent tasks
88+
89+
config MQTT_TASK_CORE_SELECTION_ENABLED
90+
bool "Enable MQTT task core selection"
91+
default false
92+
help
93+
This will enable core selection
94+
95+
choice MQTT_TASK_CORE_SELECTION
96+
depends on MQTT_TASK_CORE_SELECTION_ENABLED
97+
prompt "Core to use ?"
98+
config MQTT_USE_CORE_0
99+
bool "Core 0"
100+
config MQTT_USE_CORE_1
101+
bool "Core 1"
102+
endchoice
103+
104+
config MQTT_CUSTOM_OUTBOX
105+
bool "Enable custom outbox implementation"
106+
default n
107+
help
108+
Set to true if a specific implementation of message outbox is needed (e.g. persistant outbox in NVM or
109+
similar).
102110

103111
endmenu

components/mqtt/component.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
COMPONENT_SUBMODULES += esp-mqtt
12
COMPONENT_ADD_INCLUDEDIRS := esp-mqtt/include
23
COMPONENT_SRCDIRS := esp-mqtt esp-mqtt/lib
34
COMPONENT_PRIV_INCLUDEDIRS := esp-mqtt/lib/include
5+
#Due to RTOS version is lower than idf 4.0, so move some define in file mqtt_supported_features.h to here.
6+
CFLAGS += -DMQTT_SUPPORTED_FEATURE_WS_SUBPROTOCOL -DMQTT_SUPPORTED_FEATURE_TRANSPORT_ERR_REPORTING

components/mqtt/esp-mqtt

Submodule esp-mqtt added at 566b034

components/mqtt/esp-mqtt/.editorconfig

Lines changed: 0 additions & 34 deletions
This file was deleted.

components/mqtt/esp-mqtt/.gitignore

Lines changed: 0 additions & 36 deletions
This file was deleted.

components/mqtt/esp-mqtt/.travis.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)