This adds a unit test to nanocoap that checks that nanocoap's
`coap_parse()` indeed returns `-EBADMSG` when a CoAP Option exceeds the
packet's boundaries. This is relied upon in the option parsing code
at various places by omitting the bounds checking, so we should better
make sure that bounds checking is done correctly here and those
functions can indeed rely upon bounds checking being done correctly
before.
- Do not reply with a reset message to a reset or an ACK message
- Reply with a reset message when not able to process a CON/NON message
(not even a suitable error reply)
The UART API has not spelled out what happens when `uart_init()` is
called twice. This adds precise language that states that
acquire/release semantic is to be expected from the caller. Hence,
a caller needs to call `uart_poweroff()` before reconfiguring the UART
with a second call `uart_init()` for the same UART interface.
In practise, few apps will ever reconfigure the symbol rate. So the
impact is rather low.
However: This API now allows drivers to implement sharing of a serial
peripheral that can provide multiple interfaces (e.g. UART, SPI, I2C,
etc.). It would require some cooperation from the code that does use
the UART to actually release the UART again after each transaction;
something that will only work when RX data is only expected at
known points in time (e.g. in response to a request, or never in case
of TX only stdio). But still, this can mean the difference between
a use case becoming feasible on an MCU with a low number of serial
peripherals or not.
The picolibc shipped in Ubuntu does not provided non-POSIX errnos
by default. If the errno codes are not provided, we can also not
provide corresponding strings.
This guards the effected strings corresponding to non-POSIX errnos
behind `#ifdef`, so that they are only provided when the corresponding
errno is.
This adds the new `nanocoap_server_observe` module that implements the
server side of the CoAP Observe option. It does require cooperation
from the resource handler to work, though.
Co-Authored-By: mguetschow <mikolai.guetschow@tu-dresden.de>
Co-authored-by: benpicco <benpicco@googlemail.com>
This allows sending a separate response with CoAP Options and adds a
helper to detect duplicate requests, so that resource handlers can
repeat their empty ACK on duplicates.
When using gdb-dashboard, GDB by default writes the history in the
folder where `make debug` was executed (e.g. the application folder).
The GDB history will never be useful to upstream, so let's ignore it.