In 82d8f09de1
the bt_conn_foreach prototype was changed, but these unit tests
kept using the old prototype which leads to a build warning.
Let's fix the prototype in the tests.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This is shorthand for random static addresses. It's similar to
`bt_addr_le_from_str`, but is a macro that results in an object literal,
making it more versatile and less verbose.
This macro only gives access to the first 255 random static addresses,
but this ought to be enough addresses for testing.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
This ensures that enabling BT_CTLR_DTM does not break the compilation of
the Bluetooth shell.
Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
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>
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>
Added helper functions to set and get broadcast name
for codec capabilities and codec configs.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
If we get an error/rejection from the CAP acceptor when
performing the Unicast Audio Start or Stop procedure then
we need to abort the procedure and let the application determine
what the next step is.
This change triggered a corner case when connecting to multiple
CAP acceptors as the CAP initiatior. This was also fixed as part
of this.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Changed dependency of the BT_BAP_SCAN_DELEGATOR to GATT_DYNAMIC_DB
from 'select' to 'depends on' and solved all loop dependencies
caused by this change.
Fixes#79108
Signed-off-by: Babak Arisian <bbaa@demant.com>
The own_addr_type used for various HCI commands sometimes
had a BT_HCI_OWN_ADDR_* type value or a BT_ADDR_* type
value. Those are 2 different value spaces, and if the public
address types would ever change, it would start have incorrect
behavior.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add support for building and running the BT tester on the
nrf5340_audio_dk.
This is copying the configuration used for the nRF5340 DK.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This makes sure we always fit all configurations. Worst case is two
audio streams in 48_6 configuration in single ISO channel (2x155).
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
For now this seems to be required by PTS as there is not Upper Tester
action for this in Test Specification.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Add a test that checks behavior of
CONFIG_BT_CONN_CHECK_NULL_BEFORE_CREATE Kconfig option.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
It's more common (and more readable) convention to use lower-case
names for string-based device tree property values. Convert the HCI bus
and quirks to follow this convention. Also take advantage of the
recently added support for string-array enums to enforce that the
correct values are used.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Add unit tests of the CCID functions.
To support these new tests, the GATT mocks need to
support dynamic GATT DB so we can add and remove
a service that contains CCIDs.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This change makes sure that when a call to `bt_id_set_scan_own_addr` is
sucessful, i.e., the return value is 0, the `own_addr_type` will
be set by the `bt_id_set_scan_own_addr`.
Not setting the `own_addr_type` in a successful call to
`bt_id_set_scan_own_addr` causes, for example,
the `start_le_scan_ext` method in `scan.c` to use an
uninitialized `own_addr_type`.
Eventually this results in an unexpected failure further down in
`start_le_scan_ext`, when sending HCI command to controller with
an uninitialized `own_addr_type`.
Signed-off-by: Erik Sandgren <erik.sandgren@nordicsemi.no>
Modify the GAP connect to use 30ms. The default parameters
typically ended up with 50ms which is OK in most cases,
but for ISO related test cases, using an ACL interval that
is a multiple of the ISO SDU interval (7.5/10ms) generally
provides better stability. 30ms is the lowest multiple
of both 7.5 and 10ms, and was thus chosen.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
If the Broadcast ID is initially set to 0x000000,
which is valid, comparison logic on add of an
actual Broadcast ID of 0x000000 fails.
Likewise for SID.
Moving INVALID_BROADCAST_ID define to bap.h
Signed-off-by: Lars Knudsen <LAKD@demant.com>
Fix of the subnet bridging table function to only
compact the table if elements has been removed, and
fixing the compact function to compact the table if
several elemnts has been removed at the same time.
Fixes zephyrproject-rtos#78794
Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
The host-based adv auto-resume function has both a problematic
implementation and disagreement in the community around how it should
behave. See the issue linked resolved below for details.
This patch makes the deprecation visible to the user. The user will be
better served by a auto-resume tailored their applications use case,
based on more primitive host API like `conn_cb.recycled`, which has
obvious behavior that is unlikely to change.
Resolves: https://github.com/zephyrproject-rtos/zephyr/issues/72567
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Disable CDC ACM logging in configuraton overlay used in test case
bluetooth.shell.cdc_acm.
The build warning was introduced by the commit e8c4867806
("usb: cdc_acm: disable logging if used for shell with logging")
to preven recursive logging when using the CDC ACM UART as shell or
logging backend
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Adds a semaphor to make sure the stream has properly been stopped by the
controller before returning from btp_bap_broadcast_source_stop.
Signed-off-by: Frode van der Meeren <frode.vandermeeren@nordicsemi.no>
Makes it easier to make sure the CS test code is removed if desired.
It should hopefully allow for a clean split in general.
Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
The QoS structure is not related to a codec, but rather a
stream, and should thus not use the "Codec" name.
The BAP and ASCS specs refer to the QoS as
"QoS configuration" several places, so it is an obvious
choice for a name.
Since the structure is defined and used by BAP, the prefix
was changed from bt_audio to bt_bap.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
TBS registration was changed from static to dynamic
and the BT Tester application need to be updated to use
the dynamic registration.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
If a connection update (from central) overlaps a peripheral initiated
conneection param request, then central rejects peripheral request
and continues central procedure. This lead to an assert in peripheral
On instant there would not be an rx_node for notification, as this
would have been discarded by the reception of the REJECT.
This fix ensures that once an rx_node has been 'accepted' for retention
it will not be discarded/overwritten by future rx_nodes
The test will trigger the assert without the fix in.
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Removes duplicate declaration of the bridging direction, keeping the
one in the public header file.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Adds the `bt_mesh_brg_cfg` prefix to the public Subnet Bridge API, and
aligns the function and callback naming with the rest of the Bluetooth
Mesh API.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Add more parameter checking for the unittests for the
CAP procedure 'broadcast reception stop'
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
The unicast_stop function is changed to primarily do a
BAP disable instead of a release, with optional
support for releasing the streams once they have been disabled.
This also adds unittests for the procedure which also
allow us to remove the invalid param testing from the BSIM tests.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Increasing the number of max tx segments to be able to fit composition
page 0 into composition data status message.
After the subnet bridge config client and server are added to the
tester, the size needed to report composition data page 0 increased.
Current behaviour of the tester is correct, dropping the element when
there is not enough space in data field, however the PTS application
does not handle the composition data status message without element.
Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
Added support for dynamic registration and unregistration of the
Broadcast Audio Scan Service (BASS) within the scan delegator.
This enables both scan delegator and BASS to be registered or
unregistered dynamically at runtime.
Signed-off-by: Babak Arisian <bbaa@demant.com>
This commit makes the device tree configuration decide
which link layer is compiled in. We do this to avoid
hard-to-understand linker errors referencing device tree nodes.
The following configuration creates a difficult to parse
linker error:
* BT_LL_CHOICE contains multiple entries, BT_LL_SW_SPLIT
is selected.
* Each BT_LL_CHOICE has its own unique device tree node with its
own "compatible".
* Only one of the link layer device tree nodes has status "okay",
but not the one corresponding to BT_LL_SW_SPLIT.
The linker error indicates that code using the HCI driver fails
to link with the controller. This because the HCI driver device
tree node references the link layer selected in devicetree which
is not compiled in.
By adding a dependendency to the device tree node, this can no longer
happen. Instead, if BT_LL_SW_SPLIT is now selected in a configuration
file, a Kconfig warning will be issued:
```
warning: The choice symbol BT_LL_SW_SPLIT
(defined at subsys/bluetooth/controller/Kconfig:129) was
selected (set =y), but BT_LL_SOFTDEVICE (defined at
/home/ruge/ncs/nrf/subsys/bluetooth/controller/Kconfig:11)
ended up as the choice selection.
```
This should be easier to understand than:
```
...(hci_core.c.obj):(.data.bt_dev+0x16c):
undefined reference to `__device_dts_ord_132'
```
After this commit we should consider getting rid of link layer
selection from Kconfig completely as the link layer is in practice
selected through device tree.
Unit tests have been updated to satisfy the dts dependency.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
native_posix is now deprecated.
Building these tests in both native_sim and native_posix does not
improve coverage for the tests or subsystem but doubles CI time.
As anyhow native_posix will be removed all together in
2 releases, let's remove it already for these.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
native_posix is now deprecated.
Building this sample in both native_sim and native_posix does not
improve coverage for the sample or subsystem but doubles CI time.
As anyhow native_posix will be removed all together in
2 releases, let's remove it already for this sample.
Also let's remove a few redundant test platform filters
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Added helper functions to set and get assisted listening
stream values for codec capabilities and codec configs.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
BAP mandates support for bondable mode for all central and
peripheral roles.
Due to Kconfig circular dependencies, some additional
Kconfig changes had to be made.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Rename the volume flag field from the generic "flags"
to "vol_flags" as the generic "flags" will be used for
other values in a future commit.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Removed deprecated native_posix as test platform.
Added unique sim_ids for tests with the psa as a overlay.
Fixed clang-format issues.
Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
When a message with invalid parameters is received, we must ignore it.
In this commit we check invalid parameters first.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>