Keep a separate buffer for each request context instead of having a
single common buffer for the entire client context. This allows to
simplify the retransmission logic, as parallel requests will no longer
overwrite the buffer for each other. That way, we can simply retransmit
the packet w/o a need to recreate it, and thus reach to the payload
pointer or callback.
This removes the requirement to keep the payload pointer, provided to
asynchronous coap_client_req() call, valid throughout the exchange
lifetime for simple cases (i.e. no block transfer used). In case of
block transfer, this is unavoidable and needs to be documented.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Use buffers instead of pointers for path and extra options provided in
the struct coap_client_request, so that the library keeps a copy of the
path/options instead of pointers. That way, the library can still work
correctly in case of retransmissions or block transfer in case when the
original path or options were automatic variables that went out of
context.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Define CMUX_HEADER_SIZE macro that is 6 or 7 bytes depending on
MTU.
Remove the previous CMUX_FRAME_SIZE_MAX that was a bit misleading
as it meant only the header size without data and was fixed to 7 bytes.
Redefine new macros CMUX_FRAME_SIZE_MAX and CMUX_FRAME_SIZE_MIN which
are actually frame sizes with data included.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Adds the missing sample.yaml's for building these in CI and with
twister.
Fixes a build issue that came up along the way.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Revert a change that broke the stable API function shell_set_bypass.
This reverts commit 6b876dba1ba61b659b1b2d4c3ccd0ac41bd56027.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Fix overriding the test certificates directory for enterprise mode
when using sysbuild. The override already works as expected without
sysbuild.
Signed-off-by: Triveni Danda <triveni.danda@nordicsemi.no>
mbedtls_ssl_get_peer_cid takes size_t, not socklen_t.
c546c1cad1
changed the type of socklen_t to something that is incompatible with native
offloaded sockets, which caused a compiler error.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
Neighbor Advertisement (NA) messages without a link-layer address option
are now accepted on point-to-point links. See RFC 7066, ch. 2.2.
Signed-off-by: Jani Hirsimäki <jani.hirsimaki@nordicsemi.no>
Extend the save command to allow passing name/val pair to save a
subtree or individual setting to persistent storage.
Resolves zephyrproject-rtos#90407
Co-authored-by: Jamie <40387179+nordicjm@users.noreply.github.com>
Signed-off-by: Rami Saad <rami.saad@morgansolar.com>
Lfs provide lfs_fs_gc function for some time now.
Function allow offloading of expensive block allocation scan.
Introduce lfs_fs_gc via api call fc_gc.
Signed-off-by: Maciej Zagrabski <mzi@trackunit.com>
Set the MOPL of RX and TX to `BT_OBEX_MIN_MTU` when registering OBEX
server.
Set the TX MOPL to `BT_OBEX_MIN_MTU` when sending OBEX connection
request.
Check if the MOPL of client exceeds MTU of transport when server
receives the connection request.
Check if the MOPL of server exceeds MTU of transport when client
receives the connection response.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Split the structure `struct bt_obex` into two parts.
Part 1 `struct bt_obex`, it is the common part and shared by all OBEX
sessions which share the same one transport.
Part 2 `struct bt_obex_server` and `struct bt_obex_client`. The
`struct bt_obex_server` is used to manage the OBEX session of server
role. The `struct bt_obex_client` is used to manage the OBEX session
of client role.
Add function `bt_obex_server_register()` to register the OBEX server
with specific uuid.
Add function `bt_obex_server_unregister()` to unregister the OBEX
server.
Add function `bt_obex_make_uuid()` to make UUID.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The receiving segmented L2CAP data can not be handled properly. Due to
the `struct bt_l2cap_chan_ops::alloc_buf` is NULL, the partial data
will be notified through callback `struct bt_l2cap_chan_ops::recv`.
The GOEP does not consider this issue and handles it as a completed
packet. It causes the L2CAP disconnecting due to the partial packet
cannot be processed by OBEX.
Add a RX pool, and set `struct bt_l2cap_chan_ops::alloc_buf`. The
L2CAP will allocate the buffer from the pool to buff the segmented
data. Only the completed packet will be notified through
`struct bt_l2cap_chan_ops::recv`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
It is possible to add MCUboot header through --pad-header option.
In such cases, the FLASH_LOAD_OFFSET does not point to the beginning of
the slot, but to the beginning of the executable area, thus the check
for the active slot should use ranges instead of exact values.
Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
Automatic advertiser resumption is publicly deprecated since
Zephyr 4.0 [1].
Options and parameters for this behavior have been removed,
and the internal bit flag BT_ADV_PERSIST is now always false.
The behavior it used to configure (to keep advertising after a
connection has been established as long as there are connections
available) has also been removed.
[1] Bluetooth: Deprecate adv auto-resume #73395
Signed-off-by: Christophe Dufaza <chris@openmarl.org>
Automatic advertiser resumption is publicly deprecated since
Zephyr 4.0 [1].
Options and parameters for this behavior have been removed,
as well as all calls to bt_le_adv_resume().
Also remove adv_get_options() whose bt_le_adv_resume()
is the only caller.
[1] Bluetooth: Deprecate adv auto-resume #73395
Signed-off-by: Christophe Dufaza <chris@openmarl.org>
Automatic advertiser resumption is publicly deprecated
since Zephyr 4.0 [1].
Options and parameters for this behavior have been removed.
[1] Bluetooth: Deprecate adv auto-resume #73395
Signed-off-by: Christophe Dufaza <chris@openmarl.org>
Automatic advertiser resumption is publicly deprecated since
Zephyr 4.0 [1].
Options and parameters for this behavior have been removed.
[1] Bluetooth: Deprecate adv auto-resume #73395
Signed-off-by: Christophe Dufaza <chris@openmarl.org>
In bt_conn_unref(), if we remove the last reference to the connection,
we notify listeners that a connection object has been freed
and can be taken, then immediately reuse this freed slot
to resume advertising.
This behavior is source of errors, and automatic advertiser resumption
is publicly deprecated since Zephyr 4.0 [1].
Options and parameters for this behavior have been removed.
[1] Bluetooth: Deprecate adv auto-resume #73395
Signed-off-by: Christophe Dufaza <chris@openmarl.org>
Automatic advertiser resumption is deprecated since Zephyr 4.0 [1].
To maintain the behavior during the deprecation period, internal
transitional symbols were introduced to replace the deprecated ones
in the implementation:
- _BT_LE_ADV_OPT_CONNECTABLE: same option bit
as BT_LE_ADV_OPT_CONNECTABLE (deprecated)
- _BT_LE_ADV_CONN_ONE_TIME: same option bit
as BT_LE_ADV_CONN_ONE_TIME (deprecated)
The only option for connectable advertising is now BT_LE_ADV_OPT_CONN,
whose value is _BT_LE_ADV_OPT_CONNECTABLE|_BT_LE_ADV_OPT_ONE_TIME.
We can assume _BT_LE_ADV_CONN_ONE_TIME is true for connectable
advertisers, and meaningless for non-connectable advertisers.
[1] Bluetooth: Deprecate adv auto-resume #73395
Signed-off-by: Christophe Dufaza <chris@openmarl.org>
Automatic advertiser resumption is deprecated since Zephyr 4.0 [1].
To maintain the behavior during the deprecation period, internal
transitional symbols were introduced to replace the deprecated ones
in the implementation:
- _BT_LE_ADV_OPT_CONNECTABLE: same option bit
as BT_LE_ADV_OPT_CONNECTABLE (deprecated)
- _BT_LE_ADV_CONN_ONE_TIME: same option bit
as BT_LE_ADV_CONN_ONE_TIME (deprecated)
The only option for connectable advertising is now BT_LE_ADV_OPT_CONN,
whose value is _BT_LE_ADV_OPT_CONNECTABLE|_BT_LE_ADV_OPT_ONE_TIME.
We can substitute BT_LE_ADV_OPT_CONN for _BT_LE_ADV_OPT_CONNECTABLE
when testing if an advertising set is connectable.
Note: to fix a ClangFormat warning raised by check_compliance.py,
this commit also includes a formatting change next to the lines
actually edited (subsys/bluetooth/host/id.c:810).
[1] Bluetooth: Deprecate adv auto-resume #73395
Signed-off-by: Christophe Dufaza <chris@openmarl.org>
Offset introduced by https://github.com/zephyrproject-rtos/zephyr/pull/72590 is missing
for write_package_cb call in SWGMGT OBJ this fixes compile issues
by adding the offset parameter
Signed-off-by: Kiril Tzvetanov Goguev <kiril.goguev@voiapp.io>
When an IPV6 message that contains an RDNSS ICMPV6 option with a lifetime
equal to 0 is received, proceed to delete the indicated recursive DNS
servers listed in that option.
Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
Due to the k_pipe rework, references to k_pipe in the SYSVIEW configuration
are now obsolete. This commit removes these references.
Signed-off-by: Måns Ansgariusson <Mansgariusson@gmail.com>
The bt_conn_tx_processor logged connections not in the
connected state as LOG_WRN, but this is a case that is handled
and could occur during regular behavior.
For this reason the log statement was changed to LOG_DBG,
as the developer/user does not need to worry about it.
Also modifies the statement to log the conn->state for
debugging purposes.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Allow passing some context to the shell bypass callback function by
providing a void pointer user data argument.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Implement following responses from 3GPP TS 27.010:
5.4.6.3.8 Non Supported Command Response (NSC)
5.3.3 Disconnected Mode (DM) response
Close DLC when receiving DM response.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
If the disconnect work has not yet run when a connect event is received the
connect event is dropped.
Prevent this behaviour by reorganizing `network_evt_handler()`.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Add SDP discovery handlers for AVRCP CT/TG roles and corresponding
discovery parameters and a common result handling function.
Signed-off-by: Make Shi <make.shi@nxp.com>
Extends the CPU frequency scaling to support SMP for two models.
Model 1: Each CPU/core can have its frequency scaled independently
of the others.
Model 2: All CPUs/cores use the same frequency scaling.
In both models, IPIs are sent from the timer handler to each of the
CPUs to obtain the most up-to-date CPU load information. For the
first model, each CPU sets its next P-state after determining its
load. For the second model, the next P-state is set by the last
CPU/core to determine its load and is based on the CPU/core with the
highest load.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Adds two new CPU frequency scaling policy APIs:
cpu_freq_policy_reset()
cpu_freq_policy_pstate_set()
These new APIs allow the policy to better control and isolate relevant
logic from the rest of the subsystem.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
This allows a project to select where cpu_freq_pstate_set()
gets implemented. The system integrator may choose to use
a default stub, a version implemented by the SOC, or a custom
version implemented by the project.
The existing 'native' SoC version now has its output contain
the string "SoC" while the new stub version has the string
"Stub" in its. This allows a means to differentiate between the
two.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Fix to improve decryption speed. Decryption starts after
payload reception, hence use fastest mode to decrypt PDUs.
nRF54Lx only supports decryption after payload reception,
this implementation was already there in the code.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Reverts relaxed radio packet assignment deadline as it is
too risky and can cause invalid bits be transmitted and/or
cause MIC failures.
Reverts commit 4dbfb22a7e ("Bluetooth: Controller: Relax
radio packet pointer assignment deadline"), and
commit 230df77993 ("Bluetooth: Controller: Relax radio
packet pointer assignment deadline").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add an optional payload callback field to the coap_client_request
structure, allowing the application to provide blocks of payload
interactively during the resource upload, instead of having to provide
entire payload in a single contigunous memory space.
If registered, the CoAP client library will call the payload callback
whenever a new PUT/POST message is being generated (note this is also
true for retransmissions) instead of using the payload pointer/length.
If the payload callback is NULL, then the library operates as usual.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
During block uploads, the server may respond with Block 1 option with
a smaller block size than currently used (so called block size
negotiation). The CoAP client however did not read the Block 1 option
from the response, therefore ignoring the server request to lower the
block size.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This check is totally wrong, min-residency-us and exit-latency-us are
not related to each other at all except that the end of the residency
period occurs when the exit starts, so they are totally orthogonal
values and should not be checking if one is less than the other or
anything like this. Even in the code for the default policy manager,
they are added together, so this check is incompatible / in disagreement
with that code, so it should be removed.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
If there are still bytes in the RX buffer, trigger another
MODEM_PIPE_EVENT_RECEIVE_READY event.
Signed-off-by: Ryan Erickson <ryan.erickson@ezurio.com>
bt_iso_chan_send and bt_iso_chan_send_ts would log
twice for each TX, which is unncessary. LOG_DBG statements
include the function name by default, so the 2nd log
statement was unncessary, and were removed.
Added logging of the ts in bt_iso_chan_send_ts which
would still make it possible to tell the 2 apart,
even if CONFIG_LOG_FUNC_NAME_PREFIX_DBG=n.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix implementation of Broadcast ISO Synchronized Receiver
using single switch timer to consider minimum compare value
requirement.
This fix reduces latencies to setup radio receptions and
fixes an assertion in lll_sync_iso when radio_tmr_start_us()
is checked for latencies.
Relates to commit 5dfc58cff9 ("Bluetooth: Controller: Fix
single switch timer minimum compare value").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Moved the nrf_etr driver from the drive/misc folder into the recently
established driver/debug folder where it is a better fit. Moved the
associated files such as bindings and headers accordingly as well.
Signed-off-by: Karsten Koenig <karsten.koenig@nordicsemi.no>