mirror of
https://github.com/m5stack/platform-espressif32.git
synced 2026-05-20 11:04:15 -07:00
Update examples
This commit is contained in:
@@ -18,3 +18,9 @@ board_build.embed_txtfiles =
|
||||
src/certs/private.pem.key
|
||||
src/certs/certificate.pem.crt
|
||||
src/certs/aws-root-ca.pem
|
||||
|
||||
# IDF v5 is not supported by ASW-IoT SDK
|
||||
# https://github.com/espressif/esp-aws-iot/blob/bbaf03d7d1fbf8a3f91dc18489d7bd27d5b9e9df/README.md?plain=1#L21
|
||||
platform_packages =
|
||||
framework-espidf @ ~3.40403.0
|
||||
toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
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/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/pdu.c"
|
||||
"libcoap/src/resource.c"
|
||||
"libcoap/src/str.c"
|
||||
"libcoap/src/uri.c"
|
||||
"libcoap/src/coap_mbedtls.c")
|
||||
|
||||
idf_component_register(SRCS "${srcs}"
|
||||
INCLUDE_DIRS "${include_dirs}"
|
||||
REQUIRES lwip mbedtls)
|
||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
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.
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
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
|
||||
@@ -0,0 +1,85 @@
|
||||
Copyright (c) 2010--2022, Olaf Bergmann and others
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
o Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
o Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================
|
||||
getopt.c
|
||||
|
||||
License information for getopt.c. This file is only used on Windows
|
||||
builds of the executables in the examples folder:
|
||||
|
||||
/*
|
||||
* This file was copied from the following newsgroup posting:
|
||||
*
|
||||
* Newsgroups: mod.std.unix
|
||||
* Subject: public domain AT&T getopt source
|
||||
* Date: 3 Nov 85 19:34:15 GMT
|
||||
*
|
||||
* Here's something you've all been waiting for: the AT&T public domain
|
||||
* source for getopt(3). It is the code which was given out at the 1985
|
||||
* UNIFORUM conference in Dallas. I obtained it by electronic mail
|
||||
* directly from AT&T. The people there assure me that it is indeed
|
||||
* in the public domain.
|
||||
*/
|
||||
|
||||
========================================================================
|
||||
uthash
|
||||
|
||||
libcoap uses uthash.h and utlist.h from Troy D. Hanson
|
||||
(https://troydhanson.github.io/uthash/). These files use the revised
|
||||
BSD license (BSD-1-Clause license) as included in these two source
|
||||
files.
|
||||
|
||||
========================================================================
|
||||
OpenSSL
|
||||
|
||||
Binaries that are linked against OpenSSL include software developed
|
||||
by the OpenSSL Project for use in the OpenSSL Toolkit.
|
||||
(http://www.openssl.org/). Please consult the OpenSSL license
|
||||
(https://www.openssl.org/source/license.html) for licensing terms.
|
||||
|
||||
========================================================================
|
||||
GnuTLS
|
||||
|
||||
When compiled with GnuTLS support, this software includes components
|
||||
that are licensed under the terms of the the GNU Lesser General Public
|
||||
License, version 2.1
|
||||
(https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html).
|
||||
|
||||
========================================================================
|
||||
tinyDTLS
|
||||
|
||||
When compiled with tinyDTLS support, this software includes components
|
||||
that are licensed under the terms of the Eclipse Distribution License 1.0
|
||||
(http://www.eclipse.org/org/documents/edl-v10.php).
|
||||
|
||||
========================================================================
|
||||
Mbed TLS
|
||||
|
||||
When compiled with Mbed TLS support, this software includes components
|
||||
that are licensed under the terms of the Apache 2.0 license
|
||||
(http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
# libcoap: A C implementation of the Constrained Application Protocol (RFC 7252)
|
||||
|
||||
[](https://github.com/obgm/libcoap/actions?query=branch:main)
|
||||
[](https://github.com/obgm/libcoap/actions?query=branch:develop)
|
||||
[](https://scan.coverity.com/projects/obgm-libcoap)
|
||||
[](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:libcoap)
|
||||
|
||||
Copyright (C) 2010—2022 by Olaf Bergmann <bergmann@tzi.org> and others
|
||||
|
||||
ABOUT LIBCOAP
|
||||
=============
|
||||
|
||||
libcoap is a C implementation of a lightweight application-protocol
|
||||
for devices that are constrained their resources such as computing
|
||||
power, RF range, memory, bandwidth, or network packet sizes. This
|
||||
protocol, CoAP, is standardized by the IETF as RFC 7252. For further
|
||||
information related to CoAP, see <http://coap.technology>.
|
||||
|
||||
You might want to check out
|
||||
[libcoap-minimal](https://github.com/obgm/libcoap-minimal) for usage
|
||||
examples.
|
||||
|
||||
DOCUMENTATION
|
||||
=============
|
||||
|
||||
Documentation and further information can be found at
|
||||
<https://libcoap.net>.
|
||||
|
||||
PACKAGE CONTENTS
|
||||
================
|
||||
|
||||
This package contains a protocol parser and basic networking
|
||||
functions for platforms with support for malloc() and BSD-style
|
||||
sockets. In addition, there is support for Contiki, LwIP and
|
||||
Espressif/ESP-IDF hosted environments.
|
||||
|
||||
The following RFCs are supported
|
||||
|
||||
* RFC7252: The Constrained Application Protocol (CoAP)
|
||||
|
||||
* RFC7390: Group Communication for the Constrained Application Protocol (CoAP)
|
||||
|
||||
* RFC7641: Observing Resources in the Constrained Application Protocol (CoAP)
|
||||
|
||||
* RFC7959: Block-Wise Transfers in the Constrained Application Protocol (CoAP)
|
||||
|
||||
* RFC7967: Constrained Application Protocol (CoAP) Option for No Server Response
|
||||
|
||||
* RFC8132: PATCH and FETCH Methods for the Constrained Application Protocol (CoAP)
|
||||
|
||||
* RFC8323: CoAP (Constrained Application Protocol) over TCP, TLS, and WebSockets
|
||||
[No WebSockets support]
|
||||
|
||||
* RFC8516: "Too Many Requests" Response Code for the Constrained Application Protocol
|
||||
|
||||
* RFC8768: Constrained Application Protocol (CoAP) Hop-Limit Option
|
||||
|
||||
* RFC9175: CoAP: Echo, Request-Tag, and Token Processing
|
||||
|
||||
There is (D)TLS support for the following libraries
|
||||
|
||||
* OpenSSL (Minimum version 1.1.0) [PKI, PSK and PKCS11]
|
||||
|
||||
* GnuTLS (Minimum version 3.3.0) [PKI, PSK, RPK(3.6.6+) and PKCS11]
|
||||
|
||||
* Mbed TLS (Minimum version 2.7.10) [PKI and PSK]
|
||||
|
||||
* TinyDTLS [PSK and RPK] [DTLS Only]
|
||||
|
||||
The examples directory contain a CoAP client, CoAP Resource Directory server
|
||||
and a CoAP server to demonstrate the use of this library.
|
||||
|
||||
BUILDING
|
||||
========
|
||||
|
||||
Further information can be found at <https://libcoap.net/install.html>
|
||||
and [BUILDING](https://raw.githubusercontent.com/obgm/libcoap/develop/BUILDING).
|
||||
|
||||
LICENSE INFORMATION
|
||||
===================
|
||||
|
||||
This library is published as open-source software without any warranty
|
||||
of any kind. Use is permitted under the terms of the simplified BSD
|
||||
license. It includes public domain software. libcoap binaries may also
|
||||
include open-source software with their respective licensing terms.
|
||||
Please refer to
|
||||
[LICENSE](https://raw.githubusercontent.com/obgm/libcoap/develop/LICENSE)
|
||||
for further details.
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
dependencies:
|
||||
idf: '>=4.4'
|
||||
description: Constrained Application Protocol (CoAP) C Library
|
||||
url: https://github.com/espressif/idf-extra-components/tree/master/coap
|
||||
version: 4.3.1~1
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: libcoap crashes, produces incorrect output, or has incorrect behavior
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
----------------------------- Delete Below -----------------------------
|
||||
|
||||
INSTRUCTIONS
|
||||
============
|
||||
|
||||
Before submitting a new issue, please follow the checklist and try to find the
|
||||
answer.
|
||||
|
||||
- [ ] I have read the documentation [libcoap Modules Documentation](https://libcoap.net/doc/reference/develop/modules.html)
|
||||
and the issue is not addressed there.
|
||||
- [ ] I have read the documentation [libcoap Manual Pages](https://libcoap.net/doc/reference/develop/manpage.html)
|
||||
and the issue is not addressed there.
|
||||
- [ ] I have updated my libcoap branch (develop) to the latest version and
|
||||
checked that the issue is present there.
|
||||
- [ ] I have searched the [Issue Tracker](https://github.com/obgm/libcoap/issues)
|
||||
(both open and closed - overwrite `is:issue is:open`) for a similar issue and
|
||||
not found a similar issue.
|
||||
- [ ] I have checked the [Wiki](https://github.com/obgm/libcoap/wiki) to see if
|
||||
the issue is reported there.
|
||||
- [ ] I have read the HOWTOs provided with the source.
|
||||
- [ ] I have read the [BUILDING](https://raw.githubusercontent.com/obgm/libcoap/develop/BUILDING)
|
||||
on how to build from source.
|
||||
|
||||
If the issue cannot be solved after checking through the steps above, please
|
||||
follow these instructions so we can get the needed information to help you in a
|
||||
quick and effective fashion.
|
||||
|
||||
1. Fill in all the fields under **Environment** marked with [ ] by picking the
|
||||
correct option for you in each case and deleting the others.
|
||||
2. Describe your problem.
|
||||
3. Include any debug logs (running the application with verbose logging).
|
||||
4. Providing as much information as possible under **Other items if possible**
|
||||
will help us locate and fix the problem.
|
||||
5. Use [Markdown](https://guides.github.com/features/mastering-markdown/) (see
|
||||
formatting buttons above) and the Preview tab to check what the issue will look
|
||||
like.
|
||||
6. Delete these instructions from the `Delete Below` to the `Delete Above`
|
||||
marker lines before submitting this issue.
|
||||
|
||||
**IMPORTANT: If you do not follow these instructions and provide the necessary
|
||||
details, it may not be possible to resolve your issue.**
|
||||
|
||||
----------------------------- Delete Above -----------------------------
|
||||
|
||||
## Environment
|
||||
|
||||
- libcoap version (run ``git describe --tags`` to find it):
|
||||
|
||||
// v4.3.0-rc3-41-g25fe796
|
||||
- Build System: [Make|CMake]
|
||||
- Operating System: [Windows|Linux|macOS|FreeBSD|Cygwin|Solaris|RIOT|Other (which?)]
|
||||
- Operating System Version: [ ]
|
||||
- Hosted Environment: [None|Contiki|LwIP|ESP-IDF|Other (which?)]
|
||||
|
||||
## Problem Description
|
||||
|
||||
// Detailed problem description goes here.
|
||||
|
||||
### Expected Behavior
|
||||
|
||||
// Describe what you are expecting.
|
||||
|
||||
### Actual Behavior
|
||||
|
||||
// Describe what you are seeing.
|
||||
|
||||
### Steps to reproduce
|
||||
|
||||
1. step1
|
||||
2. ...
|
||||
|
||||
|
||||
### Code to reproduce this issue
|
||||
|
||||
```cpp
|
||||
// the code should be wrapped in the ```cpp tag so that it will be displayed
|
||||
better.
|
||||
#include "coap3/coap.h"
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
```
|
||||
// If your code is longer than 30 lines, upload it as an attachment. Do not
|
||||
include code that is proprietary or sensitive for your project. Try to reduce
|
||||
your code as much as possible so that it only demonstrates the issue.
|
||||
|
||||
## Debug Logs
|
||||
|
||||
```
|
||||
Debug verbose logs go here.
|
||||
Please copy the plain text here for us to search the error log. Or attach the
|
||||
complete logs but leave the main part here if the log is *too* long.
|
||||
```
|
||||
|
||||
## Other items if possible
|
||||
|
||||
- [ ] Does what you are trying to do work under any configuration. Detail what
|
||||
works.
|
||||
- [ ] Network configuration that is not straightforward. Detail any networking
|
||||
that may have NAT or firewalls that might affect what is going on.
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: General libcoap Information
|
||||
url: https://libcoap.net/
|
||||
about: General information about libcoap
|
||||
- name: General libcoap Documentation
|
||||
url: https://libcoap.net/documentation.html
|
||||
about: Documentation information for libcoap
|
||||
- name: Latest libcoap API Documentation
|
||||
url: https://libcoap.net/doc/reference/develop/modules.html
|
||||
about: Latest API information for libcoap
|
||||
- name: Latest libcoap Manual Pages
|
||||
url: https://libcoap.net/doc/reference/develop/manpage.html
|
||||
about: Latest Manual Pages and Examples for libcoap
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for libcoap
|
||||
title: ''
|
||||
labels: 'Type: Feature Request'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
|
||||
A clear and concise description of what the problem is. E.g. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
Please give as many details as you can. Include suggestions for useful APIs or interfaces if relevant.
|
||||
|
||||
**Additional context**
|
||||
|
||||
Add any other context or screenshots about the feature request here.
|
||||
@@ -0,0 +1,196 @@
|
||||
name: Build Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
- release-*
|
||||
- gh-workflows
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
|
||||
env:
|
||||
PLATFORM: posix
|
||||
TESTS: yes
|
||||
OPENSSL_INSTALL_PATH: C:\Program Files\OpenSSL-Win64\
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
CC: ["gcc", "clang"]
|
||||
TLS: ["no", "openssl", "gnutls", "mbedtls"]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: setup
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install -y libcunit1-dev libmbedtls-dev libgnutls28-dev libtool libtool-bin exuberant-ctags valgrind
|
||||
./autogen.sh
|
||||
- name: configure no-TLS
|
||||
if: matrix.TLS == 'no'
|
||||
run: |
|
||||
mkdir build-${{matrix.TLS}}-${{matrix.CC}}
|
||||
cd build-${{matrix.TLS}}-${{matrix.CC}}
|
||||
$GITHUB_WORKSPACE/configure --disable-silent-rules --disable-documentation --enable-examples --enable-tests --disable-dtls CC=${{matrix.CC}}
|
||||
- name: configure TLS
|
||||
if: matrix.TLS != 'no'
|
||||
run: |
|
||||
mkdir build-${{matrix.TLS}}-${{matrix.CC}}
|
||||
cd build-${{matrix.TLS}}-${{matrix.CC}}
|
||||
"$GITHUB_WORKSPACE/configure" --disable-silent-rules --disable-documentation --enable-examples --enable-tests --with-${{matrix.TLS}} CC=${{matrix.CC}}
|
||||
- name: compile
|
||||
run: |
|
||||
cd build-${{matrix.TLS}}-${{matrix.CC}}
|
||||
make EXTRA_CFLAGS=-Werror && make check EXTRA_CFLAGS=-Werror
|
||||
- name: test
|
||||
run: |
|
||||
cd build-${{matrix.TLS}}-${{matrix.CC}}
|
||||
libtool --mode=execute valgrind --track-origins=yes --leak-check=yes --show-reachable=yes --error-exitcode=123 --quiet --suppressions=$GITHUB_WORKSPACE/tests/valgrind_suppression tests/testdriver
|
||||
tinydtls-build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: setup
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install -y libcunit1-dev libtool libtool-bin exuberant-ctags valgrind
|
||||
./autogen.sh
|
||||
- name: configure
|
||||
run: |
|
||||
$GITHUB_WORKSPACE/configure --disable-silent-rules --disable-documentation --enable-examples --enable-tests --with-tinydtls
|
||||
- name: compile
|
||||
run: |
|
||||
make EXTRA_CFLAGS=-Werror && make check EXTRA_CFLAGS=-Werror
|
||||
- name: test
|
||||
run: |
|
||||
LD_LIBRARY_PATH=ext/tinydtls libtool --mode=execute valgrind --track-origins=yes --leak-check=yes --show-reachable=yes --error-exitcode=123 --quiet --suppressions=$GITHUB_WORKSPACE/tests/valgrind_suppression tests/testdriver
|
||||
cmake-build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
TLS: ["no", "openssl", "gnutls", "mbedtls", "tinydtls"]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: setup
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install -y libcunit1-dev libmbedtls-dev libgnutls28-dev
|
||||
cmake -E make_directory $GITHUB_WORKSPACE}/build-${{matrix.TLS}}-cmake
|
||||
- name: configure no-TLS
|
||||
if: matrix.TLS == 'no'
|
||||
run: |
|
||||
cd $GITHUB_WORKSPACE}/build-${{matrix.TLS}}-cmake
|
||||
cmake $GITHUB_WORKSPACE -DENABLE_EXAMPLES=ON -DENABLE_TESTS=ON -DENABLE_DTLS=OFF -DENABLE_DOCS=OFF
|
||||
- name: configure TLS
|
||||
if: matrix.TLS != 'no'
|
||||
run: |
|
||||
cd $GITHUB_WORKSPACE}/build-${{matrix.TLS}}-cmake
|
||||
cmake $GITHUB_WORKSPACE -DENABLE_EXAMPLES=ON -DENABLE_TESTS=ON -DENABLE_DTLS=ON -DENABLE_DOCS=OFF -DDTLS_BACKEND=${{matrix.TLS}}
|
||||
- name: build
|
||||
run: |
|
||||
cd $GITHUB_WORKSPACE}/build-${{matrix.TLS}}-cmake
|
||||
cmake --build .
|
||||
other-build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
OS: ["contiki", "lwip"]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: setup
|
||||
run: |
|
||||
./autogen.sh
|
||||
- name: configure
|
||||
run: |
|
||||
$GITHUB_WORKSPACE/configure --disable-documentation --disable-examples --disable-tests --disable-dtls
|
||||
- name: compile
|
||||
run: |
|
||||
make -C examples/${{matrix.OS}}
|
||||
ms-build:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Add MSBuild to PATH
|
||||
uses: microsoft/setup-msbuild@v1
|
||||
|
||||
- name: Install OpenSSL on Windows (choco)
|
||||
run: |
|
||||
choco install openssl
|
||||
shell: cmd
|
||||
|
||||
- name: Build sln
|
||||
shell: cmd
|
||||
run: call .\scripts\msbuild.sln.cmd
|
||||
|
||||
additional-tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: setup
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install -y libgnutls28-dev libtool libtool-bin exuberant-ctags
|
||||
./autogen.sh
|
||||
- name: configure
|
||||
run: ./configure --disable-tests --disable-documentation
|
||||
- name: build
|
||||
run: |
|
||||
make
|
||||
make -C tests/oss-fuzz -f Makefile.ci check clean
|
||||
documentation:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: setup
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install -y libtool libtool-bin exuberant-ctags graphviz doxygen libxml2-utils xsltproc docbook-xml docbook-xsl asciidoc
|
||||
./autogen.sh
|
||||
- name: configure
|
||||
run: ./configure --disable-tests --enable-documentation --prefix $GITHUB_WORKSPACE/test-install
|
||||
- name: manuals check
|
||||
run: |
|
||||
make -C man
|
||||
- name: manual page examples check
|
||||
run: |
|
||||
man/examples-code-check man
|
||||
- name: doxygen check
|
||||
run: |
|
||||
make -C doc
|
||||
- name: installation check
|
||||
run: |
|
||||
make install && ls -lR $GITHUB_WORKSPACE/test-install
|
||||
distribution:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: setup
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install -y libcunit1-dev libtool libtool-bin exuberant-ctags graphviz doxygen libxml2-utils xsltproc docbook-xml docbook-xsl asciidoc
|
||||
./autogen.sh
|
||||
- name: configure
|
||||
run: |
|
||||
mkdir build-dist
|
||||
cd build-dist
|
||||
$GITHUB_WORKSPACE/configure --enable-silent-rules --enable-documentation --enable-examples --disable-dtls
|
||||
- name: build distribution
|
||||
run: |
|
||||
cd build-dist
|
||||
make dist
|
||||
- name: check distribution build
|
||||
run: |
|
||||
cd build-dist
|
||||
$GITHUB_WORKSPACE/scripts/github_dist.sh
|
||||
shell: bash
|
||||
@@ -0,0 +1,116 @@
|
||||
# .gitignore for libcoap
|
||||
|
||||
# autosave files
|
||||
*~
|
||||
\#*#
|
||||
|
||||
# ignoring autogenerated files and directories by autoreconf
|
||||
INSTALL
|
||||
Makefile
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
ar-lib
|
||||
autom4te.cache/
|
||||
coap_config.h
|
||||
coap_config.h.in
|
||||
compile
|
||||
config.*
|
||||
!config.yml
|
||||
configure
|
||||
debian/
|
||||
depcomp
|
||||
install-sh
|
||||
libcoap-*.tar.bz2
|
||||
libtool
|
||||
ltmain.sh
|
||||
m4/libtool.m4
|
||||
m4/ltoptions.m4
|
||||
m4/ltsugar.m4
|
||||
m4/ltversion.m4
|
||||
m4/lt~obsolete.m4
|
||||
missing
|
||||
stamp-h1
|
||||
|
||||
# ignoring more files generated by the configure script or the make actions
|
||||
.libs/
|
||||
libcoap*.la
|
||||
libcoap*.pc
|
||||
src/**/.deps/
|
||||
src/**/.dirstamp
|
||||
src/**/.libs/
|
||||
src/**/*.o
|
||||
src/**/*.lo
|
||||
src/*.lo
|
||||
src/*.o
|
||||
src/.deps/
|
||||
src/.dirstamp
|
||||
src/.libs/
|
||||
build/
|
||||
|
||||
# the doc/ folder
|
||||
doc/Doxyfile
|
||||
doc/Makefile.in
|
||||
doc/docbook-xsl.css
|
||||
doc/doxyfile.stamp
|
||||
doc/doxygen_sqlite3.db
|
||||
doc/DoxygenLayout.xml
|
||||
doc/upgrade_*.html
|
||||
doc/html/
|
||||
doc/man_html/
|
||||
doc/man_tmp/
|
||||
|
||||
# the man/ folder
|
||||
man/docbook-xsl.css
|
||||
man/examples-code-check
|
||||
man/examples-code-check.exe
|
||||
man/examples-code-check.o
|
||||
man/Makefile
|
||||
man/Makefile.in
|
||||
man/tmp
|
||||
man/.deps/
|
||||
man/*.html
|
||||
man/*.txt
|
||||
man/*.xml
|
||||
man/*.3
|
||||
man/*.5
|
||||
man/*.7
|
||||
|
||||
# the examples/ folder
|
||||
examples/.deps/
|
||||
examples/*.o
|
||||
examples/coap-client
|
||||
examples/coap-client-*
|
||||
examples/coap-etsi_iot_01
|
||||
examples/coap-rd
|
||||
examples/coap-rd-*
|
||||
examples/coap-server
|
||||
examples/coap-server-*
|
||||
examples/coap-tiny
|
||||
examples/*.exe
|
||||
|
||||
# the include/ folder
|
||||
include/coap3/coap.h
|
||||
|
||||
# the tests/ folder
|
||||
tests/.deps
|
||||
tests/oss-fuzz/Makefile.ci
|
||||
tests/testdriver
|
||||
tests/*.o
|
||||
tests/test_common.h
|
||||
|
||||
# ctags - Sublime plugin
|
||||
tags
|
||||
.tags*
|
||||
TAGS
|
||||
|
||||
# ignore gcov-generated files
|
||||
**/*.gcda
|
||||
**/*.gcno
|
||||
**/*.gcov
|
||||
|
||||
# IDE files
|
||||
CMakeLists.txt.user
|
||||
/.vs/
|
||||
/out/
|
||||
/.vscode/
|
||||
/_build/
|
||||
@@ -0,0 +1,4 @@
|
||||
[submodule "ext/tinydtls"]
|
||||
path = ext/tinydtls
|
||||
url = https://github.com/eclipse/tinydtls.git
|
||||
ignore = dirty
|
||||
@@ -0,0 +1,70 @@
|
||||
os:
|
||||
- linux
|
||||
|
||||
language: c
|
||||
|
||||
compiler:
|
||||
- gcc
|
||||
- clang
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
env:
|
||||
- PLATFORM=posix TESTS=yes TLS=no
|
||||
- PLATFORM=posix TESTS=yes TLS=gnutls SMALL_STACK=yes
|
||||
- PLATFORM=posix TESTS=yes TLS=gnutls SMALL_STACK=no
|
||||
- PLATFORM=posix TESTS=yes TLS=gnutls SMALL_STACK=yes EPOLL=no
|
||||
- PLATFORM=posix TESTS=yes TLS=gnutls SMALL_STACK=no EPOLL=no
|
||||
- PLATFORM=posix TESTS=yes TLS=openssl
|
||||
- PLATFORM=posix TESTS=yes TLS=tinydtls
|
||||
- PLATFORM=posix TESTS=yes TLS=mbedtls
|
||||
|
||||
before_install:
|
||||
- docker build -t obgm/libcoap:travis-env .
|
||||
|
||||
branches:
|
||||
only:
|
||||
- main
|
||||
- develop
|
||||
- /^release-.*$/
|
||||
- travis-test
|
||||
|
||||
stages:
|
||||
- test
|
||||
- other platforms
|
||||
- dist
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- stage: other platforms
|
||||
env: PLATFORM=contiki TLS=no
|
||||
before_script:
|
||||
script:
|
||||
- docker run --privileged -e CC -e PLATFORM -e TLS obgm/libcoap:travis-env /bin/sh -c "scripts/build.sh"
|
||||
- stage: other platforms
|
||||
env: PLATFORM=lwip TLS=no
|
||||
before_script:
|
||||
script:
|
||||
- docker run --privileged -e CC -e PLATFORM -e TLS obgm/libcoap:travis-env /bin/sh -c "scripts/build.sh"
|
||||
- stage: dist
|
||||
env: PLATFORM=posix TESTS=yes TLS=no DOCS=yes
|
||||
before_script:
|
||||
script:
|
||||
- docker run --privileged -e CC -e PLATFORM -e TESTS -e DOCS -e TLS obgm/libcoap:travis-env /bin/sh -c "scripts/dist.sh"
|
||||
|
||||
# Docker disables IPv6 in containers by default, so re-enable it.
|
||||
before_script:
|
||||
# `daemon.json` is normally missing, but let's log it in case that changes.
|
||||
- sudo touch /etc/docker/daemon.json
|
||||
- sudo cat /etc/docker/daemon.json
|
||||
- sudo service docker stop
|
||||
# This needs YAML quoting because of the curly braces.
|
||||
- 'echo ''{"ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64"}'' | sudo tee /etc/docker/daemon.json'
|
||||
- sudo service docker start
|
||||
# Fail early if docker failed on start -- add `- sudo dockerd` to debug.
|
||||
- sudo docker info
|
||||
# Paranoia log: what if our config got overwritten?
|
||||
- sudo cat /etc/docker/daemon.json
|
||||
script:
|
||||
- docker run --privileged -e CC -e PLATFORM -e TESTS -e DOCS -e TLS -e EPOLL -e SMALL_STACK obgm/libcoap:travis-env /bin/sh -c "scripts/build.sh"
|
||||
@@ -0,0 +1,8 @@
|
||||
Olaf Bergmann
|
||||
Carsten Schönert
|
||||
Jon Shallow
|
||||
Jean-Claude Michelou
|
||||
Christian Amsüss
|
||||
|
||||
For additional contributors, see
|
||||
https://github.com/obgm/libcoap/graphs/contributors
|
||||
@@ -0,0 +1,157 @@
|
||||
For Windows builds - see the Windows Section
|
||||
|
||||
Obtaining the Libcoap Source
|
||||
============================
|
||||
|
||||
To get the libcoap library source, you need to do either the following
|
||||
|
||||
* Obtain the latest distribution package file from
|
||||
https://github.com/obgm/libcoap/archive/develop.zip
|
||||
[There is a stable version at
|
||||
https://github.com/obgm/libcoap/archive/main.zip]
|
||||
* Change to the directory that you want to install the libcoap sub-directory
|
||||
into
|
||||
* Unpack the distribution package file
|
||||
* Change into the top level directory of the unpackaged files
|
||||
|
||||
or alternatively, clone the libcoap git repository from github
|
||||
|
||||
* Change to the directory that you want to install the libcoap sub-directory
|
||||
into.
|
||||
* Then clone the latest (develop) version of the code:-
|
||||
git clone https://github.com/obgm/libcoap.git
|
||||
* Change into the top level directory of the cloned files
|
||||
* Optionally, change the branch from develop to the stable main branch:-
|
||||
git checkout main
|
||||
|
||||
Building Libcoap Libraries and Examples
|
||||
=======================================
|
||||
|
||||
Follow the appropriate sections below
|
||||
|
||||
|
||||
TinyDTLS Only
|
||||
=============
|
||||
|
||||
It is possible that you may need to execute the following two commands once to
|
||||
get the TinyDTLS code into your project, so the TinyDTLS library can be used.
|
||||
|
||||
git submodule init
|
||||
git submodule update
|
||||
|
||||
General Building with cmake for linux/windows/macos/android (not for LwIP or Contiki - see below)
|
||||
================
|
||||
|
||||
cmake -E remove_directory build
|
||||
cmake -E make_directory build
|
||||
cd build
|
||||
cmake .. -DENABLE_TESTS=ON
|
||||
cmake --build .
|
||||
[sudo] cmake --build . -- install
|
||||
cd ..
|
||||
|
||||
Note: to see possible options (TLS lib, doc, tests, examples etc.):
|
||||
cmake -LH build
|
||||
|
||||
Note: For Windows, this is supported by Visual Studio Code with CMake extension
|
||||
Note: You must use cmake version >=3.10.
|
||||
|
||||
Note: you can use cmake's find package after installation: find_package(libcoap-2 REQUIRED),
|
||||
and target_link_libraries(myTarget PRIVATE libcoap::coap-2)
|
||||
|
||||
Note: Shared Library support is not currently available for Windows.
|
||||
|
||||
General Building with autoconf (not for LwIP or Contiki - see below)
|
||||
================
|
||||
|
||||
./autogen.sh
|
||||
./configure
|
||||
make
|
||||
sudo make install
|
||||
|
||||
./autogen.sh will fail if there is a required package for buildling libcoap
|
||||
that is missing. Install the missing package and try ./autogen.sh again.
|
||||
|
||||
It is possible that you may need to provide some options to ./configure
|
||||
to customize your installation.
|
||||
|
||||
In particular you may need to define which (D)TLS library to use as well as
|
||||
disable some building of documentation.
|
||||
|
||||
General configure instructions can be found in INSTALL, which is built
|
||||
by ./autogen.sh
|
||||
|
||||
./configure --help
|
||||
gives the specific options available to libcoap.
|
||||
|
||||
Some examples are:-
|
||||
|
||||
# No DTLS
|
||||
./configure --enable-tests --disable-documentation --enable-examples --disable-dtls --enable-shared
|
||||
|
||||
# With TinyDTLS
|
||||
./configure --enable-tests --disable-documentation --enable-examples --with-tinydtls --enable-shared
|
||||
|
||||
Note: FreeBSD requires gmake instead of make when building TinyDTLS - i.e.
|
||||
gmake
|
||||
sudo gmake install
|
||||
|
||||
# With OpenSSL
|
||||
./configure --with-openssl --enable-tests --enable-shared
|
||||
|
||||
# With GnuTLS
|
||||
./configure --with-gnutls --enable-tests --enable-shared
|
||||
|
||||
Note: --disable-documentation disables the building of doxygen and man page
|
||||
files. If you want to only disable one of them, use --disable-doxygen or
|
||||
--disable-manpages. Doxygen requires the program doxygen and man pages require
|
||||
the program a2x to build the appropriate files.
|
||||
|
||||
If you need to rebuild the libcoap-*.{map,sym} files to update any exposed
|
||||
function changes, run
|
||||
|
||||
make update-map-file
|
||||
|
||||
prior to running 'make'.
|
||||
|
||||
LwIP
|
||||
====
|
||||
|
||||
./autogen.sh
|
||||
./configure --disable-tests --disable-documentation --disable-examples --disable-dtls
|
||||
cd examples/lwip
|
||||
make
|
||||
|
||||
Executable is ./server. See examples/lwip/README for further information
|
||||
|
||||
Contiki
|
||||
=======
|
||||
|
||||
./autogen.sh
|
||||
./configure --disable-tests --disable-documentation --disable-examples --disable-dtls
|
||||
cd examples/contiki
|
||||
make
|
||||
|
||||
Executable is ./server.minimal-net. See examples/contiki/README for further
|
||||
information
|
||||
|
||||
Windows
|
||||
=======
|
||||
|
||||
Install OpenSSL (minimum version 1.1.0) including the development libraries if
|
||||
not already installed.
|
||||
|
||||
Within Visual Studio, "Clone or check out code" using the repository
|
||||
https://github.com/obgm/libcoap.git
|
||||
|
||||
You may need to update the SDK version of the libcoap Windows Project files to
|
||||
match that of the SDK version of the Visual Studio you are using. In Solution
|
||||
Explorer with the view set to libcoap.sln, right click "Solution 'libcoap'"
|
||||
and then "Retarget solution".
|
||||
|
||||
You may need to edit win32\libcoap.props to update the OpenSSLRootDir and
|
||||
OpenSSLRootDirDbg variables to point to the top level directory where OpenSSL
|
||||
is installed so that the include, lib etc. directories are correctly set up.
|
||||
Note: Make sure that you include a trailing \ in the variable definitions.
|
||||
|
||||
Alternatively you can build everything in Visual Studio with CMake.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,218 @@
|
||||
#######################################################
|
||||
# Developer information for contributing to libcoap #
|
||||
#######################################################
|
||||
|
||||
1. The basics
|
||||
~~~~~~~~~~~~~
|
||||
The libcoap project is a FOSS project that is dual licensed. The maintainer
|
||||
for the libcoap is Olaf Bergmann <bergmann@tzi.org>.
|
||||
Any contributions have to be made under the terms of the
|
||||
license
|
||||
|
||||
* BSD 2-Clause (The BSD 2-Clause License)
|
||||
|
||||
Contributions made up to 2017-06-01 have been made under the dual
|
||||
license model BSD 2-Clause and GPL v2+ (The GNU General Public License
|
||||
2.0 or later).
|
||||
|
||||
The used VCS for libcoap is Git, the main repository is living on GitHub.
|
||||
You can clone (or fork directly on GitHub) on the repository site:
|
||||
|
||||
https://github.com/obgm/libcoap
|
||||
|
||||
Please refer also to the libcoap website for additional information
|
||||
|
||||
https://libcoap.net/
|
||||
|
||||
The build environment is grounded on the classical autotools, the GNU GCC and
|
||||
the LLVM C-compiler (CLang) are supported. The Windows systems are not
|
||||
currently supported (until someone is creating support for it).
|
||||
|
||||
Doxygen is used for creating a HTML based online documentation of the
|
||||
libcoap library.
|
||||
|
||||
2. Communications
|
||||
~~~~~~~~~~~~~~~~~
|
||||
The main discussion and development platform for libcoap is the mailing list
|
||||
on Sourceforge.
|
||||
No matter if you just have a simple question, some specific problem or
|
||||
want to discuss some patches, please write it to the mailing list. Please
|
||||
avoid personal mailings to the maintainer (or some other contributor) if
|
||||
your questions will probably be in the interest of other users too.
|
||||
You can subscribe to the list here:
|
||||
|
||||
https://lists.sourceforge.net/lists/listinfo/libcoap-developers
|
||||
|
||||
The archive of the list can be found on:
|
||||
|
||||
https://sourceforge.net/p/libcoap/mailman/libcoap-developers
|
||||
|
||||
3. Starting contributing
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
As written above libcoap is maintained with the Git tools so you should be
|
||||
familiar with the various git commands.
|
||||
The libcoap project is using just two main branches, the 'main' branch is
|
||||
holding the point releases, all the development process is going on in the
|
||||
'develop' branch.
|
||||
To start any contributing you first have to clone the git tree from the main
|
||||
repository on GitHub:
|
||||
|
||||
git clone https://github.com/obgm/libcoap.git
|
||||
|
||||
4. Working on the source
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
As one golden rule you should work on improvements within *your* own local
|
||||
development branch! To do so you have to first checkout the 'develop' branch
|
||||
as local branch and then start on top on this branch your own branch. So
|
||||
create (or better say checkout) the local 'develop' branch:
|
||||
|
||||
cd libcoap
|
||||
git checkout develop origin/develop
|
||||
|
||||
Now you can simply start your own local branch (for example 'my-develop')
|
||||
with the 'origin/develop' as parent so you can later create the patches
|
||||
against the the upstream development branch:
|
||||
|
||||
git checkout -b my-develop
|
||||
|
||||
At this point you can now work as known with git, modify the source, commit
|
||||
the changes, amend if needed and test your work.
|
||||
At some point you will have to generate patches to post them on the mailing
|
||||
list (and/or push your changes into your public Git tree). It's a good idea to
|
||||
post your patch series on the mailing list so other contributors will see your
|
||||
work and give further suggestions or discuss your work.
|
||||
|
||||
To be able to send a patch series you will now create the series itself as
|
||||
single patches, this will be going easy with the 'git format-patch' command
|
||||
against the 'develop' branch, remind this is the upstream main development
|
||||
branch.
|
||||
To not mix up your series with probably unrelated patches let git place the
|
||||
patches within a defined directory. Also, while create the patches, tell git to
|
||||
create a cover letter patch so you can append some introducing words that will
|
||||
hold probably explanations why you create the patches in the way you have done.
|
||||
|
||||
git format-patch --cover-letter -o ../patches4libcoap
|
||||
|
||||
This command will create a patch series in ../patches4libcoap where you find a
|
||||
patch named '0000-cover-letter.patch'. Please modify this patch with some
|
||||
useful information's for the mailing list. After finish this you now can send
|
||||
your patches to libcoap-developers@lists.sourceforge.net
|
||||
|
||||
git send-email ../patches4libcoap/* --to=libcoap-developers@lists.sourceforge.net
|
||||
|
||||
5. Coding rules
|
||||
~~~~~~~~~~~~~~~
|
||||
As every FOSS project the libcoap project needs also some rules for coding.
|
||||
There are loss but the main of them are important!
|
||||
|
||||
5.1 License and Copyright
|
||||
-------------------------
|
||||
Every new file must contain a license and the copyright holder(s). Please
|
||||
take a look into existing files and adopt the needed changes to your new
|
||||
file(s).
|
||||
|
||||
5.2 Source Code Indentation
|
||||
---------------------------
|
||||
* For better reading the indentation is set to 2 characters as spaces, this
|
||||
is depended on the often used nested functions like 'if-else'. Don't use
|
||||
TABs any there! Avoid trailing white spaces at the end of a line.
|
||||
It's appropriate to set up a modline like this one at first line within
|
||||
the source file:
|
||||
|
||||
--8<----
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
--->8--
|
||||
|
||||
* Single lines within the source code should not be longer then 78
|
||||
characters.
|
||||
|
||||
* If there a functions with a lot of parameters that do not fit into the above
|
||||
rule split the declaration (in the *.h) and the implementation (in the *.c)
|
||||
into single lines per parameter. For example like this (from src/block.c):
|
||||
|
||||
--8<----
|
||||
int
|
||||
coap_add_block(coap_pdu_t *pdu,
|
||||
unsigned int len,
|
||||
const unsigned char *data,
|
||||
unsigned int block_num,
|
||||
unsigned char block_szx);
|
||||
--->8--
|
||||
|
||||
5.3 Source Code Documentation
|
||||
-----------------------------
|
||||
* A useful source code documentation is mandatory. Mostly to be done within the
|
||||
source code files, but more complex description should be done in extra
|
||||
README files.
|
||||
|
||||
* Please set up/adjust the doxygen documentation if you create new functions or
|
||||
change existing functions. The doxygen documentation has to be done in the
|
||||
header files as they are the public part of the libcoap and only use the
|
||||
@-syntax for doxygen commands (akin to javadoc).
|
||||
|
||||
5.4 API Changes
|
||||
---------------
|
||||
* Never break the API!
|
||||
Don't remove old functions and if there some changes are needed in some kind
|
||||
always provide a wrapper for the old call to let the library be backward
|
||||
compatible and mark the old function as @deprecated in the doxygen comment.
|
||||
Please discuss needed changes on the mailing list.
|
||||
|
||||
5.5 Patches and Commits
|
||||
-----------------------
|
||||
* Git commits must be atomic and contain a declarative subject line (max 50
|
||||
characters if possible) and a body for a statement if needed.
|
||||
Use the possibility to write a good explanation why your patch/commit is
|
||||
handle the changes in the way you have done. Remind that other user can
|
||||
read your code but not necessary understand why the code is written this
|
||||
way. Don't use something to generic like "bugfix commit".
|
||||
|
||||
* A patch/commit or a series of patches/commits have to ensure that the
|
||||
whole project is able to build up every thing, in short: Do not break
|
||||
any make target and test your work.
|
||||
|
||||
* Every patch/commit should handle one single logical change. If more than
|
||||
one patch/commit is needed for a change explain it, respect the point
|
||||
above. If your subject line become much larger than 50 characters then
|
||||
typically your patch is to big for one single commit.
|
||||
|
||||
* Commit message should begin with a submodule or unit the commit is for. By
|
||||
this your commit message helps to find thematic other changes. If you have
|
||||
to search and find something with 'git log | grep [foo]' you will see why
|
||||
this is useful. Examples:
|
||||
|
||||
rd.c: Fixed type-specifier warning
|
||||
Makefile.am: Added missing src/address.c
|
||||
address.[hc]: make coap_address_equals() not inline on POSIX
|
||||
|
||||
6. Where to start contributing?
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
There are various things you could starting on to contribute, the best
|
||||
is you simply pick up an issue you blindly see and just improve the
|
||||
situation. Please take also a look into the file TODO and choose a point
|
||||
from there or point the maintainer to add other things here too.
|
||||
|
||||
* Documentation
|
||||
We are always lacking on a better documentation on the source code, so
|
||||
maybe you can improve the doxygen documentation.
|
||||
Also a good documentation on the usage of the libcoap and the example
|
||||
binaries is always improvable. So we appreciate any help on this.
|
||||
|
||||
* Manual Pages
|
||||
The source is providing some example binaries which originally just should show
|
||||
how the libcoap can be used. Right now these binaries are fully usable and
|
||||
quite more than simple examples on a system. There are man pages for these
|
||||
binaries available, if you found there is a improvement needed please do so and
|
||||
write to the mailing list explained in section 2.
|
||||
Maybe you can write up some good HowTo's on the usage for these binaries.
|
||||
|
||||
* HowTo's
|
||||
The libcoap library has now a lot of functions you can use.
|
||||
Unfortunately there is no good user guide on how to use the libcoap in
|
||||
any external project. This means there is no HowTo or CheatSheet for a
|
||||
programming person available. You want to write up something?
|
||||
|
||||
* Missing functionality
|
||||
There are some features that are still missing inside the libcoap. For
|
||||
example some DTLS implementations and proxy functionality.
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
libcoap is published as open-source software without any warranty of any kind.
|
||||
|
||||
Use is permitted under the terms of the simplified BSD 2-Clause license.
|
||||
It includes public domain software. libcoap binaries may also
|
||||
include open-source software with their respective licensing terms.
|
||||
Please refer to LICENSE for further details.
|
||||
@@ -0,0 +1,332 @@
|
||||
2022-08-17 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
Change summary for version 4.3.1:
|
||||
|
||||
* Support for Server only and Client only libcoap builds.
|
||||
* Add support for repeating requests in coap-client.
|
||||
* Add in support for defining resources that support multicast.
|
||||
* Add in more support for async delayed requests.
|
||||
* Add in support for not closing down Observe when closing session.
|
||||
* Support for RFC7390, RFC8516 and RFC9175.
|
||||
* Warn when Tokens are re-used.
|
||||
* Warn when Options are repeated that are not defined as being
|
||||
repeatable.
|
||||
* Support for TLS when using Mbed TLS library.
|
||||
* support for Mbed TLS 3.1
|
||||
* Add in BERT support for block handling.
|
||||
* More rigorous error handling for Block transfers.
|
||||
* Support for using external or submodule TinyDTLS.
|
||||
* Cmake - add in Apple build support.
|
||||
* Source files renamed to be more consistent in naming.
|
||||
* Update native Windows VC builds to use libcoap-3 instead of libcoap-2.
|
||||
* Reported bugs fixed.
|
||||
* Example applications Help report include build version.
|
||||
* Documentation added and updated (Doxygen and man).
|
||||
|
||||
2021-05-04 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
Change summary for version 4.3.0:
|
||||
|
||||
* Include directory updated from include/coap2 to include/coap3 as
|
||||
this is a major version change.
|
||||
* Other code references updated from coap2 to coap3.
|
||||
* Examples now have the underlying (D)TLS library name as a suffix.
|
||||
E.g. coap-server-openssl
|
||||
* Examples and libraries can be installed with default names using
|
||||
./configure --enable-add-default-names
|
||||
* Many call-back handlers have had their parameter lists changed, some
|
||||
variables are made const and other ones removed as they can be easily
|
||||
reconstructed if needed.
|
||||
* Some functions have their parameters changed to const.
|
||||
* Internal structures made opaque to applications, requiring the
|
||||
applications to access the structure information via a new set of
|
||||
functions. The new functions are of the form coap_X_get_Y() or
|
||||
coap_X_set_Y() where X is the structure (e.g. session) and Y is
|
||||
the variable.
|
||||
* coap_async_state_t
|
||||
* coap_attr_t
|
||||
* coap_context_t
|
||||
* coap_packet_t
|
||||
* coap_pdu_t
|
||||
* coap_resource_t
|
||||
* coap_session_t
|
||||
* coap_socket_t
|
||||
* Header files are moved into libcoap space and so are accessed by coap
|
||||
sub-directory - e.g. #include <coap3/coap.h>.
|
||||
* RFC7959 (Block handling) moved into libcoap from application code
|
||||
considerably simplifying application code. See coap_block(3) man page.
|
||||
* CoAP Cache Key support.
|
||||
* Support for cmake builds.
|
||||
* Support for RIOT builds.
|
||||
* Support for Cygwin builds.
|
||||
* Proxy support for coap-server, enhanced coap-client capabilities
|
||||
* Updated async support.
|
||||
* Multicast requests now randomly delayed befor ethe response is
|
||||
sent.
|
||||
* Additional RFC support - RFC8768.
|
||||
* Mbed TLS DTLS library support.
|
||||
* (D)TLS support for RPK and PKCS11.
|
||||
* Additional (D)TLS support for PSK (e.g. Identity Hints).
|
||||
* PKI support consistent across all supported (D)TLS libraries.
|
||||
* Support for disabling TCP for code reduction.
|
||||
* More rigorous checking and appropriate rejection of inbound PDU
|
||||
options.
|
||||
* Additional unit tests.
|
||||
* Reported bugs fixed.
|
||||
* Example applications help reports on (D)TLS library capabilities
|
||||
and versions.
|
||||
* Documentation added and updated (Doxygen and man).
|
||||
|
||||
2019-11-05 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
Change summary for version 4.2.1:
|
||||
|
||||
* Builds now support silent rules
|
||||
* Support building with TinyDTLS as a shared library
|
||||
* Added in EPOLL support
|
||||
* Added in support for constrained stacks
|
||||
* Server sessions hashed for performance lookup
|
||||
* coap_endpoint_t and coap_subscription_t made opaque to applications
|
||||
* Documentation updated
|
||||
|
||||
2019-02-11 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
Change summary for version 4.2.0:
|
||||
|
||||
* DTLS support improvements (OpenSSL, GnuTLS, tinydtls)
|
||||
* Pre-shared keys, X.509 certificates
|
||||
* new session abstraction
|
||||
* TCP and TLS support
|
||||
* improved documentation; manual pages
|
||||
* changes in internal PDU structure
|
||||
* improved examples (DTLS usage, block-wise transfer)
|
||||
* docker images for continuous integration
|
||||
* support for Google OSS fuzzer
|
||||
* MS Visual Studio project for Windows builds
|
||||
|
||||
2017-07-10 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* DTLS support (OpenSSL, tinyDTLS) by Jean-Claude Michelou
|
||||
* Win32 support by Jean-Claude Michelou
|
||||
* New Session API by Jean-Claude Michelou
|
||||
|
||||
2016-02-16 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* Fixed build for Contiki3 and LwIP
|
||||
* .travis.yml: Enabled continuous integration for platforms
|
||||
POSIX and Contiki
|
||||
|
||||
2015-03-11 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* include/coap/resource.h: Replaced custom list structures by
|
||||
utlist macros.
|
||||
|
||||
2015-03-09 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* src/uri.c (coap_split_path): Fixed URI parser bug and
|
||||
removed broken parse iterator.
|
||||
|
||||
2015-03-05 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* src/coap_time.c (coap_ticks): Changed POSIX implementation
|
||||
to fixed point arithmetic and removed clock_offset.
|
||||
|
||||
2015-02-21 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* net.c (coap_send_confirmed): Use fixed point arithmetic
|
||||
to calculate retransmission timeout.
|
||||
|
||||
2015-02-20 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* coap_list.[hc]: Moved old list implementation into
|
||||
sub-directory examples and replaced by linked lists
|
||||
from utlist.h. As a result, the list must be sorted
|
||||
explicitly with LL_SORT).
|
||||
|
||||
2015-02-19 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* net.c (coap_send_confirmed): Fixed retransmission timeout
|
||||
calculation and renamed transmission parameters according to
|
||||
Section 4.8 of RFC 7252.
|
||||
|
||||
2015-02-17 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* major rework to get Contiki and lwip running
|
||||
* many fixed bugs and warnings
|
||||
|
||||
2014-06-18 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* mem.c (coap_malloc_type): New functions for allocating memory.
|
||||
On POSIX systems, coap_malloc_type() and coap_free_type() are just
|
||||
wrapper functions for malloc() and free(), while on Contiki and
|
||||
LWIP distinct arrays are used for each type.
|
||||
|
||||
2014-03-09 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* net.c (coap_cancel): Removed 7.31 again and implemented new
|
||||
method for cancelling observe relationships.
|
||||
|
||||
2014-02-25 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* net.c (coap_cancel): Handling of 7.31 responses to cancel
|
||||
notifications (see Section 4.6 of draft-ietf-core-observe-12)
|
||||
|
||||
2014-02-04 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* resource.c (coap_print_link): This function now takes an offset
|
||||
where printing starts. This is used for generating blocks on the
|
||||
fly.
|
||||
|
||||
* net.c (wellknown_response): Added support for Block2 options
|
||||
when generating a response for .well-known/core.
|
||||
|
||||
* block.h (coap_opt_block_num): Fixed handling of zero-length
|
||||
options. COAP_OPT_BLOCK_LAST now returns NULL when the option
|
||||
value's length is zero.
|
||||
|
||||
2014-01-07 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* resource.c (coap_print_link): Output partial resource
|
||||
descriptions. The function now provides a sliding window over the
|
||||
textual representation of the resource. Output starts at the given
|
||||
offset and ends at the buffer's upper bound. The meaning of the
|
||||
return value has changed to allow distinguishing whether or not
|
||||
the resource description has been truncated at the buffer's upper
|
||||
bound.
|
||||
(print_wellknown): Support for the new coap_print_link(). An
|
||||
additional parameter now is used to provide the offset into the
|
||||
resource description. The meaning of the return value has been
|
||||
adjusted accordingly.
|
||||
|
||||
2013-12-23 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* configure.in: merged with LWIP port from chrysn
|
||||
<https://git.gitorious.org/coap-lwip/coap-lwip.git>. This
|
||||
introduces new compiler flags WITH_POSIX and WITH_LWIP to
|
||||
distinguish target platforms.
|
||||
|
||||
2013-09-03 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* option.h (coap_option_setb): increased size of option type
|
||||
argument
|
||||
|
||||
* tests/test_error_response.c (t_init_error_response_tests): new
|
||||
tests for error response generation
|
||||
|
||||
* tests/test_pdu.c (t_encode_pdu5): fixed number for option Accept
|
||||
|
||||
* net.c (coap_new_error_response): fixed option size calculation
|
||||
|
||||
2013-07-04 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* net.c (coap_new_context): register critical Accept option
|
||||
|
||||
* pdu.c: option codes for Accept and Size1 according to coap-18
|
||||
|
||||
2013-02-01 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* coap_time.h (coap_clock_init_impl): fix invalid preprocessor
|
||||
directive. #warning is now only used for gcc only (close sf bug #15)
|
||||
|
||||
* net.c (wellknown_response): applied patch from chrysn to
|
||||
fix bug in generation of .well-known/core representation
|
||||
|
||||
2013-01-21 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* option.h: renamed option field in coap_opt_iterator_t to
|
||||
next_option to detect erroneous use in old code
|
||||
|
||||
2013-01-18 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* configure.in: new option --with-tests to enable unit tests
|
||||
|
||||
* tests/testdriver.c: unit tests for parser functions
|
||||
|
||||
* pdu.c (coap_pdu_parse): new PDU parser for Klaus-encoding
|
||||
according to coap-13
|
||||
|
||||
* net.c (coap_read): call coap_pdu_parse() to check PDU integrity
|
||||
|
||||
* option.c: Klaus-encoding for coap-13, including new option
|
||||
iterator interface
|
||||
|
||||
2012-11-20 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* net.c (next_option_safe): made option parsing more robust in
|
||||
presence of option jumps
|
||||
|
||||
* pdu.h: new option codes from draft-ietf-core-coap-12
|
||||
|
||||
* option.c (coap_opt_setlength): new function to set option length
|
||||
|
||||
* uri.c (make_decoded_option): use coap_opt_setlength() instead of
|
||||
obsolete macro COAP_OPT_SETLENGTH.
|
||||
|
||||
2012-11-19 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* uri.c (make_decoded_option): use coap_opt_encode() instead of writing
|
||||
|
||||
2012-11-03 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* net.c (coap_read): read new option encoding
|
||||
|
||||
2012-11-01 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* option.c (coap_opt_size, coap_opt_value, coap_opt_length):
|
||||
several functions to access fields of options (possibly preceeded
|
||||
by option jump)
|
||||
|
||||
2012-10-25 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* option.c (coap_opt_encode): new function for option encoding
|
||||
with option jumps
|
||||
|
||||
2012-03-23 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* examples/client.c (clear_obs): clear observation relationship after
|
||||
user-specified duration
|
||||
|
||||
2012-03-21 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* resource.c (print_wellknown): filtering by attributes
|
||||
|
||||
2012-03-19 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* pdu.c (coap_add_option): allow more than 15 options.
|
||||
|
||||
2012-03-15 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* examples/client.c (cmdline_uri): split path and query here to
|
||||
make it easier to include these options in subsequent requests for
|
||||
block transfer.
|
||||
|
||||
2012-03-14 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* examples/etsi_iot_01.c: Support for POST, PUT, DELETE on /test
|
||||
|
||||
2012-03-13 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* encode.c (coap_encode_var_bytes): more efficient coding for 0
|
||||
|
||||
2012-03-11 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* examples/etsi_iot_01.c: Test cases for 1st ETSI CoAP Plugtest,
|
||||
March 24/25, 2012 in Paris, France.
|
||||
|
||||
2012-03-10 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* block.c: support for block transfer.
|
||||
|
||||
2012-03-07 Olaf Bergmann <bergmann@tzi.org>
|
||||
|
||||
* examples/client.c (usage): new command line options
|
||||
-B to set timeout after which the main loop is left.
|
||||
-e to specify a payload (incompatible with -f)
|
||||
(message_handler): bugfixes
|
||||
|
||||
* resource.h: (coap_method_handler_t): new API for method handlers.
|
||||
|
||||
|
||||
Copyright 2012 Olaf Bergmann, TZI
|
||||
Copying and distribution of this file, with or without modification, are
|
||||
permitted provided the copyright notice and this notice are preserved.
|
||||
@@ -0,0 +1,7 @@
|
||||
FROM obgm/libcoap:build-env
|
||||
|
||||
ENV libcoap_dir=/libcoap
|
||||
ADD . $libcoap_dir
|
||||
WORKDIR $libcoap_dir
|
||||
|
||||
RUN ./autogen.sh --clean && ./autogen.sh
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user