Skip to content

Commit ac10b42

Browse files
committed
Merge branch 'feature/update_coap_from_idf' into 'master'
Feature/update coap from idf See merge request sdk/ESP8266_RTOS_SDK!1318
2 parents 894647e + 684ea0a commit ac10b42

File tree

126 files changed

+1860
-25213
lines changed

Some content is hidden

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

126 files changed

+1860
-25213
lines changed

.gitmodules

+4
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@
1313
[submodule "components/mqtt/esp-mqtt"]
1414
path = components/mqtt/esp-mqtt
1515
url = ../../espressif/esp-mqtt.git
16+
17+
[submodule "components/coap/libcoap"]
18+
path = components/coap/libcoap
19+
url = ../../espressif/libcoap

components/coap/CMakeLists.txt

+35-37
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,41 @@
1-
set(COMPONENT_ADD_INCLUDEDIRS port/include port/include/coap libcoap/include libcoap/include/coap)
1+
if(CONFIG_ENABLE_COAP)
2+
set(include_dirs port/include port/include/coap libcoap/include libcoap/include/coap2)
23

3-
set(COMPONENT_SRCS
4-
libcoap/src/address.c
5-
libcoap/src/async.c
6-
libcoap/src/block.c
7-
libcoap/src/coap_time.c
8-
libcoap/src/debug.c
9-
libcoap/src/encode.c
10-
libcoap/src/hashkey.c
11-
libcoap/src/mem.c
12-
libcoap/src/net.c
13-
libcoap/src/option.c
14-
libcoap/src/pdu.c
15-
libcoap/src/resource.c
16-
libcoap/src/str.c
17-
libcoap/src/subscribe.c
18-
libcoap/src/uri.c
19-
port/coap_io_socket.c
20-
)
4+
set(srcs
5+
"libcoap/src/address.c"
6+
"libcoap/src/async.c"
7+
"libcoap/src/block.c"
8+
"libcoap/src/coap_event.c"
9+
"libcoap/src/coap_hashkey.c"
10+
"libcoap/src/coap_session.c"
11+
"libcoap/src/coap_time.c"
12+
"libcoap/src/coap_debug.c"
13+
"libcoap/src/encode.c"
14+
"libcoap/src/mem.c"
15+
"libcoap/src/net.c"
16+
"libcoap/src/option.c"
17+
"libcoap/src/pdu.c"
18+
"libcoap/src/resource.c"
19+
"libcoap/src/str.c"
20+
"libcoap/src/subscribe.c"
21+
"libcoap/src/uri.c"
22+
"libcoap/src/coap_notls.c"
23+
"port/coap_io.c")
2124

22-
set(COMPONENT_REQUIRES lwip)
25+
set(COMPONENT_REQUIRES lwip)
2326

24-
register_component()
27+
idf_component_register(SRCS "${srcs}"
28+
INCLUDE_DIRS "${include_dirs}"
29+
REQUIRES lwip)
2530

26-
# Needed for coap headers in public builds, also.
27-
#
28-
# TODO: find a way to move this to a port header
29-
target_compile_definitions(${COMPONENT_LIB} PUBLIC WITH_POSIX)
31+
# Silence format truncation warning, until it is fixed upstream
32+
set_source_files_properties(libcoap/src/coap_debug.c PROPERTIES COMPILE_FLAGS -Wno-format-truncation)
3033

31-
set_source_files_properties(
32-
libcoap/src/debug.c
33-
libcoap/src/pdu.c
34-
PROPERTIES COMPILE_FLAGS
35-
-Wno-write-strings)
34+
# Needed for coap headers in public builds, also.
35+
#
36+
# TODO: find a way to move this to a port header
37+
target_compile_definitions(${COMPONENT_LIB} PUBLIC WITH_POSIX)
38+
else()
39+
register_component()
40+
endif()
3641

37-
# Temporary suppress "fallthrough" warnings until they are fixed in libcoap repo
38-
set_source_files_properties(
39-
libcoap/src/option.c
40-
PROPERTIES COMPILE_FLAGS
41-
-Wno-implicit-fallthrough)
42-
43-
target_compile_definitions(${COMPONENT_LIB} PUBLIC -D WITH_POSIX)

components/coap/Kconfig

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
menu "COAP"
2+
3+
config ENABLE_COAP
4+
bool "Enable coap"
5+
default n
6+
select LWIP_IPV6
7+
help
8+
Enable this option and coap is to be used, IPv6 is to be Enable.
9+
endmenu
10+

components/coap/Makefile.projbuild

-1
This file was deleted.

components/coap/component.mk

+8-6
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
# Component Makefile
33
#
44

5-
COMPONENT_ADD_INCLUDEDIRS := port/include port/include/coap libcoap/include libcoap/include/coap
5+
ifdef CONFIG_ENABLE_COAP
6+
COMPONENT_ADD_INCLUDEDIRS := port/include port/include/coap libcoap/include libcoap/include/coap2
67

7-
COMPONENT_OBJS = libcoap/src/address.o libcoap/src/async.o libcoap/src/block.o libcoap/src/coap_time.o libcoap/src/debug.o libcoap/src/encode.o libcoap/src/hashkey.o libcoap/src/mem.o libcoap/src/net.o libcoap/src/option.o libcoap/src/pdu.o libcoap/src/resource.o libcoap/src/str.o libcoap/src/subscribe.o libcoap/src/uri.o port/coap_io_socket.o
8+
COMPONENT_OBJS = libcoap/src/address.o libcoap/src/async.o libcoap/src/block.o libcoap/src/coap_event.o libcoap/src/coap_hashkey.o libcoap/src/coap_session.o libcoap/src/coap_time.o libcoap/src/coap_debug.o libcoap/src/encode.o libcoap/src/mem.o libcoap/src/net.o libcoap/src/option.o libcoap/src/pdu.o libcoap/src/resource.o libcoap/src/str.o libcoap/src/subscribe.o libcoap/src/uri.o libcoap/src/coap_notls.o port/coap_io.o
89

910
COMPONENT_SRCDIRS := libcoap/src libcoap port
1011

11-
libcoap/src/debug.o: CFLAGS += -Wno-write-strings
12-
libcoap/src/pdu.o: CFLAGS += -Wno-write-strings
13-
# Temporary suppress "fallthrough" warnings until they are fixed in libcoap repo
14-
libcoap/src/option.o: CFLAGS += -Wno-implicit-fallthrough
12+
COMPONENT_SUBMODULES += libcoap
13+
14+
# Silence format truncation warning, until it is fixed upstream
15+
libcoap/src/coap_debug.o: CFLAGS += -Wno-format-truncation
16+
endif

components/coap/libcoap

Submodule libcoap added at cfec0d0

components/coap/libcoap/.gitignore

-64
This file was deleted.

components/coap/libcoap/.travis.yml

-34
This file was deleted.

components/coap/libcoap/AUTHORS

-3
This file was deleted.

0 commit comments

Comments
 (0)