Add early_disconnect test cases for iso/cis and l2cap/stress
to test the bluetooth stack handling of disconnects
while transmit is still in progress.
Signed-off-by: Mike J. Chen <mjchen@google.com>
Add a common function, start_broadcast_adv, to start
broadcast advertisement in the LE Audio BSIM tests.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
These tests have some sort of simple host implementation, which reuses the
bt_hci_cmd_create() API name, but the implementation is actually local and
something that can be made static. Change the function to be static and
rename it to be more in line with other internal functions.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Enable testing periodic advertising chains on nrf54l15bsim
target to cover the Controller's use of single timer for
packet and tIFS switching.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Enable privacy peripheral test for nRF5340.
After fixing scan interval, the test started passing on nRF5340 as well.
Enable it for regressions.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
The scan interval must match scan window to start next scanning after
previous window completes. Otherwise, one of advertisements may be
missed and test will fail because it will think that RPA rotation didn't
happen in time.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This is an X86 specific option and should not appear as generic debug
option.
Fixeszephyrproject-rtos/zephyr#52929
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Adds a new abstract struct for unicast group that is
specific for CAP. The difference between this and the BAP
unicast group, is that the parameters are CAP streams and
thus ensuring that the streams in the group adhere to the
additional requirements that CAP has on top of BAP.
This also adds foreach functions for both CAP and BAP
to allow users to iterate on the streams in the
abstract groups.
Various samples, modules and tests have been updated
to use the CAP struct and API.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The is_valid_gap_packet_len check for
btp_gap_ev_periodic_transfer_received_ev referenced a field
that was recently removed.
Modify the check to just check the size, as the event now
has not variable length fields.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The bt_csip_set_member_register kept a counter that was not
decreased when bt_csip_set_member_unregister was called.
This meant that we could register and unregister CSIS,
but we could not re-register once it had been unregistered.
This commit fixes this by removing the counter and instead
rely on the service instance state, which also requires restoring
the original service definition, as well as adding a test that would
have failed with the previous version.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit splits the CAP and GMAP audio configuration (AC)
tests into separate scripts. The purpose of this is to reduce
the runtime of the individual scripts (some, like the cap_ac_11,
tests takes a long time to run all combinations).
This split also improves support for running them in parallel.
An additional, positive, side effect of this is that the logs will
also be smaller per run.
The new scripts can be run directly, or via the e.g. _cap_ac_X.sh
scripts that run entire audio configuration for all presets.
The design of how the parameters are passed around, are based
on variable instead of function arguments. Effectively they can
be used for the same thing, but variables have the advantage
that it is easier to deal with longer names,
and that any of the test scripts can be called with additional
arguments that can, when using variables, easily be forwarded
to the call to Execute for the PHY in the
_ac_common.sh.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
As TinyCrypt gets deprecated, we need to remove all bsim tests that use
it. This commit switches all Bluetooth mesh bsim tests to PSA as a
default crypto backend.
This includes:
- removing `CONFIG_BT_MESH_USES_TINYCRYPT` as PSA is default crypto
backend for mesh. `CONFIG_BT_MESH_USES_MBEDTLS_PSA` is not required to
be enabled;
- merging `overlay_psa.conf` into `prj.conf` as this configuration
becomes default for all mesh bsim tests;
- merging `overlay_ss.conf` into `overlay_pst.conf` as secure storage is
required for running persistent storage bsim tests with PSA;
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This is a preparation commit for switching all bsim tests to PSA as
TinyCrypt will be removed soon.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Commit adds mesh bsim test to check adv pool memory leakage
after mesh has been suspended.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
For the control point operations, add/modify/
remove source, callbacks are added so that Application
can decide whether to accept/reject the control point
operations.
Signed-off-by: Nithin Ramesh Myliattil <niym@demant.com>
After https://github.com/zephyrproject-rtos/zephyr/pull/72090,
`conn_tx_alloc` no longer blocks, and each buffer always has a
corresponding `bt_conn_tx` object. This eliminates the need to configure
the number of `bt_conn_tx` objects via `CONFIG_BT_CONN_TX_MAX`, since
every buffer now carries its own context even when no callback is used.
This commit deprecates `CONFIG_BT_CONN_TX_MAX` as it is no longer
necessary. Instead, `CONFIG_BT_BUF_ACL_TX_COUNT` is used to allocate
`bt_conn_tx` objects for outgoing ACL data. ZLL already uses
`CONFIG_BT_BUF_ACL_TX_COUNT` to configure the number of outgoing ACL
packets. With this change, modifying the packet count will automatically
adjust the number of corresponding contexts, preventing both context
starvatoin and underutilization.
This approach also aligns with ISO, where the number of `bt_conn_tx`
objects for outgoing ISOdata matches `CONFIG_BT_ISO_TX_BUF_COUNT`.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Expand the CAP broadcast reception test to also run with
multiple acceptors to better verify correctness in the
procedures.
For this to run more stable, the maximum number of streams
has been reduce to 2, rather than
CONFIG_BT_BAP_BROADCAST_SRC_STREAM_COUNT.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Some OpenThread logs were moved from L2 to the OpenThread module,
so enable logging from there to keep previous logging visibility.
Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
Increase scan aux sets to support interleaved extended
advertising reception in hci_ipc ISO support configuration
in nRF5340 HCI ISO Controller.
CONFIG_BT_MAX_CONN is reduced accordingly as ticker node
instances are shared across all state/role scheduling in the
Controller implementation.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The BT Tester will not provide the opcode in the case of a
BTP error. To help log this for developers, we store the
opcode of the currently outstanding command, so that we can
log it.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The bt_csip_set_member_get_sirk function is superseded by
bt_csip_set_member_get_info and uses of it has been replaced.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Updates the includes in a a few files to
avoid including unused header files and include the
ones that are used.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Update the Bluetooth tests to assume the new H:4 encoding for data that's
passing between HCI drivers and their users (normally the host stack).
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
When creating a broadcast source with
bt_cap_initiator_broadcast_audio_create there was no check if
all broadcast sources were already allocated, which could cause
a NULL pointer dereference.
Add a check, a test and documentation about possibly
error codes of the function.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Commit extends the communication test between the LPN and
the third mesh device by checking that LPN and the third mesh
device can exchange data normally after friendship termination.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Bad Broadcast Code in BASS/Scan Delegator if BIG_Encryption
field value = 0x03 (Bad_Code), Bad_Code shall be set to the
value 0xFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF according to BASS v1.0.1
Signed-off-by: Gudipudi Ramana Kumar <gudipudiramanakumar@gmail.com>
Bluetooth had two public types with similar name _bt_gatt_ccc and
bt_gatt_ccc, but for absolutely different purposes.
That caused misunderstanding of relationship of them and cases
where to use which one.
Commit changes name of _bt_gatt_ccc to more suitable by usage and
improves documentation of it.
Additionally, it changes name of BT_GATT_CCC_INITIALIZER
to correspond the type name.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Update `bt_irk_eq` to use `util_memeq` instead of `memcmp` and the
"disconnect" BabbleSim test to use `util_eq` instead of a first
assertion on the size followed by a `memcmp`.
This is done as an example usage of the two new functions.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Add simple helper macro so users can define a CCCD with a write cb
without having to combine BT_GATT_CCC_MANAGED() and
BT_GATT_CCC_INITIALIZER() themselves.
Unlike the changed callback the write callback has a return value
that can be used to reject the write request.
Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
Add a babblesim test of the BT Tester doing a GAP smoke test
connecting 2 BT testers using BTP.
The purpose of this is to further increase the test coverage
of the BT Tester in CI, as it is only being built, and runtime
errors are typically not caught.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Commit fixes bug when corresponding group ID was never
incremented for independent corresponding relationships.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Adds a provision test to check that provisioning bearers are cancelled
when a provisioning link is opened. Modifies the functionality for
receiving unprovisioned beacons to fail the test if a unprovisioned
beacon is received from the current provisionee after a threshold.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Modify stream_rx.c so that the calls to FAIL are guarded
by the newly added valid_rx_cnt.
This helps prevent timing issues, especially with
broadcast, where the first SDU(s) may be delayed from
the application, and thus may be missed/contain errors.
Now it will only treat missing or error SDUs as a FAIL
if we have received a valid SDU. All fails, will still be
logged. We now also log both valid and total count.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Instead of just printing a warning, fail (return != 0 to the shell)
if a test is missing, or a pattern does not match any test.
Also, warn (and return != 0) if no tests are found when SEARCH_PATH
is provided.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
We never got to add any multidevice tests to the UART driver tests.
So let's not try to run that empty set in CI.
(we have some multidevice UART tests for BT).
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
tests/bsim/bluetooth/ll/bis/tests_scripts/broadcast_iso.sh
was split in two in 872b19321f
but for the 54L15 and 5340 it was forgotten in the list of
tests to run.
Let's fix it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The set size can now be dynamically set and notified.
The rank is added as a argument in the case that changing
the set size, also affects the device's rank, as ranks
in a coordinated set needs to be continuous.
The set coordinator implementation has been updated
to support receiving the new set size, and providing
this information to the upper layers.
This commit adds a babblesim test for the new API,
as well as a shell command.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The stack will no longer implicitly set the data path
for ISO channel, and the responsibility for doing that is
now for the upper layers/applications.
This provides additional flexibility for the higher layers
as they can better control the values and timing of the data
path, as well as support removing and even reconfiguring the
data path at will.
This also removes some complexity from the stack.
This commit also fixed a inconsistency in the disconnected
handler. CIS for centrals as well as BIS were still valid
bt_iso_chan channels in the disconnected callback,
but CIS for peripherals were completely cleaned up at this
point. This issue is fixed by moving the disconnected callback
handling to before the code to cleanup the channel for
peripherals.
Since there is a difference in how you remove data paths
depending on the GAP role (central/peripheral), the
iso_info struct type has been expanded to be more
concise of which type of CIS it is.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Instead of re-implementing or assuming that POPCOUNT is available
we now use the generic function from Zephyr.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>