coap: Update libcoap library to commit 8fbe440

Fixes #74

Provides new functionality to build Client Only or Server Only code.

Provides new functionality to include TCP (and hence TLS) support.

Removes the requirement for -Wno-warning
This commit is contained in:
Jon Shallow 2022-07-27 11:17:41 +00:00
parent 5e53b3ec68
commit f183068416
8 changed files with 66 additions and 2153 deletions

View File

@ -9,37 +9,32 @@ endif()
set(include_dirs port/include port/include libcoap/include)
set(srcs
"libcoap/src/address.c"
"libcoap/src/async.c"
"libcoap/src/block.c"
"libcoap/src/coap_address.c"
"libcoap/src/coap_asn1.c"
"libcoap/src/coap_async.c"
"libcoap/src/coap_cache.c"
"libcoap/src/coap_debug.c"
"libcoap/src/coap_event.c"
"libcoap/src/coap_hashkey.c"
"libcoap/src/coap_io.c"
"libcoap/src/coap_notls.c"
"libcoap/src/coap_option.c"
"libcoap/src/coap_prng.c"
"libcoap/src/coap_session.c"
"libcoap/src/coap_subscribe.c"
"libcoap/src/coap_tcp.c"
"libcoap/src/coap_time.c"
"libcoap/src/encode.c"
"libcoap/src/mem.c"
"libcoap/src/net.c"
"libcoap/src/option.c"
"libcoap/src/pdu.c"
"libcoap/src/resource.c"
"libcoap/src/str.c"
"libcoap/src/subscribe.c"
"libcoap/src/uri.c"
"port/src/coap_mbedtls.c")
"libcoap/src/coap_mbedtls.c")
idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS "${include_dirs}"
REQUIRES lwip mbedtls)
# Needed for coap headers in public builds, also.
#
# TODO: find a way to move this to a port header
target_compile_definitions(${COMPONENT_LIB} PUBLIC WITH_POSIX)
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

View File

@ -29,6 +29,10 @@ menu "CoAP Configuration"
at runtime in order to enable CoAP debug output via the ESP
log mechanism.
Note: The Mbed TLS library logging is controlled by the mbedTLS
configuration, but logging level mbedTLS must be set for CoAP
to log it.
choice COAP_MBEDTLS_DEBUG_LEVEL
bool "Set CoAP debugging level"
depends on COAP_MBEDTLS_DEBUG
@ -69,4 +73,37 @@ menu "CoAP Configuration"
default 7 if COAP_LOG_DEBUG
default 9 if COAP_LOG_MBEDTLS
config COAP_TCP_SUPPORT
bool "Enable TCP within CoAP"
default y
help
Enable TCP functionality for CoAP. This is required if TLS sessions
are to be used.
If this option is disabled, redundent CoAP TCP code is removed.
config COAP_CLIENT_SUPPORT
bool "Enable Client functionality within CoAP"
default n
help
Enable client functionality (ability to make requests and receive
responses) for CoAP. If the server is going to act as a proxy, then
this needs to be enabled to support the ongoing session going to
the next hop.
If this option is disabled, redundent CoAP client only code is removed.
If both this option and COAP_SERVER_SUPPORT are disabled, then both
are automatically enabled for backwards compatability.
config COAP_SERVER_SUPPORT
bool "Enable Server functionality within CoAP"
default n
help
Enable server functionality (ability to receive requests and send
responses) for CoAP.
If this option is disabled, redundent CoAP server only code is removed.
If both this option and COAP_CLIENT_SUPPORT are disabled, then both
are automatically enabled for backwards compatability.
endmenu

View File

@ -1,4 +1,4 @@
version: "4.3.0~2"
version: "4.3.0~3"
description: Constrained Application Protocol (CoAP) C Library
url: https://github.com/espressif/idf-extra-components/tree/master/coap
dependencies:

@ -1 +1 @@
Subproject commit 3aa11612c143c9734d72022720f33e12506f7a2c
Subproject commit 8fbe440f8aaa68d6bfcb25e2ad8e68404a38f0ef

View File

@ -24,24 +24,24 @@ extern "C" {
#include "coap3/libcoap.h"
#include "coap3/coap_forward_decls.h"
#include "coap3/address.h"
#include "coap3/async.h"
#include "coap3/block.h"
#include "coap3/coap_address.h"
#include "coap3/coap_async.h"
#include "coap3/coap_cache.h"
#include "coap3/coap_debug.h"
#include "coap3/coap_dtls.h"
#include "coap3/coap_event.h"
#include "coap3/coap_io.h"
#include "coap3/coap_option.h"
#include "coap3/coap_prng.h"
#include "coap3/coap_subscribe.h"
#include "coap3/coap_time.h"
#include "coap3/coap_debug.h"
#include "coap3/encode.h"
#include "coap3/mem.h"
#include "coap3/net.h"
#include "coap3/option.h"
#include "coap3/pdu.h"
#include "coap3/coap_prng.h"
#include "coap3/resource.h"
#include "coap3/str.h"
#include "coap3/subscribe.h"
#include "coap3/uri.h"
#ifdef __cplusplus

View File

@ -39,4 +39,20 @@
#define COAP_RESOURCES_NOHASH
/* Note: If neither of COAP_CLIENT_SUPPORT or COAP_SERVER_SUPPORT is set,
then libcoap sets both for backward compatability */
#ifdef CONFIG_COAP_CLIENT_SUPPORT
#define COAP_CLIENT_SUPPORT 1
#endif /* CONFIG_COAP_CLIENT_SUPPORT */
#ifdef CONFIG_COAP_SERVER_SUPPORT
#define COAP_SERVER_SUPPORT 1
#endif /* CONFIG_COAP_SERVER_SUPPORT */
#ifdef CONFIG_COAP_TCP_SUPPORT
#define COAP_DISABLE_TCP 0
#else /* ! CONFIG_COAP_TCP_SUPPORT */
#define COAP_DISABLE_TCP 1
#endif /* ! CONFIG_COAP_TCP_SUPPORT */
#endif /* _CONFIG_H_ */

View File

@ -32,7 +32,6 @@
#define HAVE_STRUCT_CMSGHDR
#define HAVE_PTHREAD_H
#define HAVE_PTHREAD_MUTEX_LOCK
#define COAP_DISABLE_TCP 0
#define ipi_spec_dst ipi_addr
struct in6_pktinfo {

File diff suppressed because it is too large Load Diff