Make coap_pdu-t independent of the header style.
Use C99 sized types when applicable.
Use transaction ids in host byte order in the library.
Make coap_pdu_t payload storage grow on demand.
Add parsing and encoding of PDUs with UDP or TCP style headers.
Adapt examples and unit tests to the new PDU format.
PR #100 has fixed the propagation of elapsed time in coap_pop_next()
which affects the next node in the respective send queue. This fix
is also required for platform POSIX.
As the current develop head does not support the recent API
changes, the platforms Contiki and LwIP cannot be built properly
by Travis (see https://travis-ci.org/obgm/libcoap/). Until this
has been fixed, these platforms are disabled.
The SSL lib used to implement DTLS is only used internally
by libcoap, so it is not necessary and sometimes harmful to
expose it via the pkg-config file. Only when doing static
linking is it necessary to link the SSL lib, this is done
via the "Libs.private: pkg-config directive.
When building outside the source tree compilation fails on
examples, because the libcoap headers expect to be all in the
same directory but coap.h is generated under the build
directory, so it is necessary to add an extra include path
for it.
Also, build directories should always appear before source
directories in the include path, so that any leftover
generated files in the source tree are ignored.
Remember the query string used during the observe request and pass it to the resource handler.
Support partial notification of observers based on the query string.
The signature of several dummy functions that are defined to make
compilers happy that complain on empty modules was not standards
compliant. To avoid related compiler warnings, the formal argument
list of this function now is explicitly declared as void.
The environment variable TLS now controls the DTLS-specific configuration
options. The following values are defined:
no turn off DTLS support
openssl use OpenSSL library
gnutls use GnuTLS library
tinydtls use tinydtls library
Any other value will be mapped to gnutls which is the default.
Commit 5b1a8f67 added two macros LL_SEARCH_PAIR and LL_SEARCH_PAIR2
to utlist.h which is maintained at [1]. To simplify updates of this
file, the macros have been moved into async.c as this is the only
place where they are used. To avoid confusion with linked list macros
from utlist.h, the prefix "LL_" has been removed from the custom
macros.
[1] https://github.com/troydhanson/uthash
With gcc 7.2.0, new compiler warnings related to utlist.h and
uthash.h have occured. Several have been fixed by updating the
header files to the latest version from [1].
[1] https://github.com/troydhanson/uthash
The message id in the CoAP header is used for reliability when
transferring a CoAP PDU over a non-reliable transport protocol
such as UDP. For message de-duplication, it is useful to have
a monotonously increasing number space within a session. Therefore,
the context-global value has been moved to coap_session_t.
The function coap_new_message_id() now takes a coap_session_t
object as its argument.
Not seting that relative time to zero will only (in the pop process) increase the next node relative time with this one.
e.g. if node1->t = 1000 (1 sec), and node2->t = 1000 ( + 1 sec),
after 1 sec, we pop node1 and node2 become first with t = 2000 (as pop will do node2->t += node1->t. But in reality, 1 second already elapsed, so node2->t should be 1000 instead.
In the main of examples/coap-server.c wait_ms was set to
COAP_RESOURCE_CHECK_TIME * 1000, then coap_run_once() was invoked
with parameter timeout_ms as COAP_RESOURCE_CHECK_TIME * wait_ms,
i.e., squaring the resource check time.
This bug has been fixed by removing COAP_RESOURCE_CHECK_TIME from
the call to coap_run_once().
Signed-off-by: Olaf Bergmann <bergmann@tzi.org>
ctags is being used to create the symbol maps for dynamic library
generation. Exported symbols from other platforms such as LWIP
must be excluded from these maps to avoid linker errors for undefined
symbols.
This modification adds the LWIP-specific function coap_socket_send_pdu()
to the exclusion list.
coap-client now prints PDUs that are sent and received in log level
INFO so that these are output with '-v6' or higher. These messages
are now visible without turning on the full debug.
print_content_format() converts numeric Content-Format specifiers
to readable media type names. This change adds the new content
formats from RFC 8152 to this list.
coap_async_state_t now contains a reference to the session that is
associated with the respective async state. As the response must
be sent over this session, the local_if parameter of check_async()
is not used anymore and can be removed.