Add state check for BT_ISO_STATE_CONNECTING before disconnecting
the CIS, else we could end up in a race condition where we
did not disconnect the connecting CIS, and then still have
a CIS afterwards.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add a check to see if the ISO is connected before we attempt to
disconnect it. In the case where a stream was not in the streaming
state and was released, the CIS is unlikely to be connected.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When notifying a long (string) value in MCS, each
connection's MTU is taken into account when
(potentially) truncating the notification.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The truncation of the MCS string notifications was incorrect.
As per the MCS specification, the MCS shall send ATT_MTU - 3
if the value cannot fit in the notification.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
net_ipv4_is_ll_addr() did not use a proper subnet mask to filter first
two bytes, therefore it could lead to incorrect results. This commit
fixes it.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
According to RFC3927, hosts with only IPv4 LL address should still be
able to send packets to destination w/o IPv4 LL address:
A host with an IPv4 Link-Local address may send to a destination
which does not have an IPv4 Link-Local address. If the host is not
multi-homed, the procedure is simple and unambiguous: Using ARP and
forwarding directly to on-link destinations is the default route
This behaviour however was not possible with Zephyr, which only allowed
to use IPv4 LL source address for IPv4 LL destinations.
Fix this, by introducing a final fallback (only if IPv4 autoconf is
enabled), to select IPv4 LL address as a source address if no other
address is available.
Additionally, modify the ARP routine a bit if IPv4 LL address is in use.
There's no really point to forward the packet to gateway if IPv4 LL
address is used, as such addresses are not routable. Instead, try to
find the peer in local network in such case.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This is a variant of XIAO BLE with additional features:
* LSM6DS3TR-C 6D IMU (3D accelerometer and 3D gyroscope),
* PDM microphone.
Since LSM6DS3TR-C is almost the same as LSM6DSL (the former has slightly
higher current consumption than the latter, but the register map looks
exactly the same), add devicetree node with "st,lsm6dsl" compatible.
LSM6DS3TR-C is powered directly by P1.08 pin and I2C pull-ups are also
connected to this IO pin. Add a fixed regulator, which will be always on
for this board, in order be able able to use this IMU out of the box.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
There are 3 SPI interfaces (spi[0-2]) while only 2 I2C
interfaces (i2c[0-1]). Configure spi2 instead of spi0, so that i2c0 (which
conflicts with spi0) can be used for IMU (on XIAO BLE SENSE board variant).
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
A fix to accept valid shell commands of the form `log backend
shell_rtt_backend disable`, i.e. to affect all modules when no modules are
specified.
Signed-off-by: Marco Argiolas <marco.argiolas@ftpsolutions.com.au>
The `fcntl()` call (`zsock_fcntl()`) does not seem to work
properly (specifically with `CONFIG_ARCH_POSIX`). This will
be resolved in subsequent work harmonizing the networking
subsystem and POSIX library.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
Previously, the test was only run for configurations that used
the Newlib C library. However, socketpair runs equally well
under the minimal libc, and picolibc, as well as the native
libc.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
* do not define `read`, `write`, as different symbols
* use `recv`, and `send` as defined by
`CONFIG_NET_SOCKETS_POSIX_NAMES`
* do not specify `(2)` as manual-page sections are
somewhat irrelevant
Note: we use `CONFIG_NET_SOCKETS_POSIX_NAMES` here, and
`CONFIG_POSIX_API` in `samples/` to show that the socketpair
API is available in both configurations.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
Wow, this testsuite was really celebrating some redundancy
before.
While that is sometimes a good thing, it's also sometimes
better to be more concise.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
The `test_socketpair_` prefix was leftover from the old ztest
framework.
It is also redundant, so remove it.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
The declarations of extern test functions were leftover from
the old ztest framework.
They are unnecessary now.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
Looks like some implementors decided not to implement the full set of
PMP range matching modes. Let's rearrange the code so that any of those
modes can be disabled.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Let's honor CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT even for kernel
stacks. This saves one global PMP slot when creating the guard area for
the IRQ stack, and some hw implementations might require that anyway.
With this changes, arch_mem_domain_max_partitions_get() becomes much
more reliable and tests/kernel/mem_protect is more likely to pass even
with the stack guard enabled.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Bluetooth SIG published at
https://www.bluetooth.com/specifications/assigned-numbers/ the Assigned
Numbers Document that contains normative list of 16-bit UUID.
Missing 16-bit UUIDs for GATT Services, GATT Descriptors and GATT
Characteristics added to uuid.h according to the revision 2023-02-13
of the document.
Signed-off-by: Alexander Chudov <chudov@gmail.com>
Fixes spi_nor_erase to return -EINVAL instead of -ENODEV
when erase requested is out of flash range.
This makes the SPI NOR return the same error as all other errors.
Fixes#54897
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
() This makes the stack for both consumer and producer threads
larger to avoid stack corruption and overflow.
() Limit to 1 CPU to preserve ordering of output for twister.
() Remove the platform_exclude as they are passing now.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Currently, if CONFIG_SLIP_TAP is enabled (default for QEMU), and no
other Ethernet driver is enabled, the following warning is printed by
CMake:
No SOURCES given to Zephyr library: drivers__ethernet
This happens because SLIP_TAP enabled Ethernet L2, but has no actual
sources in drivers/ethernet. This commit fixes this, by moving the
actual definition of the SLIP TAP Ethernet interface into a separate
file, within drivers/ethernet. Technically, in that configuration SLIP
defines a Ethernet device, implementing Ethernet API, so such a change
is justifiable, and prevents unwanted warning from being generated.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
In commit 31e0d86484, the stack size
was unjustifiably changed from a base of *768*
(plus a configurable extra stack size) to *2048*.
This change broke our sample tests for one of our products, which has
less available memory for the threads' stacks.
The stack size is dropped to *1024* to align with the stack sizes
specified in the other samples, which were changed in commit
31e0d86484.
Signed-off-by: Saku Rautio (Ext) <saku.rautio@nordicsemi.no>
linear_range_get_win_index does not behave correctly when the
window of values is above the linear range. It reports
-ERANGE (partial intersection) instead of -EINVAL.
Extra conditions added for edge cases and tests cases updated.
Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
Add a DSB before doing WFE in cpu_sleep(), to ensure the
memory transactions are complete.
Add a note clarifying a dependency for the existing solution
(dependency is satisfied by ARCH code but is good to state
clearly).
Relates to commit f1264b7e47 ("drivers: entropy: nrf5: add
docs and a DSB in get_entropy_isr").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Stop counting errors as failures and report them as is. This fixes
issues with counting when retrying failures and errors.
We have been adding errors to failures and then double count them when
displaying information on the screen instead of keep an accurate count
in the counter class.
This is now fixed and we do report errors seperately, ie. build errors.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Some tests may be unstable because of missing data from BTP frames.
Enabling Flow Control fixes the issue, but seems to work reliably
only along with UARTE.
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
Updates EDTT to newest version and adds the new test cases
Update _controller_tests_inner.sh to support using packet inspection
and the new low-level device feature in EDTT
Build configs for the BSim test apps updated to support extended
advertising
Signed-off-by: Troels Nilsson <trnn@demant.com>
When compiler is more strict it triggers a warning that
'swap' argument is not used in arch_isr_direct_footer().
Adding ARG_UNUSED.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
We need to make sure the user_data of the network buffer has enough room to
store the L2CAP metadata.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Since we accept buffers from external sources in L2CAP, we need to make
sure that we have enough room in user data to store the metadata necessary
for fragmentation over the HCI link.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
In file `include/zephyr/bluetooth/crypto.h` update the documentation for
the parameters related to the Additional Authentificated Data `aad` and
`aad_len` of functions `bt_ccm_decrypt` and `bt_ccm_encrypt`. It was using
the term `Additional input data`, it has been replaced by the term used in
the RFC linked in the functions description, `Additional authenticated
data`.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>