mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'feature/coap_to_component_manager' into 'master'
Push out `coap` to idf-extra-component repository Closes IDF-4626 See merge request espressif/esp-idf!17241
This commit is contained in:
commit
66593bf140
@ -71,7 +71,6 @@
|
||||
/components/bootloader_support/bootloader_flash/ @esp-idf-codeowners/peripherals
|
||||
/components/bt/ @esp-idf-codeowners/bluetooth
|
||||
/components/cmock/ @esp-idf-codeowners/system
|
||||
/components/coap/ @esp-idf-codeowners/app-utilities
|
||||
/components/console/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities
|
||||
/components/cxx/ @esp-idf-codeowners/system
|
||||
/components/driver/ @esp-idf-codeowners/peripherals
|
||||
|
@ -168,8 +168,6 @@
|
||||
- "components/cmock/CMock"
|
||||
- "components/cmock/CMock/vendor/c_exception"
|
||||
- "components/cmock/CMock/vendor/unity"
|
||||
- "components/coap/libcoap"
|
||||
- "components/coap/libcoap/ext/tinydtls"
|
||||
- "components/esp_phy/lib"
|
||||
- "components/esp_wifi/lib"
|
||||
- "components/esptool_py/esptool"
|
||||
|
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -15,10 +15,6 @@
|
||||
path = components/bootloader/subproject/components/micro-ecc/micro-ecc
|
||||
url = ../../kmackay/micro-ecc.git
|
||||
|
||||
[submodule "components/coap/libcoap"]
|
||||
path = components/coap/libcoap
|
||||
url = ../../obgm/libcoap.git
|
||||
|
||||
[submodule "components/spiffs/spiffs"]
|
||||
path = components/spiffs/spiffs
|
||||
url = ../../pellepl/spiffs.git
|
||||
|
@ -1,47 +0,0 @@
|
||||
if(NOT CONFIG_LWIP_IPV6 AND NOT CMAKE_BUILD_EARLY_EXPANSION)
|
||||
message(STATUS "IPV6 support is disabled so the coap component will not be built")
|
||||
# note: the component is still included in the build so it can become visible again in config
|
||||
# without needing to re-run CMake. However no source or header files are built.
|
||||
idf_component_register()
|
||||
return()
|
||||
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_asn1.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_mbedtls.c"
|
||||
"libcoap/src/coap_notls.c"
|
||||
"libcoap/src/coap_prng.c"
|
||||
"libcoap/src/coap_session.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")
|
||||
|
||||
idf_component_register(SRCS "${srcs}"
|
||||
INCLUDE_DIRS "${include_dirs}"
|
||||
REQUIRES lwip mbedtls)
|
||||
|
||||
# Silence format truncation warning, until it is fixed upstream
|
||||
# set_source_files_properties(libcoap/src/coap_debug.c PROPERTIES COMPILE_FLAGS -Wno-format-truncation)
|
||||
|
||||
# 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)
|
@ -1,72 +0,0 @@
|
||||
menu "CoAP Configuration"
|
||||
visible if LWIP_IPV6
|
||||
|
||||
choice COAP_MBEDTLS_ENCRYPTION_MODE
|
||||
prompt "CoAP Encryption method"
|
||||
default COAP_MBEDTLS_PSK
|
||||
help
|
||||
If the CoAP information is to be encrypted, the encryption environment
|
||||
can be set up in one of two ways (default being Pre-Shared key mode)
|
||||
|
||||
- Encrypt using defined Pre-Shared Keys (PSK if uri includes coaps://)
|
||||
- Encrypt using defined Public Key Infrastructure (PKI if uri includes coaps://)
|
||||
|
||||
config COAP_MBEDTLS_PSK
|
||||
bool "Pre-Shared Keys"
|
||||
|
||||
config COAP_MBEDTLS_PKI
|
||||
bool "PKI Certificates"
|
||||
|
||||
endchoice #COAP_MBEDTLS_ENCRYPTION_MODE
|
||||
|
||||
config COAP_MBEDTLS_DEBUG
|
||||
bool "Enable CoAP debugging"
|
||||
default n
|
||||
help
|
||||
Enable CoAP debugging functions at compile time for the example code.
|
||||
|
||||
If this option is enabled, call coap_set_log_level()
|
||||
at runtime in order to enable CoAP debug output via the ESP
|
||||
log mechanism.
|
||||
|
||||
choice COAP_MBEDTLS_DEBUG_LEVEL
|
||||
bool "Set CoAP debugging level"
|
||||
depends on COAP_MBEDTLS_DEBUG
|
||||
default COAP_LOG_WARNING
|
||||
help
|
||||
Set CoAP debugging level
|
||||
|
||||
config COAP_LOG_EMERG
|
||||
bool "Emergency"
|
||||
config COAP_LOG_ALERT
|
||||
bool "Alert"
|
||||
config COAP_LOG_CRIT
|
||||
bool "Critical"
|
||||
config COAP_LOG_ERROR
|
||||
bool "Error"
|
||||
config COAP_LOG_WARNING
|
||||
bool "Warning"
|
||||
config COAP_LOG_NOTICE
|
||||
bool "Notice"
|
||||
config COAP_LOG_INFO
|
||||
bool "Info"
|
||||
config COAP_LOG_DEBUG
|
||||
bool "Debug"
|
||||
config COAP_LOG_MBEDTLS
|
||||
bool "mbedTLS"
|
||||
endchoice
|
||||
|
||||
config COAP_LOG_DEFAULT_LEVEL
|
||||
int
|
||||
default 0 if !COAP_MBEDTLS_DEBUG
|
||||
default 0 if COAP_LOG_EMERG
|
||||
default 1 if COAP_LOG_ALERT
|
||||
default 2 if COAP_LOG_CRIT
|
||||
default 3 if COAP_LOG_ERROR
|
||||
default 4 if COAP_LOG_WARNING
|
||||
default 5 if COAP_LOG_NOTICE
|
||||
default 6 if COAP_LOG_INFO
|
||||
default 7 if COAP_LOG_DEBUG
|
||||
default 9 if COAP_LOG_MBEDTLS
|
||||
|
||||
endmenu
|
@ -1 +0,0 @@
|
||||
Subproject commit 3aa11612c143c9734d72022720f33e12506f7a2c
|
@ -1,51 +0,0 @@
|
||||
/* Modify head file implementation for ESP32 platform.
|
||||
*
|
||||
* Uses libcoap software implementation for failover when concurrent
|
||||
* define operations are in use.
|
||||
*
|
||||
* coap.h -- main header file for CoAP stack of libcoap
|
||||
*
|
||||
* Copyright (C) 2010-2012,2015-2016 Olaf Bergmann <bergmann@tzi.org>
|
||||
* 2015 Carsten Schoenert <c.schoenert@t-online.de>
|
||||
*
|
||||
* Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
|
||||
*
|
||||
* This file is part of the CoAP library libcoap. Please see README for terms
|
||||
* of use.
|
||||
*/
|
||||
|
||||
#ifndef _COAP_H_
|
||||
#define _COAP_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#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_cache.h"
|
||||
#include "coap3/coap_dtls.h"
|
||||
#include "coap3/coap_event.h"
|
||||
#include "coap3/coap_io.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
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _COAP_H_ */
|
@ -1,42 +0,0 @@
|
||||
/*
|
||||
* libcoap configure implementation for ESP32 platform.
|
||||
*
|
||||
* Uses libcoap software implementation for failover when concurrent
|
||||
* configure operations are in use.
|
||||
*
|
||||
* coap.h -- main header file for CoAP stack of libcoap
|
||||
*
|
||||
* Copyright (C) 2010-2012,2015-2016 Olaf Bergmann <bergmann@tzi.org>
|
||||
* 2015 Carsten Schoenert <c.schoenert@t-online.de>
|
||||
*
|
||||
* Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
|
||||
*
|
||||
* This file is part of the CoAP library libcoap. Please see README for terms
|
||||
* of use.
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_H_
|
||||
#define _CONFIG_H_
|
||||
|
||||
/* Always enabled in ESP-IDF */
|
||||
#ifndef WITH_POSIX
|
||||
#define WITH_POSIX
|
||||
#endif
|
||||
|
||||
#include "coap_config_posix.h"
|
||||
|
||||
#define HAVE_STDIO_H
|
||||
#define HAVE_ASSERT_H
|
||||
|
||||
#define PACKAGE_STRING PACKAGE_NAME PACKAGE_VERSION
|
||||
|
||||
/* it's just provided by libc. i hope we don't get too many of those, as
|
||||
* actually we'd need autotools again to find out what environment we're
|
||||
* building in */
|
||||
#define HAVE_STRNLEN 1
|
||||
|
||||
#define HAVE_LIMITS_H
|
||||
|
||||
#define COAP_RESOURCES_NOHASH
|
||||
|
||||
#endif /* _CONFIG_H_ */
|
@ -1,60 +0,0 @@
|
||||
/*
|
||||
* libcoap configure implementation for ESP32 platform.
|
||||
*
|
||||
* Uses libcoap software implementation for failover when concurrent
|
||||
* configure operations are in use.
|
||||
*
|
||||
* coap.h -- main header file for CoAP stack of libcoap
|
||||
*
|
||||
* Copyright (C) 2010-2012,2015-2016 Olaf Bergmann <bergmann@tzi.org>
|
||||
* 2015 Carsten Schoenert <c.schoenert@t-online.de>
|
||||
*
|
||||
* Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
|
||||
*
|
||||
* This file is part of the CoAP library libcoap. Please see README for terms
|
||||
* of use.
|
||||
*/
|
||||
|
||||
#ifndef COAP_CONFIG_POSIX_H_
|
||||
#define COAP_CONFIG_POSIX_H_
|
||||
|
||||
#ifdef WITH_POSIX
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
|
||||
#define HAVE_SYS_SOCKET_H
|
||||
#define HAVE_MALLOC
|
||||
#define HAVE_ARPA_INET_H
|
||||
#define HAVE_TIME_H
|
||||
#define HAVE_NETDB_H
|
||||
#define HAVE_NETINET_IN_H
|
||||
#define HAVE_STRUCT_CMSGHDR
|
||||
#define COAP_DISABLE_TCP 0
|
||||
|
||||
#define ipi_spec_dst ipi_addr
|
||||
struct in6_pktinfo {
|
||||
struct in6_addr ipi6_addr; /* src/dst IPv6 address */
|
||||
unsigned int ipi6_ifindex; /* send/recv interface index */
|
||||
};
|
||||
#define IN6_IS_ADDR_V4MAPPED(a) \
|
||||
((((__const uint32_t *) (a))[0] == 0) \
|
||||
&& (((__const uint32_t *) (a))[1] == 0) \
|
||||
&& (((__const uint32_t *) (a))[2] == htonl (0xffff)))
|
||||
|
||||
/* As not defined, just need to define is as something innocuous */
|
||||
#define IPV6_PKTINFO IPV6_CHECKSUM
|
||||
|
||||
#define PACKAGE_NAME "libcoap-posix"
|
||||
#define PACKAGE_VERSION "?"
|
||||
|
||||
#ifdef CONFIG_MBEDTLS_TLS_ENABLED
|
||||
#define HAVE_MBEDTLS
|
||||
#endif /* CONFIG_MBEDTLS_TLS_ENABLED */
|
||||
#define COAP_CONSTRAINED_STACK 1
|
||||
#define ESPIDF_VERSION
|
||||
|
||||
#define gai_strerror(x) "gai_strerror() not supported"
|
||||
|
||||
#endif /* WITH_POSIX */
|
||||
#endif /* COAP_CONFIG_POSIX_H_ */
|
@ -33,8 +33,6 @@ These third party libraries can be included into the application (firmware) prod
|
||||
|
||||
* `linenoise`_ line editing library Copyright (c) 2010-2014 Salvatore Sanfilippo, Copyright (c) 2010-2013 Pieter Noordhuis, licensed under 2-clause BSD license.
|
||||
|
||||
* `libcoap`_ COAP library Copyright (c) 2010-2017 Olaf Bergmann and others, is licensed under 2-clause BSD license as described in :component_file:`LICENSE file <coap/libcoap/LICENSE>` and :component_file:`COPYING file <coap/libcoap/COPYING>` .
|
||||
|
||||
* `FatFS`_ library, Copyright (C) 2017 ChaN, is licensed under :component_file:`a BSD-style license <fatfs/src/ff.h#L1-L18>`.
|
||||
|
||||
* `cJSON`_ library, Copyright (c) 2009-2017 Dave Gamble and cJSON contributors, is licensed under MIT license as described in :component_file:`LICENSE file <json/cJSON/LICENSE>`.
|
||||
@ -161,7 +159,6 @@ Copyright (C) 2011, ChaN, all right reserved.
|
||||
.. _TJpgDec: http://elm-chan.org/fsw/tjpgd/00index.html
|
||||
.. _argtable3: https://github.com/argtable/argtable3
|
||||
.. _linenoise: https://github.com/antirez/linenoise
|
||||
.. _libcoap: https://github.com/obgm/libcoap
|
||||
.. _fatfs: http://elm-chan.org/fsw/ff/00index_e.html
|
||||
.. _cJSON: https://github.com/DaveGamble/cJSON
|
||||
.. _micro-ecc: https://github.com/kmackay/micro-ecc
|
||||
|
@ -13,6 +13,7 @@ Following components are removed from ESP-IDF and moved to `IDF Component Regist
|
||||
|
||||
* `sh2lib <https://components.espressif.com/component/espressif/sh2lib>`_
|
||||
* `expat <https://components.espressif.com/component/espressif/expat>`_
|
||||
* `coap <https://components.espressif.com/components/espressif/coap>`_
|
||||
|
||||
These components can be installed using ``idf.py add-dependency`` command.
|
||||
|
||||
|
2
examples/protocols/coap_client/main/idf_component.yml
Normal file
2
examples/protocols/coap_client/main/idf_component.yml
Normal file
@ -0,0 +1,2 @@
|
||||
dependencies:
|
||||
espressif/coap: ">=4.3.0"
|
2
examples/protocols/coap_server/main/idf_component.yml
Normal file
2
examples/protocols/coap_server/main/idf_component.yml
Normal file
@ -0,0 +1,2 @@
|
||||
dependencies:
|
||||
espressif/coap: ">=4.3.0"
|
@ -406,9 +406,6 @@ components/bt/host/bluedroid/stack/smp/smp_keys.c
|
||||
components/bt/host/bluedroid/stack/smp/smp_l2c.c
|
||||
components/bt/host/bluedroid/stack/smp/smp_main.c
|
||||
components/bt/host/bluedroid/stack/smp/smp_utils.c
|
||||
components/coap/port/include/coap3/coap.h
|
||||
components/coap/port/include/coap_config.h
|
||||
components/coap/port/include/coap_config_posix.h
|
||||
components/console/argtable3/argtable3.c
|
||||
components/console/argtable3/argtable3.h
|
||||
components/console/linenoise/linenoise.c
|
||||
|
@ -49,8 +49,6 @@ components/mbedtls/port/include/
|
||||
components/mbedtls/mbedtls/include/mbedtls/
|
||||
components/mbedtls/mbedtls/include/psa/
|
||||
|
||||
components/coap/
|
||||
|
||||
components/esp-tls/private_include/
|
||||
|
||||
components/protobuf-c/
|
||||
|
@ -15,7 +15,6 @@ skip:
|
||||
- "components/bt/host/nimble/nimble"
|
||||
- "components/bt/lib"
|
||||
- "components/cmock/CMock"
|
||||
- "components/coap"
|
||||
- "components/esp_phy/lib"
|
||||
- "components/esp_wifi/lib"
|
||||
- "components/esp_wifi/lib_esp32"
|
||||
|
Loading…
Reference in New Issue
Block a user