Skip to content

Commit 9ed7356

Browse files
committed
feat(coap): Bring coap component and example from idf
Commit ID: 463a9d8b
1 parent aa769c9 commit 9ed7356

File tree

123 files changed

+1838
-25209
lines changed

Some content is hidden

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

123 files changed

+1838
-25209
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
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

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,37 @@
1-
set(COMPONENT_ADD_INCLUDEDIRS port/include port/include/coap libcoap/include libcoap/include/coap)
1+
set(include_dirs port/include port/include/coap libcoap/include libcoap/include/coap2)
22

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

2224
set(COMPONENT_REQUIRES lwip)
2325

24-
register_component()
26+
idf_component_register(SRCS "${srcs}"
27+
INCLUDE_DIRS "${include_dirs}"
28+
REQUIRES lwip)
29+
30+
# Silence format truncation warning, until it is fixed upstream
31+
set_source_files_properties(libcoap/src/coap_debug.c PROPERTIES COMPILE_FLAGS -Wno-format-truncation)
2532

2633
# Needed for coap headers in public builds, also.
2734
#
2835
# TODO: find a way to move this to a port header
2936
target_compile_definitions(${COMPONENT_LIB} PUBLIC WITH_POSIX)
3037

31-
set_source_files_properties(
32-
libcoap/src/debug.c
33-
libcoap/src/pdu.c
34-
PROPERTIES COMPILE_FLAGS
35-
-Wno-write-strings)
36-
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/Makefile.projbuild

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/coap/component.mk

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
# Component Makefile
33
#
44

5-
COMPONENT_ADD_INCLUDEDIRS := port/include port/include/coap libcoap/include libcoap/include/coap
5+
COMPONENT_ADD_INCLUDEDIRS := port/include port/include/coap libcoap/include libcoap/include/coap2
66

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
7+
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
88

99
COMPONENT_SRCDIRS := libcoap/src libcoap port
1010

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
11+
COMPONENT_SUBMODULES += libcoap
12+
13+
# Silence format truncation warning, until it is fixed upstream
14+
libcoap/src/coap_debug.o: CFLAGS += -Wno-format-truncation

components/coap/libcoap

Submodule libcoap added at cfec0d0

components/coap/libcoap/.gitignore

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

components/coap/libcoap/.travis.yml

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

components/coap/libcoap/AUTHORS

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

0 commit comments

Comments
 (0)