1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-26 15:03:53 +01:00

4538 Commits

Author SHA1 Message Date
Benjamin Valentin
7a5cd93bf7 sys/net/telnet: align API with stdio API 2025-03-13 09:58:48 +01:00
benpicco
a042d66e68
Merge pull request #21283 from carl-tud/native-gardening
cpu/native: Gardening/QoL
2025-03-12 17:54:07 +00:00
Marian Buschsieweke
da0218323b
sys/net/nanocoap: improve coap_build_reply
- The responsibility for handling matching CoAP No-Response Options
  has been split:
    - `coap_build_reply()` only needs to report this and return
      `-ECANCLED`
    - `coap_handle_req()` does generate the empty ACK is needed.
  ==> As a result, writing CoAP request handlers correctly becomes a
      lost easier. Correct error handling to be present is now
      sufficient for correct handling of No-Response options.
  ==> This change is backward compatible with existing code.
- The API doc has been cleaned up and straightened

Co-authored-by: mguetschow <mikolai.guetschow@tu-dresden.de>
2025-03-12 08:56:20 +01:00
Marian Buschsieweke
05289a7d1f
sys/include/net/coap.h: Add COAP_PAYLOAD_MARKER_SIZE
Using a constant is easier than explaining where the magic 1 came from
in size estimations.
2025-03-12 08:33:58 +01:00
carl
90a3f3ffcc cpu/native: docs and descriptive naming 2025-03-11 16:19:39 +01:00
benpicco
1e29887660
Merge pull request #21219 from benpicco/event/periodic_callback
sys/event: add `event_deferred_callback_post()` helper
2025-02-28 12:49:57 +00:00
Marian Buschsieweke
be27eafc4f
sys/net/nanocoap: fix API inconsistency
For in-band signalling that a content format is not valid / present,
the magic number `COAP_FORMAT_NONE` was introduced and the type
`uint16_t` was used. Some APIs however used different in-band signalling
values and types:

- coap_reply_simple(): No signal available, `unsigned int`
- coap_build_reply_header(): negative values, `int`
    (Using `int` would prevent using larger content format numbers on
    8-bit and 16-bit archs, where `int` and `int16_t` have the same
    range.)

This changes the behavior to consistently use `COAP_FORMAT_NONE` as
"no content format" signal and `uint16_t` as type.
2025-02-24 12:05:35 +01:00
Oleg Hahm
4d41dda9a7
Merge pull request #21221 from mguetschow/examples-names-short
examples: shorten subfolders' names
2025-02-21 09:07:48 +00:00
Mikolai Gütschow
9a45c30222
examples: shorten subfolders' names 2025-02-21 09:55:24 +01:00
benpicco
f67055c3b2
Merge pull request #19668 from benpicco/ieee802154_symbol_time_on_demand
ieee802154/submac: calculate symbol time on demand
2025-02-20 12:04:10 +00:00
Benjamin Valentin
73e45dd6ca ieee802154/submac: implement MR-FSK timings 2025-02-20 12:00:00 +01:00
krzysztof-cabaj
a2dfd78b27 treewide: fix double the in doc and comments 2025-02-18 13:25:02 +01:00
Benjamin Valentin
48f66692ef sys/event: add event_deferred_callback_post() helper 2025-02-17 13:04:03 +01:00
Marian Buschsieweke
4de6aa10e9
Merge pull request #21212 from mguetschow/examples-rename-match
treewide: fix example references in docs
2025-02-14 18:44:12 +00:00
Mikolai Gütschow
ca5fe72bf8
treewide: fix example references in docs
adapt to folder structure from #21135
2025-02-14 19:14:22 +01:00
Benjamin Valentin
82e892089e sys/net/gnrc/netif: pktqueue: don't clash with GNRC_NETIF_FLAGS_6LO_HC 2025-02-14 16:48:43 +01:00
krzysztof-cabaj
07c6630f45 sys/ztimer: fix small typo in doc 2025-02-12 14:47:50 +01:00
benpicco
837bc0c5ed
Merge pull request #20428 from cogip/fdcan
can: add CAN FD support to STM32G4 and native architecture
2025-02-10 16:31:39 +00:00
Benjamin Valentin
a886adf611 ieee802154/submac: implement MR-OFDM timings 2025-02-10 14:56:14 +01:00
Marian Buschsieweke
c700ead7e9
sys/suit: include nanocoap.h only when used 2025-02-05 15:09:10 +01:00
Marian Buschsieweke
5b6bac000a
sys/net/nanocoap: drop typedef hack
There is an `typdef void sock_udp_ep_t` hack in `nanocoap.h` that tries
allow using parts of nanocoap without a RIOT network stack.

There is a similar hack to allow it to be used without RIOT at all. This
has been used in the early days during development on Linux directly.
This however has not been tested and left bit rotting.

Both hacks are remove and nanocoap now just depends on sock/udp.h.

In a future cleanup, the CoAP packet parsing and building code of
nanocoap can be separated from the part that does the transmission and
reception of UDP packets. That way, using nanocoap's packet parsing and
building will again be available without using a network stack.

Until then, let's drop the hacks and just depend on a network stack.
2025-02-05 14:56:42 +01:00
Gilles DOFFE
f05fc0c70f can: introduce loop_delay
During the data phase of a FDCAN transmission only one node is
transmitting, all others are receivers. The length of the bus line has
no impact.
When transmitting via pin FDCAN_TX the protocol controller receives the
transmitted data from its local CAN transceiver via pin FDCAN_RX. The
received data is delayed by the CAN transceiver loop delay.
If this delay is greater than TSEG1 (time segment before sample point),
a bit error is detected. Without transceiver delay compensation, the bit
rate in the data phase of a FDCAN frame is limited by the transceiver's
loop delay.

Since this parameter is related to the transceiver used, there cannot be
a default value, and it must be explicitly defined with the
configuration variable CONFIG_FDCAN_DEVICE_TRANSCEIVER_LOOP_DELAY.

Signed-off-by: Gilles DOFFE <gilles.doffe@rtone.fr>
2025-01-29 20:51:23 +01:00
Gilles DOFFE
3c026569f6 can: add CAN FD configuration
Add CAN FD specifities to CAN system library in RIOT:
* 64 bytes payload
* Bit rate switching
* Error State Indicator

Signed-off-by: Gilles DOFFE <gilles.doffe@rtone.fr>
2025-01-29 20:51:23 +01:00
Gilles DOFFE
f6f6f6973c can: introduce typedef can_frame_t
Whole CAN code in RIOT is using 'struct can_frame' to represent a CAN
frame.
However incoming CAN FD support will bring 'struct canfd_frame' to
represent CAN FD frames.
Even if the 'struct canfd_frame' has additional flags and a bigger
payload, it is aligned on 'struct can_frame' and thus they can be
referenced by the same pointers in the code.

As it is impossible to predict which one will be used in RIOT, just
define a new type 'can_frame_t' which will map to the right struct
according to the MCU CAN supported format.

Signed-off-by: Gilles DOFFE <gilles.doffe@rtone.fr>
2025-01-29 20:51:22 +01:00
Benjamin Valentin
3429621911 sys/chunked_ringbuffer: let crb_end_chunk() return size of the chunk 2025-01-29 11:54:08 +01:00
benpicco
139404df35
Merge pull request #21147 from maribu/sys/net/nanocoap/observe
sys/net/nanocoap: Implement Observe (Server-Side)
2025-01-23 15:49:26 +00:00
Marian Buschsieweke
feeb68470f
sys/net/nanocoap: implement observe
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>
2025-01-23 14:25:39 +01:00
Marian Buschsieweke
1c7ba9e055
sys/net/nanocoap: improve separate response handling
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.
2025-01-23 14:25:02 +01:00
Benjamin Valentin
2374b9e2f1 gnrc/ipv6/nib: deprecate CONFIG_GNRC_IPV6_STATIC_LLADDR_IS_FIXED
This should just be the only behavior of CONFIG_GNRC_IPV6_STATIC_LLADDR.
2025-01-23 13:32:45 +01:00
Benjamin Valentin
28016ee416 gnrc/ipv6/nib: make CONFIG_GNRC_IPV6_STATIC_LLADDR_IS_FIXED the default
The auto-increment is very surprising and no actual use-cases for it are known.
2025-01-23 13:32:31 +01:00
Benjamin Valentin
a95bd508a5 gnrc_netif: fix timeout in gnrc_netif_ipv6_wait_for_global_address() 2025-01-16 16:07:40 +01:00
benpicco
6547f144d9
Merge pull request #21125 from maribu/sys/net/gcoap/fix-api-abuse
sys/net/gcoap: get rid of API abuse
2025-01-13 18:43:16 +00:00
Marian Buschsieweke
590ca5d7ff
sys/net/gcoap: get rid of API abuse
Calling `coap_get_token()` and `coap_get_token_length()` on an
(mostly) uninitialized `coap_pkt_t` did work so far due to
implementation details matching the expectations, but this is not
backed up by any API contract.

This fixes the API abuse by introducing and using a new API that does
read a token and token length from a CoAP over UDP packet out of a
buffer. This now provides the behavior expected by the caller and
commits to it via API contract.

Co-authored-by: mguetschow <mikolai.guetschow@tu-dresden.de>
Co-authored-by: benpicco <benpicco@googlemail.com>
2025-01-10 21:31:08 +01:00
Marian Buschsieweke
ade999ab01
Merge pull request #21113 from maribu/sys/ztimer/ztimer_mbox_get_timeout
sys/ztimer: implement ztimer_mbox_get_timeout() and use it to fix race in gnrc_sock_recv()
2025-01-10 15:37:46 +00:00
benpicco
758a92f6f0
Merge pull request #21085 from crasbe/pr/sys/stdio_nimble
sys/stdio_nimble: add version note to README
2025-01-08 08:52:52 +00:00
Oleg Hahm
395bdb83fe sys: net: dns: use Quad resolver
Replaces Google's solver with the Quad9 (https://quad9.net/) ones.
2025-01-03 10:05:46 +01:00
Marian Buschsieweke
eab75888a9
sys/ztimer: implement ztimer_mbox_get_timeout()
This function fetches a message from an mbox, possibly blocking if the
mbox has no message - but with a specified timeout.
2024-12-31 00:35:05 +01:00
crasbe
cafcd010b0 sys/stdio_nimble: move doc from README to header, add version note 2024-12-21 20:57:23 +01:00
benpicco
243ca3114b
Merge pull request #20843 from benpicco/string_writer
sys/string_utils: add string_writer helper
2024-12-20 16:36:09 +00:00
Marian Buschsieweke
4f55461e15
Merge pull request #21096 from benpicco/rtc_mktime-const
sys/rtc_utils: make parameter to `rtc_mktime()` const
2024-12-19 14:29:20 +00:00
Benjamin Valentin
ba0060d3a6 sys/rtc_utils: make parameter to rtc_mktime() const 2024-12-18 22:08:32 +01:00
Benjamin Valentin
309ff95f34 sys/string_utils: add string_writer helper 2024-12-17 12:38:14 +01:00
Marian Buschsieweke
4d44abcc0e
Merge pull request #21073 from benpicco/sys/chunked_ringbuffer-start_discard
sys/chunked_ringbuffer: discard stale chunk when starting a new one
2024-12-14 09:28:14 +00:00
Marian Buschsieweke
ab116ec71c
sys/net/nanocoap: Fix sending bogus separate responses
When module `nanocoap_server_separate` is not used, the functions to
send separate responses are still provided, just in a broken version:
They will send the separate replies from a different endpoint than the
request was received at (even on machines with only one IP address, as
also the source port is randomized).

This changes the behavior to only provide the functions for separate
response when the do work, so that others will detect an invalid
configuration at compile time rather than at run time.

The documentation is duly updated.
2024-12-13 08:40:43 +01:00
Marian Buschsieweke
28753e3509
Merge pull request #21075 from maribu/sys/net/nanocoap/buffer-overflow-separate-response
sys/net/nanocoap: fix buffer overflow in separate response handling
2024-12-12 20:36:55 +00:00
Marian Buschsieweke
6b1279348a
sys/fmt: add scn_buf_hex()
This adds a function to convert a hex string to a byte array.
2024-12-12 14:28:28 +01:00
Marian Buschsieweke
7a738d0e0b
sys/net/nanocoap: fix buffer overflow in separate response handling
When RFC 8974 support (module `nanocoap_token_ext`) is in use, the
request token may be longer than the buffer in the separate response
context is large. This adds a check to not overflow the buffer.

Sadly, this is an API change: Preparing the separate response context
can actually fail, so we need to report this with a return value.

The example application has been adapted to only proceed if the separate
reply context could have been prepared, and rather directly emit a
reset message if the token exceeds the static buffer.

Co-authored-by: benpicco <benpicco@googlemail.com>
2024-12-12 14:28:28 +01:00
Benjamin Valentin
982a2c161a sys/chunked_ringbuffer: discard stale chunk when starting a new one 2024-12-12 11:18:13 +01:00
mguetschow
c80058ee85
Merge pull request #21046 from netd-tud/psa-key-headers
sys/psa_crypto: Update key headers
2024-12-10 13:04:34 +00:00
Armin Wolf
7cabd3ee93 sys/psa_crypto: Split key attributes definitions into separate file
Split key attributes definitions into separate file, together with
some basic support macros and helper functions.

This allows PSA crypto backends to use this definitions without
pulling in all the other type definitions.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
2024-12-05 21:36:02 +01:00