If send() fails, we have not technically send the CoAP retry yet, so
restore the same pending structure, so our timeouts and retry counters
stay the same.
This will trigger a retry next time the poll() return POLLOUT, so we
know that we can send.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Refactor the CoAP retry handling into the handle_poll() function,
so that we only try to send retries if the socket reports POLLOUT.
Also move the receiving into same loop, so when poll() reports POLLIN
we recv() the message and handle it before proceeding to other sockets.
Also fix tests to handle POLLOUT flag and add support for testing
multiple clients.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
When transmission of first request fails, reset the internal request
buffer as there is no ongoing CoAP transaction.
Application can deal with the failure.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
If POSIX_API is not configured the close function is not available.
Use zsock_close instead.
Signed-off-by: Andreas Huber <andreas.huber@ch.sauter-bc.com>
Add TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 to the list for use with x509
certificates. The LWM2M v1.1 specification says that a LWM2M client
which used X509 certificates must support this ciphersuite and
additional ciphersuites may be supported.
Signed-off-by: Jeroen Broersen <jbroersen@interact.nl>
The MCUmgr statistics only work correctly when selecting
MCUMGR_SMP_LEGACY_RC_BEHAVIOUR option. Checks the option
flag on the stat_mgmt_list and fix the behavior.
Fixes: 80476
Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
This header requires bluetooth.h but was not including it itself.
Due to this we had 2 tests failing to build.
Let's just include the dependencies to this header instead of
relaying on users including the dependencies dependencies in
the right order.
Also, let's add an include guard as in a test this header was
included twice leading to weird build errors.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The second condition needs to check ARP probes only
The ACD is not properly implemented as described in RFC5227 ch. 2.1.1
The implementation incorrectly detects an IP conflict, if an ARP request
is received for the target IP.
The reason is that the current implementation checks for ARP requests
instead of ARP probes.
Signed-off-by: Andreas Huber <andreas.huber@ch.sauter-bc.com>
This resolves some addressed comments in this PR
https://github.com/zephyrproject-rtos/zephyr/pull/77930
It adds as well a section in the documentation about some
recommendations to increase ZMS performance.
Signed-off-by: Riadh Ghaddab <rghaddab@baylibre.com>
Fix compile error when BT_CTLR_PRIVACY is disabled. Compile
error seen building hci_uart sample for nrf54l15dk.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix incorrect use of BIS indices to dereference the payload
array, instead correctly use synchronised stream indices.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix discrepancy in reference management between calls to
`bt_l2cap_chan_ops.recv` when the application returns `-EINPROGRESS`.
There are two call sites, `l2cap_chan_le_recv_sdu` and
`l2cap_chan_le_recv`, that were inconsistent.
`l2cap_chan_le_recv_sdu` moves the reference, and this patch updates
`l2cap_chan_le_recv` to do the same.
This behavior is also now documented.
This bug has existed since the introduction of this feature in
3151d26572.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
This allows to build the shell with BT_CTLR_DTM and/or BT_CTLR_ADV_EXT
enabled.
The issues has been introduced by commit
bf897cf941 (Bluetooth: Shell: Restructure
shell files).
Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
Before this patch, any unexpected socket error during poll (caused by
LTE disconnects for instance) would lead to a infinite loop because the
error state was never cleared, handled or even signaled to the user.
Signed-off-by: Benjamin Lindqvist <benjamin@eub.se>
The cache_size and lookahead_size are set at compile time using the
CONFIG_FS_LITTLEFS_CACHE_SIZE and CONFIG_FS_LITTLEFS_LOOKAHEAD_SIZE values
from Kconfig, or from the cache-size and lookahead-size properties in a
'zephyr,fstab,littlefs' compatible in the devicetree. Those values are
also used to statically allocate buffers that are pointed at by the
read_buffer, prog_buffer, and lookahead_buffer members of the lfs_config
structure.
At runtime, when using a block device, the cache_size and lookahead_size
are updated to be multiples of the underlying block device's block_size,
which may make them bigger than the original size used to allocate the
static buffers. Log an error and fail the operation when this occurs.
Signed-off-by: Phil Hindman <phindman@xes-inc.com>
Added check where stream_flash_erase_page checks if requested
offset is actually within stream flash designated area.
Fixes#79800
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Removed the LE Audio specific definition and instead
refer to the value defined by iso.h as it is ISO/Core
that defines this size, and not BAP/Audio.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The bis_iso_qos.rx was missing in param sent in bt_iso_big_sync
Also, MSE = 0 is valid (fixed error check)
Signed-off-by: Lars Knudsen <LAKD@demant.com>
The NET_SOCKET_SERVICE_SYNC_DEFINE_STATIC() macro was changed
earlier but the compilation error was missed. Fixing the macro
call.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The value of err was not initialized to 0 prior
to calling shell_strtoul, which only sets err
on actual error.
Signed-off-by: Lars Knudsen <LAKD@demant.com>
As the socket service API is currently used by mutiple applications
(dhcpv4 server, dns, telnet), it should be marked as unstable,
according to the docs:
https://docs.zephyrproject.org/latest/develop/api/api_lifecycle.html
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Removed the generation of broadcast id inside the stack. It is now up
to the application to generate this by itself. The CAP sample has
been modified to allow either a static broadcast, or a random one.
All of this is handled in the application.
Signed-off-by: Fredrik Danebjer <frdn@demant.com>
The 12-bit signed values for the results of PBR are a bit
cumbersome, so this adds a helper function to make it easier to work
with the HCI formatted steps.
Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
Add unit tests for bt_le_cs_step_data_parse.
Also exit early (without calling the function pointer) if the next
step would seem to read out of bounds.
Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
Add a generic function to retrieve any data based on an
assigned numbers type. This function can in theory be
used for any data type, and not just LE Audio types, but
since it relies on bt_audio_data_parse it was made
specificially for LE Audio.
The function can be used in cases where
bt_audio_codec_cfg_get_val, bt_audio_codec_cfg_meta_get_val,
bt_audio_codec_cap_get_val or
bt_audio_codec_cap_meta_get_val (or their derivation)
are not easily applicable due to the type constrainst.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Originally, the net_mgmt task priority is very low. Based on roaming
implementation, roaming is triggered in net_mgmt task. When running UDP
test while doing roaming, the net_mgmt task won't have much chance to
run and roaming can't be triggered.
Increase it to 3, which is same value of supplicant task.
Signed-off-by: Hui Bai <hui.bai@nxp.com>
Added new ops and events in glue layer to support roaming.
Added new flag WIFI_NM_WPA_SUPPLICANT_ROAMING to control roaming
feature.
Signed-off-by: Hui Bai <hui.bai@nxp.com>
ZMS is the abreviation of Zephyr Memory Storage.
It is a storage developed to target especially the non erasable devices.
The new memory storage system inherit from the NVS storage multiple
features and introduce new ones :
* Inherited features :
- light key-value based storage
- cache for entries
- Wear Leveling of flash memory
- Resilience to power failures
* New features :
- cycle counter for non erasable devices (instead of erase emulation)
- Keys up to 32-bit
- Built-in support of CRC32 for data
- Small size data (<= 8 bytes) integrated within entries
Signed-off-by: Riadh Ghaddab <rghaddab@baylibre.com>
Introduces the concept of ll_scan_aux_chain, that allows for
keeping track of several advertising chains with a minimal
overhead. This replaces using several scan aux sets each with
an associated ticker IDs
Only one ticker is used for following chains; This is achieved
by having the scheduled chains in a sorted list and restarting
the ticker when the first in the list expires
EVENT_DONE_EXTRA_TYPE_SCAN_AUX now includes a pointer to the lll
structure to identify which chain to flush (to avoid race
conditions)
New implementation is hidden behind a config for now (defaults
to off): BT_CTLR_SCAN_AUX_USE_CHAINS
Other minor changes:
- rx_incomplete node pointer was moved to ll_sync_set
- data_len removed from ll_sync_set (it uses the chains instead)
Signed-off-by: Troels Nilsson <trnn@demant.com>
This option allows using the pm_policy_latency* APIs to gather latency
requirements on systems that do not support PM (e.g. systems whithout
CPU idle states). Because the API has a subscription mechanism, it can
be useful to perform system-level adjustments based on latency
requirements gathered from multiple system components.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
policy.c has grown organically, it contained many independent pieces of
code. This patch splits each logical unit into its own C file, making it
easier to browse the code.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
The return values were not correct, and the parameters descriptions
were not too easy to understand.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>