Include common system header files in coap_internal.h based on HAVE_*H
definitions.
Remove these system header files from include/*/*.h.
Add in system header files where appropriate in various apps.
Some of the Zephyr include files need to be C++, not C based. The 'extern "C"'
wrapper in include/coap3/coap.h means that all #include are treated as being C.
Remove 'extern "C"' wrapper from include/coap3/coap.h and add wrapper to
include files after #include and before any function / structure definitions.
Add in a C++ build test for CI.
New functions
coap_async_set_app_data2()
coap_cache_set_app_data2()
coap_context_set_app_data2()
coap_session_set_app_data2()
that, multi-thread safe, store an application data pointer and return the
previous data pointer (if any). There is an optional callback that will
be called when the respective storage object is released that can free
off as appropriate the data that was stored.
These replace the existing coap_*_set_app_data() functions and
coap_*_get_app_data() can be used to get the stored data pointer.
Update the Public API equivalent of the libcoap functions that need to be
called when locked with a name suffix of _lkd.
Move matching Public API functions out of coap_threadsafe.c to be coded
just ahead of the newly renamed _lkd function.
Properly define the _lkd function in the appropriate _internal.h file for
documentation, removing the #defines from coap_threadsafe_internal.h.
Tag all the Public API functions that have a _lkd function with COAP_API.
COAP_API can then be defined as to what should be done for that function.
Check libcoap library does not call the original Public API function when
it should be calling the _lkd function by marking the Public API not _lkd
functions as deprecated during the libcoap library build.
[Done by the new COAP_API being defined as __attribute__((deprecated)).]
Work in progress for all the functions that need to be multi-thread safe.
A unique Request-Tag is added to any PUT/POST/FETCH request that contains
a large body. The server is then able to differentiate between concurrent
sending of large data using the same session.
If a server responds with a 4.01 and includes an Echo option, then the libcoap
client retransmits the request adding in the received Echo option with the same
value.
If the server responds normally with an Echo option, then the next request
from the libcoap client (internally added by libcoap) will contain that Echo
option.
It is the responsibility of the server application to add in the Echo
option if required and validate the next request unless the Echo is triggered
by OSCORE (RFC8613 Appendix B.1.2).
doc/module_api_wrap.h: New
Used to split modules into Application and Internal only.
include/coap/*.h:
Module (@defgroup) description put into group application_api or internal_api
as appropriate.
Add in @file information if missing.
src/*.c
Add in @file information.
This change adds 'SPDX-License-Identifier: BSD-2-Clause' [1] to
the source code files that originate in the libcoap project.
Note that not all files are tagged because they are pulled in
from other sources and thus may fall under a different license.
More information about these is contained in the LICENSE file.
[1] https://spdx.org/licenses/BSD-2-Clause.html
The original requesting PDU is now kept with the Observe request along with
its data and used whenever an additional response needs to be generated.
Abstracted information from the requesting PDU is no longer kept in
coap_subscription_t as it can be obtained from the kept PDU.
No longer any need to check for request PDU in request handlers as it is now
always provided.
coap_resource_notify_observers() now ignores the query parameter, as a
cache_key is now used for request matching.