This commit adds the following tests:
- Simple test for bridging table
- Test bridging table state changes
- Test persistence storage of subnet bridge
- Test IV Index update with subnet bridge
- Test network key removal for subnet bridge
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Adding documentation and function calles for the API's
in Bridge Configuration Client model and Bridge
Configuration Server model.
Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
Any places that checked for GTBS is now always enabled
as GTBS is mandatory to support, and the Kconfig option
was removed.
Also removed a duplicate Kconfig option for TBS,
BT_TBS_SERVICE_COUNT, as it was unused.
The other Kconfig option BT_TBS_BEARER_COUNT is used
instead exclusively to set it if needed.
Since GTBS can now exist alone, it must also
support having its own calls and other values.
This means that the GTBS and TBS instances now share
the same underlying struct.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Replace the boolean values for the BAP Broadcast Assistant
with an atomic value. This prevents a rare, but possible,
race condition.
The busy flag has been replaced with 3 atomic values which
provide better granularity in error handling, and allows for
some concurrent write and read requests.
To describe the new behavior, the return values in the documentation
has been updated, and the error handling in the API
functions has improved.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
If a test was written outside 'app_root' the 'app' path may contain
previous directory ('..') which would lead to the compilation file being
written outside the 'WORK_DIR'.
Fix the issue by checking if the 'app' is inside 'app_root', if it's
not, use the absolute path to the app for creating the 'this_dir'
variable.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Added option to set the ASE count through the bap API, making ASE
configuration runtime available. The upper limit of ASEs are still
bound by the Kconfig options set for ASEs.
Signed-off-by: Fredrik Danebjer <frdn@demant.com>
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Add support for running the audio BSIM tests on the
nrf5340bsim board.
This expands the tests we run in CI.
To support all tests with the hci_ipc sample for the netcore,
it is updated to support a bit more while still fitting on the
netcore on the nRF5340 series.
The behavior of advertisement seems to differ a little bit,
which required the bap_unicast_server_test.c to update how it
restarts advertisements.
Two broadcast tests that are passing on the nRF52 BSIM is also
failing due an assert. This should be investigated at a later
time.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Move the network buffer header file from zephyr/net/buf.h to
zephyr/net_buf.h as the implementation now lives outside of the networking
subsystem.
Add (deprecated) zephyr/net/buf.h header to maintain compatibility with old
file path.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Use fallbacks in codec cfg functions in the BAP broadcast
babblesim tests to avoid unnecessary noise in the logs of
the tests.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The TBS client callbacks are just informative so we
provide the information to multiple listeners.
To support this for the long strings, the function
handle_string_long_read was refactored.
This also allows for multiple users of the TBS client.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When the encrypt state was changed via
bt_bap_scan_delegator_mod_src then we didn't set the bad
broadcast code correctly.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add a bsim test that verifies the behavior when the
assistant provides an incorrect code to the broadcast
sink.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This allows applications to modify the values set by an
existing unicast group, assuming that none of the streams in
the CIG has been connected.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Several BSIM tests did not enable -RealEncryption=1.
Since everything in LE Audio effectively requires encryption,
we should enable it, as we have seen a few tests passing before
that shouldn't, because they didn't set -RealEncryption=1.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Enable central HR peripheral HR samples for nrf54l15bsim.
RealEncryption is BabbleSIM is not enabled as nRF54L port
in Zephyr Controller is not yet supported and the test is
also not using security (SMP pairing).
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add a babblesim test for testing the behavior when providing
an invalid broadcast code as the broadcast sink.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Adds unittests for the CAP Initiator start procedure, simply
verifying that the procedure works as well as
testing invalid parameters.
This also allows us to remove the invalid behavior checks
from the babblesim test implementation.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Added the battery level status char to bas service
as per bas_1.1 spec. Added BSIM test for BAS service
to test the NTF/INDs of BAS characteristics.
Signed-off-by: Nithin Ramesh Myliattil <niym@demant.com>
To make the scanner module more understandable and more streamlined, I
reworked the update mechanism of the scanner. The scanner tracks now the
parameters that were used to enable it and the reason why it is running.
This facilitates state logic and allows other modules to "start the
scanner", altough it is already running.
This is mostly a refactoring and not a functional change.
Added a test to verify the behavior.
Signed-off-by: Jan Müller <jan.mueller@nordicsemi.no>
add to task
Add conn parameter to status/flags callbacks of bt_vcp_vol_rend_cb
to differentiate between remote and local changes.
Signed-off-by: Chang An <chang.an_1@nxp.com>
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
The function interval_to_sync_timeout was copied several places.
Made it into a common function and removed duplicate code
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
The babblesim tests for the CAP acceptor test have been refactored
for improved readability
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
When user_data is not zeroed-out, the API returns an error. Downgrade
the API error to a warning log instead.
Introducing this check (#76489) broke a few PTS tests, as user_data is
not initialized by `net_buf_alloc()`. Doing so is in discussion:
https://github.com/zephyrproject-rtos/zephyr/issues/77088
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
The shell script did not provide -RealEncryption=1 which then never
really did proper encryption, which is the point of the test.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Verifies that we don't leak connection references when the peer goes out
of range whilst we are fragmenting and sending data to the controller.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
This test create a setup where an ISO broadcaster will send fragmented
data and get stopped after sending the first fragment and repeating that
operation multiple time to verify that buffers are not leaked.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
The BAP scan delegator test does not compile when
BT_BAP_BASS_MAX_SUBGROUPS is larger than 1.
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
Convert users of net_buf_put() and net_buf_get() functions to use
non-wrapped putters and getters k_fifo_put() and k_fifo_get().
Special handling of net_bufs in k_fifos is no longer needed after commit
3d306c181f, since these actions are now
atomic regardless of any net_buf fragments.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Some tests have a compile script for that test alone, named
`_compile.sh` or `_build.sh`. These scripts are useful for developers to
avoid compiling the world. But these scripts were not run in the CI.
These scripts were previously not suitable for running in the CI because
would put the artefact in the source directory, but this is no longer
the case, and the CI could run these scripts now.
This commit renames any `<test>/test_scripts/_compile.sh` and
`<test>/test_scripts/_build.sh` to `<test>/compile.sh`. The test runner
in CI will ignores any file named `compile.sh`, so there is no need for
a underscore prefix.
This fits into and extends the hierarchical structure of `compile.sh`
chain that starts at `:/test/bsim/compile.sh`, the CI build script tree.
The newly moved scripts now become a part of the build script tree,
called from a `compile.sh` where a duplicate set of build commands was
before. The sub scripts use `run_in_background` to preserve the
parallelism as it was before this change.
This removes an error-prone duplication and makes the CI test all the
build scripts.
Tests that did not have any compile script are not given one for now.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
The interval and latency for a CIG are set for each direction now,
allowing applications to use e.g. 10ms for sink ASEs and 7.5ms for
source ASEs.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add a test that verifies no resources are leaked when re-assembling L2CAP
PDUs over an unreliable channel (ie. lots of disconnects).
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Implementation to take command-line arguments to set log level in run
time for bsim module. Set default log level if no log level is passed
at runtime
Signed-off-by: Guru Mehar Rachaputi <gurumeharrachaputi@gmail.com>
This test's purpose is to verify we (as a peripheral) don't leak resources
when communicating with multiple centrals that connect and disconnect
intermittently.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Add broadcast support to the CAP initiator sample.
This adds new sample-specific Kconfig options to help
select the right Kconfig options based on whether
unicast, broadcast or both is being used.
This also moves common TX functionality
to cap_initiator_tx to reuse the same TX thread
and functionality.
Finally there is a babblesim implemented for
the broadcast. There is not broadcast support for the
CAP acceptor sample yet, so this test only verifies that we
get the TX complete events from the controller.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify the bt_bap_scan_delegator_add_src to take an address and
a sid instead of a PA sync object, so that the scan delegator
can add a source without syncing to the PA.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Refactors teh BIS bitfield values used for ISO
and BAP.
Previously BIT(1) meant BIS index 1, which was a Zephyr choice
in the early days of ISO, as the BT Core spec did not use
a bitfield for BIS indexes.
Later the BASS specification came along and defined that
BIT(0) meant BIS index 1, which meant that we had to shift BIS
bitfields between BAP and ISO.
This commit refactors the ISO layer to use BIT(0) for Index 1 now,
which means that there is no longer a need for conversion
between the BAP and ISO layers, and that we can use a value
range defined by a BT Core spec (BASS).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix Advertising PDU memory allocation for redundant Periodic
Advertising related PDU allocations. The buffer count
related to Periodic Advertising was included twice.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
find_package() already deals with finding ZEPHYR_BASE, so do not rely on
it being set in ENV, use the variable directly adter find_package() was
called.
Fixes#75387
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This tests shows that there is a problematic buffer configuration.
The host locks up when `CONFIG_BT_BUF_ACL_RX_COUNT` is smaller or equal
to the number of connected peers, and all those peers send an L2CAP PDU
that needs re-assembly at the same time.
Although this seems far-fetched, this bug has been observed in a
real-life situation on actual hardware.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>