Unit test project for bt_le_oob_get_local().
This part of subsys/bluetooth/host/id.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
# Conflicts:
# tests/bluetooth/host/id/CMakeLists.txt
Unit test project for bt_br_oob_get_local().
This part of subsys/bluetooth/host/id.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
Unit test project for bt_id_set_adv_own_addr().
This part of subsys/bluetooth/host/id.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
Unit test project for bt_id_set_scan_own_addr().
This part of subsys/bluetooth/host/id.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
Unit test project for bt_id_set_create_conn_own_addr().
This part of subsys/bluetooth/host/id.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
Unit test project for bt_id_add().
This part of subsys/bluetooth/host/id.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
# Conflicts:
# tests/bluetooth/host/id/CMakeLists.txt
Unit test project for bt_id_adv_random_addr_check().
This part of subsys/bluetooth/host/id.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
Unit test project for bt_id_scan_random_addr_check().
This part of subsys/bluetooth/host/id.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
# Conflicts:
# tests/bluetooth/host/id/CMakeLists.txt
Unit test project for bt_id_set_adv_random_addr().
This part of subsys/bluetooth/host/id.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
Unit test project for bt_id_set_adv_private_addr().
This part of subsys/bluetooth/host/id.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
# Conflicts:
# tests/bluetooth/host/id/mocks/adv.c
# tests/bluetooth/host/id/mocks/adv.h
Unit test project for bt_id_set_private_addr().
This part of subsys/bluetooth/host/id.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
# Conflicts:
# tests/bluetooth/host/id/CMakeLists.txt
Unit test project for bt_lookup_id_addr().
This part of subsys/bluetooth/host/id.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
# Conflicts:
# tests/bluetooth/host/id/CMakeLists.txt
Unit test project for bt_setup_random_id_addr().
This part of subsys/bluetooth/host/id.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
Unit test project for bt_setup_public_id_addr().
This part of subsys/bluetooth/host/id.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
Unit test project for bt_keys_update_usage().
This part of subsys/bluetooth/host/keys.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
Add the ability to change supported contexts in PACS.
Enhance the context command in the shell module to make it configurable.
Signed-off-by: Szymon Czapracki <szymon.czapracki@codecoup.pl>
An LE controller shall no longer support
HCI_Read_Local_Supported_Codecs [v1]
The code in subsys/bluetooth/controller was updated for this
behaviour, and this commit updates the unittest
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
Due to some refactoring the unittests for direction finding
started failing. This commit fixes the failing unittests
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
ASSERT_OK macro is confusing as it accepts additional arguments, but
don't use them. This commit removes the confusion by making ASSERT_OK
macro accept only one argument. An additional macro ASSERT_OK_MSG is
added that mandates a format string that will be printed and optionally
arguments for the format string.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Extend Friend Queue overflow test by overflow with segmented messages:
- when a segmented message is preempted by an unsegmented message;
- when a segmented message is preempted by another segmented message;
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
mesh_shell application has been included recently some set new
abilities that added more functionality for testing.
That caused the application cannot fit in some supported plarforms
like qemu_cortex_m3. The reduced legacy configuration has been
added to fit stack into it. This platform is used in CI.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
If either the sink or source ASE count was zero, calls to
ARRAY_SIZE(srcs) or ARRAY_SIZE(sinks) would cause a build warning.
The arrays should actually not be there at all if the respective
ASE count was 0, as that is just a waste of memory. The arrays,
and all uses of them, have been properly guarded.
This also adds a build assert to ensure that at least one
of them is non-zero, and that we also test building either
of them with the value 0.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix all comments-indentation errors detected by yamllint:
yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \
grep '(comments-indentation)'
This checks that the comment is aligned with the content.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Unit test project for bt_id_read_public_addr().
This part of subsys/bluetooth/host/id.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
Add the ISO packing field when creating a unicast group.
This refactors the structure of the unicast group create,
as it now takes both the packing as a group parameter, as well
as an array of stream-specific parameters.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Clean up occurrences of "#if IS_ENABLED(CONFIG_FOO)" an replace
with classical "#if defined(CONFIG_FOO)".
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This changes HAS registration to be dynamic and let's the
application set Hearing Aid Type and binaural features.
Often, devices are flashed with generic firmware with some
features stored post factory production, requiring
the settings to be moved from compile time to run-time.
This change will increase the RAM usage as the GATT
service is moved from ROM to RAM.
Signed-off-by: Lars Knudsen <larsgk@gmail.com>
Co-author: Soren Engquist <soren@engquist.dk>
Move the functionality that is common between the two
broadcast sink test to a common function.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add API to do the BAP Broadcast Source Metadata update procedure,
which updates the metadata of a broadcast source while
it is streaming.
This is also makes all checks for the "head stream" the same.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Update the default value of BT_MESH_LPN_RECV_DELAY to align with new
lower boundary for legacy advertiser.
Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/53189
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Add support for 3 connections. Mainly we need to support
at least 2 connection to use the CSIP Set Coordinator role,
but some sets may also be 3 or even larger.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The status field is currently a uint32_t even though there are only
3 possible values. Reducing it to a uint8_t allows status to fit in
existing padding in the struct, saving 4 bytes per ticker_user_op
Updated function signatures to match; ticker_op_func left as-is
to avoid having to update a whole bunch of files for no real benefit
Signed-off-by: Troels Nilsson <trnn@demant.com>
Do these things:
- use the proper macros for reserving the SDU header
- make every L2CAP PDU fragment into 3 ACL packets
- set tx data and verify rx matches the pattern
- measure segment pool usage
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
When there are no buffers, it doesn't make sense to repeatedly try to send
the host TX queue.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
For making handle available in vendor sink creation, add ISO handle
to function prototype.
Expose datapath allocation via new ull_iso_datapath_alloc function.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Specification states that: "Only one Client Characteristic Configuration
declaration shall exist in a characteristic definition." This was
wrongly understood as "Ony one CCC can exist in GATT Server". When we
add next characteristic `ccc_added` flag is cleared so next CC can be
added (for this characteristic).
Added array for CCC values so it's no longer shared between CCCs.
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
-- Corrected PDU time stamps to match expected reference anchor point
-- Corrected failing test_rx_unframed_dbl_split according to expected
time stamps.
Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
This commits extracts mesh, gat, gap, l2cap from
bttester.h into corresponding header files for
better readability.
Signed-off-by: Szymon Czapracki <szymon.czapracki@codecoup.pl>
The underlying Kconfig setting NET_BUF_USER_DATA_SIZE is not used anywhere,
so this define is removed here.
Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
Instead of storing the calculated reload value (in conn intervals) in
the conn object, now store the timeout value, and perform calculation
when used. This allows using the timeout value across all CIS's without
having to re-calc and store on change of TO
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Add mayfly locking around the access to the local pending procedure list
as it is accessed by both thread and mayfly.
Fixes#45427
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
Unit test project for bt_keys_find_addr().
This part of subsys/bluetooth/host/keys.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
integration_platforms help us control what get built/executed in CI and
for each PR submitted. They do not filter out platforms, instead they
just minimize the amount of builds/testing for a particular
tests/sample.
Tests still run on all supported platforms when not in integration mode.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Remove the struct bt_vcp pointer from the volume
renderer API, as there is only ever a single
Volume Renderer instance on a device.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Split the `bt_vcp_cb` struct into separate structure for
the volume controller and the volume renderer.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The VCP server, known as the volume renderer, has a
more explicity bt_vcp_vol_rend API naming scheme now.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Remove the bt_vcp_vocs API as it did the same as the
bt_vocs API, and did not really any functionality.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The AICS functionality can be exercised using the
bt_aics API instead. These functions did very little
besides cluttering up the bt_vcp API.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Renames almost all occurences of VCS to VCP, as we want to
use the profile as the namespace for volume control.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Rename vcs.h to vcp.h to better detail what the
file contains, as it is more than just VCS. This also
renames the Kconfig file.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit increases the timeout value for the `bsim_test_multiple`
BSIM test because it may take longer to complete with the
parallelisation enabled due to the context switching overhead and the
overallocation of the CPU cores.
Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
This commit updates the Bluetooth BSIM test compilation script to build
multiple tests simultaneously in order to improve CPU utilisation.
Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
The `bluetooth/common/log.h` and `bluetooth/common/log.c` files have been
removed. Files that were using them have been updated to use
`zephyr/logging/log.h` instead.
Those replacement have been done consequently:
- `/BT_DBG/LOG_DBG/`
- `/BT_ERR/LOG_ERR/`
- `/BT_WARN/LOG_WRN/`
- `/BT_INFO/LOG_INF/`
- `/BT_HEXDUMP_DBG/LOG_HEXDUMP_DBG/`
- `/BT_DBG_OBJ_ID/LOG_DBG_OBJ_ID/`
Also, some files were relying on the `common/log.h` include to include
`zephyr/bluetooth/hci.h`, in those cases the include of `hci.h` has
been added.
For files that were including `common/log.h` but not using any logs,
the include has been removed and not replaced.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
This fixes check whether shell application can be built without CAP
Acceptor Set Member support.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Use the service instance struct instead of the more generic
`bt_csip` for the CSIP set member API.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Renamed remaining structs and functions that are not
for the set coordinator to use the set member CSIP
role name.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Renamed the coordinated set implementation to use the
profile (CSIP) name instead of the service (CSIS) name, as
the former is more general.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
A PR got in after some changes were done to the BT logging system. This
nulls the error by not including the logging framework in this unit test.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Updates the broadcast source API to create subgroups and
to set BIS specific codec configuration
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Unit test project for bt_keys_find_irk().
This part of subsys/bluetooth/host/keys.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
Unit test project for bt_keys_get_type().
This part of subsys/bluetooth/host/keys.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
Increase system clock precision in the test system.
It helps for some events happen in more precise time and
prevents time overlapping between them.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
PR fixes bsim settings backend issue.
Backend looses line if setting name of new line is
the occurence of the any existing lines.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Replace the BT_CTLR_ADVANCED_SCHEDULING_CENTRAL_CONN_SPACING
Kconfig with BT_CTLR_CENTRAL_SPACING to configure the
the spacing from the beginning of a central connection event
to beginning of the next central connection when supporting
multiple simulataneous central connections.
If the BT_CTLR_CENTRAL_SPACING in microseconds is smaller
then the required time reservation for a connection event,
for given maximum data length and PHY in use, then the
calculated time reservation will be used as the spacing
between consecution central connection events.
The change fixes an issue wherein use of old Kconfig with
higher values causes new central connections to be placed
in between already connected central role if there was
free time space available to fit the new connections time
reservation.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Rename BASS to BAP Scan Delegator and BASS Client
to BAP Broadcast Assistant. This is the first step towards
integrating the BASS with the rest of BAP.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Removes the global cur_mcs_inst and replace it
with lookup functionality.
This fixes an issue with bt_mcc_discover_mcs not being able
to be called more than once, as well
as streamline the implementation significantly.
This is also the first step towards not only supporting
multipe MCS instances for a single device, but also a
step towards handling multiple devices.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Two tests were using the same simulation id, causing occasional failures
when all tests were run in parallel
Signed-off-by: Troels Nilsson <trnn@demant.com>
After merging #51809, a few things were spotted that needed tweaking.
Among them:
- Rename the folder from bt_crypto to crypto, since the prefix is
unnecesary
- Remove the include folder
- Remove the path from the global include paths
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Add to the cryptographic toolbox the h8 function, defined in the Bluetooth
Core Vol. 6, part E 1.1.1.
Also add test and SMP self test for this function. The data used for those
are from the Bluetooth Core.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Move functions defined in the Cryptographic toolbox of the Bluetooth
specification inside their own files in the following folder:
`zephyr/subsys/bluetooth/bt_crypto`. The functions were previously
implemented in `zephyr/subsys/bluetooth/host/smp.c`.
The cryptographic toolbox functions can now be accessed from outside of the
host.
In addition to that, tests for each cryptographic toolbox functions have
been added.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Adding support for allowing user extension code to support deferring
anchor point moves. Refactored LLCP only.
Note: This is NOT supported by LEGACY LLCP impl.
KConfig'd by BT_CTLR_USER_CPR_ANCHOR_POINT_MOVE
Modified ll_conn_update API, to accommodate passing offsets
Modified CPR/CU context data structure
Modified CPR/CU procedure to handle anchor point move wait state
Fixed up unit tests, adding anchor point move cases to CPR/CU test
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Add babblesim test for bt_disable which enables bt, starts a connection,
GATT discovers, reads, writes then disables BT in a loop.
Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
The cap test was reusing another test sim_id which
causes trouble at random when tests are parallelized.
Fix it by giving it its own id.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Adding controller support for updating SCA in ACL and ISO peripherals
Adding HCI API support for le_request_peer_sca and complete event.
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Check LE event mask state as well as host controlled feature mask state
and reject CIS request accordingly.
Release pre-allocated ISO resources on rejection of request
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Move the function in the `subsys/testsuite/ztest/src/ztest_mock.c` files.
This is motivated by the fact that there is others re-implementation of
`*printk` functions using libc counterparts in the `ztest_mock.c` file.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
The file `tests/bluetooth/host/keys/bt_keys_get_addr/src/main.c` was using
functions from `tests/bluetooth/host/host_mocks/print_utils.c` which were
exactly the same as the one in `common/log.h`.
The code was duplicated because the test author wanted to include
`common/log.h` to get the stringifying functions, but could not due to
unwanted side-effects.
See the comment from the unit test author here:
https://github.com/zephyrproject-rtos/zephyr/pull/48676#discussion_r973672151
The new `common/bt_str.h` does not have side-effects, so it is
suitable for unit tests.
The `snprintk` function has been redefined inside the `main.c` to use the
libc because of the kernel being not compiled entirely.
Also, the `CONFIG_LOG`, `CONFIG_BT_DEBUG_LOG` and
`CONFIG_TEST_LOGGING_DEFAULTS` have been disabled in the Kconfig files
of each `keys` tests. That so logs are not compiled and so, there is
no need to link the `printk` functions that are used by the logs.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Setting the extended advertiser as default advertiser
to improve both preformence and reliability.
Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
Increase some value for the shell to be more useful when
working with some audio devices.
Also adds debugging for more services and profiles.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
net_buf does not hold strings, it holds counted bytes. Use memcpy to place
data into the buffer during testing rather than strncpy as the latter
generates warnings because the destination will not be nul-terminated.
Signed-off-by: Keith Packard <keithp@keithp.com>
The callback is now called whenever the PA sync is terminated,
even if it was locally terminated. The test case has been
updated to handle that.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Linking fails on ubuntu 22.04 because of multiple definitions of the `fff`
global, which is defined by `DEFINE_FFF_GLOBALS`.
Only define it in the tests' `main.c` instead of the mocks.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
This changes the API to use proper naming convention, as the code has
been moved out of capabilities.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Remove the generic CONFIG_BT_CAP and CONFIG_BT_DEBUG_CAP
and only use Kconfigs specific to the individual roles.
This also includes renaming cap.c to cap_acceptor.c.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The CAP initiator will now discover, or return a
known, CSIS instance included by CAS (if any).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The API will now take a simple bt_conn instead of a
set member struct. This is due to the set member struct
being moved to the stack. The reasoning for this is that
having the struct in the stack, rather than in the
application, the stack itself can initiate the CSIS
discovery which is useful if the remote device
has a service that includes a CSIS.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This is the primary discovery of the CAS on the remote device,
but does not include discovering the (optional) CSIS.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add skeleton for the expected APIs and
implementation. May be subject to change as
implementation progresses.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The sequence number is by the core spec defined as 16-bit.
We had implemented a workaround for the wrapping of the
sequence number, which required the type to be larger
than 16-bit (32-bit).
However, since the definition of the sequence number,
and the use of, is poorly defined by the core spec, we
are reverting this workaround and reducing the sequence
number to 16-bit again. This way it is more in line
with the core spec, as well as more intuitive given the
other uses for the sequence number.
This change moves the responsibility of using the
right value to the upper layers, as the stack can
and will no longer provide any guarantees.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
There should be functional equivalence between these two forms. And the
'_eq'-form is more readable.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Add missed 'zephyr' prefix to files paths while including.
Also, remove that paths from libraries include paths to generate
compilation error if shortened path is used.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
CI tests were failing due to a recent change to zassume_true()
implementation.
While the test case is still skipped when assumption fails, but it is
now causing the final execution result to fail.
zassume_true() was replaced by ztest_test_skip() combined with
a conditional 'if' statement to get the required effect.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
This refactors how the BAP broadcast source handles the
extended and periodic advertising.
First it removes the start and stop of the extended
advertising, and instead expects the application
(or upper layers) to do this.
Second it exposes API functions to get the
necessary advertising data from BAP (service data and
the BASE), which the upper layers will then also
be responsible for setting and updating.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
IUT is requested to send 2 multi-segmented model messages. In mean time,
third may be sent from Config Model Publication Status may be sent,
which is also segmented. One of the 3 messages will fail to be sent,
but test is passing if it is Status one. Let's increase number of
possible concurrent transmissions to allow all three messages to be
sent.
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
Unit test project for bt_foreach_bond().
This part of subsys/bluetooth/host/keys.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
Unit test project for bt_keys_foreach_type().
This part of subsys/bluetooth/host/keys.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
The advertiser runs in a loop, pulling advertising buffers from a queue.
Features covered:
Queue overflow
Sending order
Buffer freeing
Dedicated buffer pools
Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
added `audio start_sine` and `audio stop_sine` to start/stop
sending an LC3 encoded sine tone.
This code is heavily inspired from the sine tone implementation
from the unicast_client sample implementation.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The direction is used to identify the list to append the registered
capabilities. There is no need to keep it in the bt_audio_capabilities,
it can be provided as a function parameter instead.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Some files still manage to get into the tree without the zephyr/ include
prefix (likely because they lack CI coverage).
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Fixed an issue with syncing to multiple BIS as the broadcast
sink in the shell. Also changed a check in the broadcast
sink implementation from an assert to a `if` to provide
a better way of handling bad input.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Alters several provisioning related features to allow commands to be
functional with application defined Provisioning properties &
capabilities.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
Tests will be restructured in a future commit. Temporarily disabled to
partition the changes to allow tests to be a separate PR.
Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
This removes the callbacks from capabilities. The callbacks are used for
unicast server role only, while the capabilities are used for the
broadcast sink role as well. Thus the callbacks can be removed as there
is another bt_audio_unicast_server_cb API that is specific for unicast
server role.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Allow ZEPHYR_MODULES to be specified to support non-west builds
Return the error code when/if a build fails instead of always 0
Signed-off-by: Troels Nilsson <trnn@demant.com>
The commit adds proxy mix advertiser test that checks
mix of transmission between pb gatt, proxy and adv bearers.
The exact test scenario is described in proxy_mixin.sh file.
Additionally, the separate test configuration has been added.
All bsim mesh tests have been implemented not considering that
GATT frames are possible if PB-GATT or GATT Proxy are enabled.
The solution to avoid this misimplementation is to create
the separate configuration for tests with enabled
PB-GATT and GATT Proxy features. The commit adds this as well.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
Adds Kconfig option for the Mesh Shell Health server.
The shell implementation of Health Server test commands is
dependent on the user adding and initializing the shell Health
Server instance in their application to make the commands functional.
To prevent any confussion about how these commands work, a Kconfig
option has been added to allow conditional compilation of these
commands. In this way the user must actively enable this feature, making
the conditional requirements more clear.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
Some tests assume that if IUT accepted HCI_LE_Set_Data_Length command
than HCI_LE_Data_Length_Change event will always be sent. This is not
the case anymore as HCI_LE_Data_Length_Change is sent only if effective
parameters changed.
Those tests should be re-enabled when EDDT implementation is updated.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
LE Write Suggested Default Data Length and LE Set Data Length commands
are suggestions from host and should be validated only as per HCI
specification regarding internal setting of LLCP.
LLCP is allowed to use other values if needed.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
If a device sends an MTU that is bigger than our maximum tx buffer size,
that could cause assertion failures down the line.
This PR limits it to the maximum we support (CONFIG_BT_L2CAP_TX_MTU).
The issue has been observed with a gatt discovery procedure, but is likely
present in other places in att.c.
To reproduce it, we need two zephyr shell devices, with one having a larger
MTU than the other:
- connect
- do data length update to the bigger MTU
- set security to 2, EATT channels get connected
- launch a gatt discovery from the device with the larger MTU
- observe kernel panic on the other device when it attempts to add too much
memory to a net buf.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
The chan_opt field was not set, and on some platforms it ended up with
an invalid value. Explicitly set the field on all GATT parameter structs
and make the discovery params static.
Fixes#50520
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
With introduction of refactored LLCP was also introduced an error
re. calculation of initial slot reservation in connection setups.
Due to this error a bigger slot was reserved, leading to failure due to
connection overlaps in multiple.sh test.
Also the removal of this 'overhead' in slot reservations calls for
bigger time-allowance for l2pcap_stress test.
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Remove the support for caching ASEs on release.
This is mainly due to the 2-stage design in Zephyr: We
have the bt_audio_stream and the bt_audio_ep, where the
the latter represents an ASE in most cases.
However, once the endpoint goes into the codec configured
state, then a stream must be bound to it. This would be fine
(although a stream is technically not established at this point),
except that a stream is also, for unicast, specified for a
specific ACL. Once the ACL disconnects, the stream technically
becomes invalid, and if the stream is invalid, so is the endpoint.
Based on that, there's no reason (or even option) to keep the
endpoint in a codec configured state, as it would not
have a valid stream associated with it.
If we want to support an ASE going into the codec
configured state on ASE release (or ACL disconnect),
the relationsship between ASEs and streams needs to
be redefined.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Uploaded the Bluetooth Launch Studio generated projects and
ICS files. These files can be imported into Bluetooth users
Launch Studio, with their Bluetooth SIG account, and
generate the test plans.
This file provide detailed information in Launch Studio of
the supported Core features, Host Services and Profiles,
and Audio services.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This callback allows use-cases where the SDU is much larger than the l2cap
MPS. The stack will then try to allocate using this callback if specified,
and fall-back on using the buffer's pool (previous behavior).
This way one can define two buffer pools, one with a very large buffer
size, and one with a buffer size >= MPS, and the stack will allocate from
that instead.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
This test reproduces more-or-less #34600.
It has a central that connects to multiple peripherals, opens one l2cap CoC
channel per connection, and transmits a few SDUs largely exceeding the MPS
of the channel.
In this commit, the test doesn't pass, but when it passes (after the
subsequent commits), error and warning messages are expected from the
stack, as this is not the happy path.
We can later debate on whether these particular error messages should be
downgraded to debug.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Add bsim tests to check tx callback behavior for advertiser.
Feature coverage:
TX Complete callback execution
Callback order
Packets are freed before the end callback is called
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Unit test project for bt_buf_get_cmd_complete().
This part of subsys/bluetooth/host/buf.c unit testing
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
Add a Kconfig for Advertising Data Chaining in Extended and
Periodic Advertising, permitting AD data lengths of upto
1650 bytes. The implementation is experimental and needs
further testing.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix BT_CTLR_ADV_DATA_LEN_MAX and other Kconfig dependencies,
and clean up the use of PDU_AC_LL_SIZE_MAX which is used to
allocate scratch packet to be atleast able to accommodate
the minimum 31 bytes AD data such that it is sufficient to
transmit and/or receive scan response PDUs when either
broadcaster or observer alone is supported.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The current implementation of provisioning features is dependent on CDB
to compile, which is reflected poorly in the Kconfig options for mesh.
This commit alters the Kconfig options for provisioning to be dependent
on the CDB option to compile.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.
The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.
NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This PR adds a `*_cli_*` infix to the Config Client API to match
the changes in Health Client. The old API is marked as deprecated.
Signed-off-by: Michal Narajowski <michal.narajowski@codecoup.pl>
Follow-up: #49243, #48732
With the introduction of Kconfig for unit_testing board and setting
ZTEST_NEW_API in testcase.yaml, the need and support of setting this
directly in CMakeLists.txt is obsolete.
Remove the code line.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The board overlays were added to increase the baud rate,
which was useful when scanning when there were many devices.
For that scenario it is probably better to use the
scan filters.
The changed baudrate in the overlays made it harder
to easily switch between e.g. the BT shell and other
applications, as the default baudrate is different, and
you'd need to restablish a connection to the boards UART
to handle the changes.
The other values in the overlays also do not really
provide any advantage to have for just the shell
application.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Regression test for an issue where in cases where sending a buffer over
L2CAP failed, the buffer user data was not restored.
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
Make extended advertiser as deafult advertiser for
general and persistent bsim BLE Mesh tests.
Leave legacy advertiser as default advertiser for
low latency bsim BLE Mesh tests.
The legacy advertiser provides quite poor performance.
Even more, it is not fully compatible with specification
since might spur more frames occasionally then requested.
This is fundamental issue since it cannot stop an advertisement
in exact time. The extended advertiser doesn't have such problem.
However, it is not well tested yet. Since extended advertiser is
not experimental anymore in both controller and host this is
the right time to make ext advertiser as a default in Mesh either.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Re. peripheral phy update procedure: UNKNOWN_RSP from central was not
handled, leading to stall of procedure and subsequent procedure timeout
Proper handle and unit test for case added.
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Added BabbleSim test to reuse the Broadcaster Multiple and
Oberver samples to verify multiple advertising sets and
transmission of Extended Advertising Chain PDU.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Beacon test had trick for extended advertiser. That has been added as
conditional compilation. Additionally, waiting beacon procedure
waits for 1 more second to avoid boundary case since
the extended advertiser is more precisionive.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Extended advertiser has better latency without any delays than legacy one.
If couple of config model commands start sequently then
the first ones are received normally but the next one are transmitted in
parallel with leftover communication (retransmissions) of the previous one.
That causes collisions and broken test despite the functionality itself
is ok. Adding delays between commands solves crossovering tx time.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
mesh extended advertiser is not well tested. As the first step
the mesh babblesim tests should pass on extended advertiser as well
as on legacy advertiser. Minor fix to avoid lpn collisions in
friendship tests with multi lpns.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
The function will be used to update the RSI value. The returned value
can be later used in advertisement data for set identification. This
removes the need of specific bt_csis_advertise function so that the user
can call the API to generate new RSI once needed (e.g. on RPA change).
This allows the user to manage the advertisement data to fit it's needs.
< HCI Command: LE Set Extended Advertising Enable (0x08|0x0039) plen 6
Extended advertising: Disabled (0x00)
Number of sets: 1 (0x01)
Entry 0
Handle: 0x00
Duration: 0 ms (0x00)
Max ext adv events: 0
> HCI Event: Command Complete (0x0e) plen 4
LE Set Extended Advertising Enable (0x08|0x0039) ncmd 1
Status: Success (0x00)
< HCI Command: LE Set Extended Advertising Data (0x08|0x0037) plen 33
Handle: 0x00
Operation: Complete extended advertising data (0x03)
Fragment preference: Minimize fragmentation (0x01)
Data length: 0x1d
Flags: 0x06
LE General Discoverable Mode
BR/EDR Not Supported
Unknown EIR field 0x2e: 16e61d64dc45
Name (complete): audio test shell
> HCI Event: Command Complete (0x0e) plen 4
LE Set Extended Advertising Data (0x08|0x0037) ncmd 1
Status: Success (0x00)
< HCI Command: LE Set Advertising Set Random Address (0x08|0x0035) plen 7
Advertising handle: 0x00
Advertising random address: 4E:21:29:F8:94:93 (Resolvable)
> HCI Event: Command Complete (0x0e) plen 4
LE Set Advertising Set Random Address (0x08|0x0035) ncmd 1
Status: Success (0x00)
< HCI Command: LE Set Extended Advertising Enable (0x08|0x0039) plen 6
Extended advertising: Enabled (0x01)
Number of sets: 1 (0x01)
Entry 0
Handle: 0x00
Duration: 0 ms (0x00)
Max ext adv events: 0
> HCI Event: Command Complete (0x0e) plen 4
LE Set Extended Advertising Enable (0x08|0x0039) ncmd 1
Status: Success (0x00)
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
The bluetooth/controller/ctrl_cte_req wrongly defaulted to old Ztest API
after the introduction of the new unit_testing board.
Enforce use of CONFIG_ZTEST_NEW_API to get test working again.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
With Kconfig support in unittest the bluetooth ctrl_data_length_update
test fails because the symbols being configured are promptless or
disabled because of dependencies.
Add a Kconfig file to make needed symbols visible in unittest mode.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Remove boilerplate code:
> if (NOT BOARD STREQUAL unit_testing)
> message(FATAL_ERROR "This project can only be used with...")
> endif()
as that is now handled by boards.cmake when validating the board.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This adds client support for switching the active preset along with bsim
tests implementation.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
The LE Audio related profiles define specific security requirements that
client have to met to gain access to related characteristics. This
introduces internal wrapper API for GATT characteristics and CCC
descriptors to ensure the security.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Setting the new LLCP as default exposed errors in CI tests, which
are fixed here
Note that advanced scheduling needs to be disabled. Work is in
progress for implementing this for the new LLCP
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
The Babblesim test for eatt for reconfiguration of MTU is not
foolproof. Central actually generates two mtu update events.
This is fixed by only setting the reconfigured flag when the MTU actually
changes to the new values
In the Babblesim test for eatt for collision the peripheral
needs to sync with central to ensure collisions occur.
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
The def command Indicates that a comment block contains documentation
for a #define macro. This is useful if the comment block documents a
macro not adjacent to it, e.g.
```c
/**
* @def MAX(x,y)
* @brief Computes the maximum of @a x and @a y.
*/
#ifdef XXX
#define MAX(x,y) ...
#endif
```
However, it is not necessary if the comment is adjacent to the
definition, e.g.
```c
/**
* @brief Computes the maximum of @a x and @a y.
*/
#define MAX(x,y) ...
```
This patch removes all unnecessary def entries in-tree.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Enabled Multiple Notifications and added command for
bt_gatt_notify_multiple().
Increased possible number of connections to execute GATT/SR/GAN/BV-02-C
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
Refactor DF implementation to add aux offset in the aux
pointer field of the parent PDU when chain PDU is added
and/or is duplicated when PDU contents are updated.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Rename Kconfig BT_CTLR_ADV_PDU_BACK2BACK to
BT_CTLR_ADV_AUX_PDU_BACK2BACK to represent use of
back-to-back for Extended Advertising PDU chaining support
similar to BT_CTLR_ADV_SYNC_PDU_BACK2BACK that is used to
represent the use of back-to-back for Periodic Advertising
PDU chaining support.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Mesh Profile Specification errata 11310
Section 4.4.4.1
"This model shall support model publication, as defined in Section
4.2.2 of the Mesh Profile specification and model subscription,
as defined in section 4.2.3 of the Mesh Profile specification."
Signed-off-by: Michal Narajowski <michal.narajowski@codecoup.pl>
According Mesh Spec 1.0.1:
Upon receiving and successfully authenticating to
Secure Network beacon for a primary subnet whose
IV Index is 1 or more higher than the current known IV
Index, the node shall set its current IV Index and its
current IV Update procedure state from the values in
this Secure Network beacon.
Look like test_iv_index.c:81
``` C
(bt_mesh_net_iv_update(TEST_IV_IDX + 1, BCN_IV_IN_IDLE));
```
This test case already exists, but the wrong testcase
to test wrong code.
Move `is_iv_recovery` into `bt_mesh_net_iv_update`.
First check whether it is IV recovery, and then carry out
the subsequent IV normal update procedure.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
Due to added call to ull_cp_tx_nrf call in common function event_done,
encryption test test_encryption_start_periph_rem_no_ltk failed with
assert caused by unexpected number of free control procedure contexts.
That is caused by internal call to rr_check_done and lr_check_done
in the ull_cp_tx_nrf that frees last unreleased context.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Unit tests reposnsible for verification of collisions mitigation
didn't have handling for delayed completion of PHY Update control
procedure. The PHY Update is completed on event generated when
"at-instant" connection event is on air.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
The PHY Update control procedure completion is delayed to event
"instant-on-air". That has to be handled in CTE Request control
procedure unit test.
The changes required are:
- Added handling of event done for "at-instant" connection event.
This is required to call ull_cp_tx_ntf function to send an
envet "instant-on-air" to PHY Update procedure state machine.
This is the delayed completion of PHY Update procedure.
- Remote requested PHY Update completion is also delayed and completed
on "instant-on-air" event, hence the local CTE Request is not executed
at the same connection event as PHY Update completion. This caused
changes to check_phy_update_and_cte_req_complete function. The functin
does not hanle CTE Request completion anymore. This also implies
changes to run_phy_update_central and run_phy_update_peripheral.
These function do not need to get CTE request argument anymore
because it was just passed to check_phy_update_and_cte_req_complete.
The check_phy_update_cte_req_complete was renamed to check_phy_update.
The test test_cte_req_wait_for_remote_phy_update_complete was changed
to execute and verify local CTE request procedure explicitly after
completion of PHY Update.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
The test_phy_update_central_rem_collision didn't have processing
of an "at-instant" connection event. Thas causes the remote requesed
PHY update to hand in waiting for instant on air state and whole
test to fail.
To fix the problem, proper processing of "at-instant" connection evnet
has to be added. In consequence the local PHY update procedure, that
as waiting for end of the remote procedure is delayed by one connection
event.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Unit tests does not maintain connection events hence there is no
notification to PHY upodate state machine about instant on air
event. That has to be simulated by explicit call to ull_cp_tx_nrf.
In unit tests the event_done function is responsible for handling
all steps done at end of connection event, so it is the best place
to simulate the instant on air event and send it to LLCP state machine.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Migrate the BT tests for host_long_adv_recv to use FFF instead of
ztest mock which is being deprecated.
Signed-off-by: Yuval Peress <peress@google.com>
The BT test ctrl_sw_privacy_unit was enabling mocking but never using
it. Clean it up and remove the Kconfig.
Signed-off-by: Yuval Peress <peress@google.com>
The unicast client will now read the PACS location value
during the discovery procedure, as well as subscribing to
it.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Sometimes there is a need to interrupt mesh babblesim tests when
debugging or implementing new tests. Calling Ctrl-C doesn't work as it
only aborts the test script, but not the executables. This fix adds a
trap for Ctrl-C to kill all test instances run by the script.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Any project with Kconfig option CONFIG_LEGACY_INCLUDE_PATH set to n
couldn't be built because some files were missing zephyr/ prefix in
includes
Re-run the migrate_includes.py script to fix all legacy include paths
Signed-off-by: Tomislav Milkovic <milkovic@byte-lab.com>
`bt_gatt_unsubscribe` was pending a write to the CCC and then immediately
canceling it.
Fixes#47682 .
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
This change makes the optional procedures in the TBS Client optional
and configurable through Kconfig.
Signed-off-by: Fredrik Danebjer <fredrik@danebjer.com>
Migrate tests in connectionless_cte_tx to new ZTEST API.
Remove main.c source file because is unncessary when automatic
unit tests registration is available. Also former use of
predicate to select unit tests for execution is removed
because the tests are split into two distinct tests suites
that has its't own setup and teardown phases.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Migrate tests in connectionless_cte_rx to new ZTEST API.
Remove main.c source file because is unncessary when automatic
unit tests registration is available.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Migrate tests in connectionless_cte_chains to new ZTEST API.
Remove main.c source file because is unncessary when automatic
unit tests registration is available.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Migrate tests in connection_cte_tx_params to new ZTEST API.
Remove main.c source file because is unncessary when automatic
unit tests registration is available.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Migrate tests in connected_cte_req to new ZTEST API.
Remove main.c source file because is unncessary when automatic
unit tests registration is available.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
One sometimes forgets files can be distributed outside of git..
Added a concise usage example of the command above the config.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
In the broadcast sink `scan_recv` which is called when we
scan for broadcast source, we now also provide the entire
AD struct to the application.
The reason for this is that the advertising data may
contain other information that is useful for the application
like the broadcaster device name or any other
vendor/application specific data.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify how the ISO channels are allocated for the audio streams,
as well as how the CIG is allocated for the unicast group.
This fixes an issue where the unicast group could not be
fully allocated before _after_ the bt_audio_streams had been
configured by bt_audio_stream_config, thus making it impossible
to create a unicast group before the connections have been established.
This leaves us with 3 basic data types:
1) Streams allocated by the application
2) Endpoints that represent ASEs
3) Audio_iso which is used to couple streams and ISO channels.
The Unicast Group for the unicast client will now have the same
lifetime as the ISO CIG for the central.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Use `kernel log-level modulename severity`
Also enable it for the Bluetooth Shell.
Then one can compile-in a lot of BT modules like so:
CONFIG_BT_DEBUG_HCI_CORE=y
CONFIG_BT_DEBUG_L2CAP=y
CONFIG_BT_DEBUG_ATT=y
CONFIG_BT_DEBUG_GATT=y
And at runtime select only, e.g. GATT
kernel log-level bt_hci_core 0
kernel log-level bt_l2cap 0
kernel log-level bt_att 0
And then re-enable L2CAP if needed later
kernel log-level bt_l2cap 4
And so on..
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Instead of rejecting metadata at the BAP layer, we now
expect the higher layer to provide the verification.
The reason for this is that the higher layer may be better
equiped at determining which metadata it supports.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The CAP acceptor can now be a set member. This allows
the CAP acceptor to register a CSIS instance and include
it in the CAS.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Enable the CAP acceptor for the audio shell configuration
and the babblesim test cases.
Enabling CAP does add some additional requirements, and if
a BAP unicast client attempts to use it without conforming to
those requirement, it won't be able to update the metadata.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Implements PDU flow and unittest of CIS Create on Peripheral
Hooks CIS Create into the controller and fixes a few minor
things in ull to allow for running with NEW LLCP
Also handles CONFIG based comilation of CIS Create
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Hooks the CIS terminate into the controller and fixes a few minor
things in ull_conn(_iso).c
Also handles CONFIG based comilation of CIS_TERMINATE
also fixes a minor issue in helpers_pdu
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
The choice of LLCP by selecting 'y' option of the proper CHOICE config
Turns out a couple of tests fail with refactored LLCP, disabled for now
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
llcp_tx_pause_data() calls ull_tx_q_pause_data() for each pause_mask,
while llcp_tx_resume_data() only calls ull_tx_q_resume_data() when
conn->llcp.tx_q_pause_data_mask == 0 leading to an unbalanced number of
calls to ull_tx_q_pause_data()/ull_tx_q_resume_data() which can leave
the data path of the TX Q paused.
Fix such that only the first call to llcp_tx_pause_data() will pause the
data path of the TX Q.
Add unit test to verify correct pause/resume behavior.
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
The uart_pipe driver is not dependent on any console driver,
however a serial driver is required.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Update the broadcast_sink_test to use ISO to sync to the
broadcast source BIG, testing both the syncing functionality
as well as the sync stop and delete functions.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This fix removes the Streaming_Audio_Context LTV from the LC3 Codec
helper macro, and subsequently a faulty exposure of this LTV in the
PAC records used.
Signed-off-by: Fredrik Danebjer <fredrik@danebjer.com>
Made it more clear that the disable functionality is to
disable the mute functionality, but and not disabling
the microphone device itself.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Rename struct bt_micp to bt_mic_ctlr as it is only
used ofr microphone controller now.
This also allow cleanup of the bt_micp struct, thus
removing the common internal micp_internal.h header file
and reducing the size of the implementation by not
using a union of the structs.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify the existing bt_micp API for the
MICP Microphone Device to be more specific
by adding mic_dev as an infix. This follows
the naming scheme used for the MICP microphone
controller (mic_ctlr).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The AICS functionality is also possible via the bt_aics
API, and this was just a way to ensure that the AICS
instance was part of a MICS.
Removing makes MICP much simpler, and we can expect user
to know the context of a AICS.
This also fixes a few bad/missing guards.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Rename mics => micp_mic_dev (MICP Microphone Device)
Rename mics_client -> micp_mic_ctlr (MICP Microphone Controller)
This does not change any lines in the code.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Use the profile abbreviation, MICP, instead of the
service abbreviation, MICS, for the MICP implementation.
The server implementation will use MICP and the client
implementation will use MICP_CLIENT for now, as that will
be updated in a future commit.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Core Vol 3, Part G, Section 5.3.2 Channel Requirements states that
"The channel shall be encrypted". It does not mention any additional
security requirements that can be specified bt higher layer profiles.
This enables link encryption requirement for EATT channel.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
The HAS depends on the unicast server, and should be
disabled in the `no_unicast_server` as well as depend
on the CONFIG_BT_AUDIO_UNICAST_SERVER config.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add support for using PACS and/or capabilities for
the broadcast sink role. PACS and capabilities were
originally only supported for the unicast server
role, so the PACS callbacks were moved their own
struct, as if a device supports both the unicast
server role and the broadcast sink role, it will
only have a single PACS instance.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
As Zephyr currently requires CMake version 3.20.0, update all
occurrences of cmake_minimum_required.
Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
Fix the deprecated calls to loading ZephyrUnittest by replacing them
with `Zephyr COMPONENTS unittest`.
Signed-off-by: Yuval Peress <peress@google.com>
The pausing and timing of data transmission is changed in the PHY update
procedure, so that conformance tests passes. This requires an update
in unittests as well
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
The BT_CODEC_LC3_CONFIG_* macros had a hardcoded location
and context, which makes them a lot less usable.
Updates the macro, and the macros that used them.
This also removes the BT_CODEC_LC3_CONFIG and instead
just uses the BT_CODEC_LC3_CONFIG_N macro, which has
then been renamed to BT_CODEC_LC3_CONFIG.
As an addition, the macros and their input has
also been better documented.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
On remote terminate on central the conn clean-up would happen before ack
of terminate ind was sent to peer.
Now clean-up is 'postponed' until subsequent event.
Also now data tx is paused on rx of terminate ind to ensure no data is
tx'ed after rx of terminate ind
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Only apply change to effective DLE times if current max times are too
small to accommodate. Similar to legacy implementation
Update unit tests to new DLE ntf behavior
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Logging v1 has been removed and log_strdup wrapper function is no
longer needed. Removing the function and its use in the tree.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
the CSIS client now has a ordered access procedure function.
The function implements the procedure as per the CSIP spec,
where it will verify that 1 or more members are unlocked,
and the execture a procedure on each member in ascending
order of rank.
The procedure can be anything (even a non-BT procedure),
and it will be up to the applicaiton to implement
what to do in that.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Having the members array being const causes a lot of
limitations in the implementatation, and was
occasionally even disregarded. Removed to make the
implementation more flexible.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Increases the main stack size of the mesh shell test application.
This resolves issue where application is not able to pass initialization
step.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
The test relies on enabling connection iso features in the host. As the
controller does not yet support them, this configuration does not really
make sense. But because the test is not using this functionality, we
work around it by pretending the controller supports it.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
A new command is added to connect EATT channels.
Affects L2CAP/TIM/BV-03-C, which tests requirements on ATT.
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
Files including <zephyr/kernel.h> do not have to include
<zephyr/zephyr.h>, a shim to <zephyr/kernel.h>.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The testcase.yaml file in tests/bluetooth/df directory makes
twister trying to build tests that are not available.
All tests in the df subdirectory have private testcase.yaml
files.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Implementation of ll_df_set_cl_cte_tx_params was updated to verify
if the number of requested CTE in a periodic advertising chain is less
or equal to maximum supported value that is provided by CONFIG_BT_CTLR-
_DF_PER_ADV_CTE_NUM_MAX Kconfig option. In the past the value was
verified against maximum value allowed by BT Core Spec Vol 4, Part E,
section 7.8.80. Check against BT Core spec provided value could lead to
memory overwrite.
The unit tests start to fail because default value of the CONFIG_BT_-
CTLR_DF_PER_ADV_CTE_NUM_MAX is 1, hence is shall be changed in unit test
configuration file.
The commit adds missing configuration.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Wrong feature was enabled for a connection object as one the currently
used features. The enabled feature was CTE response. In case if the
feature exchange has not happened, it is verified if CTE request feature
is enabled, not the CTE response feature. The problem is in a common
code that prepares connection object for unit tests.
The commit fixes enabled features preparation for a connection object.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add two new parameters to bt_iso_chan_send:
sn: The packet sequence number which shall be incremeted
per SDU interval.
ts: An optional timestamp value used to synchronize SDUs.
The sequence number in the API uses a 32-bit value even though
the sequence number for the HCI command is 16-bit. This is to
properly handle wrapping of sequence numbers, which is much
easier to do with additional bits allocated.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Redefine PASS macro to add "PASSED" to the output. This makes passes
easier to grep for by ensuring a consistent pattern in the output.
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
error: 'CONFIG_BT_TBS_MAX_PROVIDER_NAME_LENGTH' undeclared (first use
in this function); did you mean
'CONFIG_BT_TBS_CLIENT_MAX_PROVIDER_NAME_LENGTH'?
292 | CONFIG_BT_TBS_MAX_PROVIDER_NAME_LENGTH);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| CONFIG_BT_TBS_CLIENT_MAX_PROVIDER_NAME_LENGTH
etc.
This fixes build errors that were seen while building call control
client without server side (`CONFIG_BT_TBS`) enabled.
The options like BT_TBS_CLIENT_MAX_URI_LENGTH and
BT_TBS_CLIENT_MAX_PROVIDER_NAME_LENGTH have been removed because those
were not used in the code. In fact the client implementation used the
common options for BT_TBS_MAX_URI_LENGTH and
BT_TBS_MAX_PROVIDER_NAME_LENGTH that were moved in this patch to the
common Kconfig section.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Adds few missing zephyr/ prefixes to leftover #include statements that
either got added recently or were using double quote format.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Fix Data Length Request CMD parameter checking to not
restrict invalid maximum Tx time values. This addresses
conformance test cases that provide maximum Tx time values
of 2128 us when not supporting Coded PHY in the Controller
implementation.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix incorrectly disabled tests that had been passing on
legacy LLCP implementation in the Controller.
Regression introduced in commit f023b5f611 ("Bluetooth:
controller: push topic branch to main").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
If there is a PHY change on a connection it may happen that effective
RX and TX time changes also. That change is applied after an instant.
Implemented handling of effective time calculation is based on the
maximum PDU length, new PHY and local (default) maximum TX or RX time.
The maximum TX value is set to default one that corresponds to PHY 1M
during the Controller initialization. It can be updated by host to other
value. By default Zephyr Host updates it to max possible TX time for all
supported PHYs. If PHY CODED is enabled, it is the longest possible TX
duration 17040 us.
The maximum RX value is set to default during connection creation.
In case of use of legacy advertising, the value is also related with
PHY 1M. It can be updated by data length extension procedure.
If the maximum RX value is set to some value and there is a change
of a PHY to one that requires more time to send a PDU with the same
length, then the maximum RX value is wrongly calculated.
Function pu_calc_eff_time returns a value that is the default_time
argument. The problem is that the default_time should be adjusted
to new maximum RX time required for a new PHY.
To solve that there should be an evaluation of a new maximum RX and
TX time based on new PHY.
The commit adds missing evaluation.
The problem occurred in DF tests that check collision mitigation
between PHY update control procedure and CTE request control procedure.
There was missing CONFIG_BT_CTLR_PHY_CODED option in CTE request
unit tests. The code was working because the ULL implementation of
PHY change control procedure does not verify if PHY CODED is supported.
When missing support was enabled, tests showed wrong evaluation of
maximum RX time. It also unveiled error in CTE request unit tests
implementation. The default_tx_time was set to wrong value 2120 us
as if PHY CODED was not supported. To fix it, the value was changed
to PDU_DC_PAYLOAD_TIME_MAX_CODED.
There was also added a mock for a feature exchange procedure done
during unit tests setup step. That allows to correctly calculate
maximum TX time by ull_dle_max_time_get function.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Fix filter accept list and privacy feature Kconfig default
based on whether host has them enabled.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Upon collision either the error code for different procedure
collision or same procedure collision must be transmitted,
which is fixed in this PR. Previously always the error code
for same procedure collision was sent
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
There was missing assignment to a global variable that stores
connection handle. The value was always the same, hence it test
were not failing. The value was passed over from setup state
done for other tests. This change makes sure there is always
correct handle stored in global variable.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
There was missing information about supported CTE response feature
by peer device. That caused a test_set_conn_cte_req_enable to fail.
The test expected that peer device supprots CTE response.
The missing information is added in a common code responsible for
connection object preparation.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Due to change in Kconfig CONFIG_BT_CTLR_DF_MAX_ANT_SW_PATTERN_LEN
the Kconfigs in tests were wrong and tests were not building.
The commit sets the max antenna switch pattern length to actual
maximum value.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
There is a test that verifies a behavior of CTE request control
procedure if receives LL_UNKNOWN_RSP. The expected behavior
is to terminate connection if that is response handling is
not implemented by a command. Other unexpected responses are
treated as new remote control procedures.
The CTE request has implemented handling of LL_UNKNOWN_RSP,
hence this particular test is no longer valid.
There is still open question how to handle other unexpected
reposne PDUs while waiting for LL_CTE_RSP. That is not defined
by BT 5.3. Core specification and not decided by community.
The test is removed to because it fails and blocks CI.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
There were couple of test cases where Host notification object
was not released. The commit adds missing release calls.
Also commnets related with check if RX queue is empty were
changed to describe what is verified then.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
There was a test case that was never executed. It was not
added to a test suite in test_main. The commit adds the
test case.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add test that verify correct behavior of the CTE request procedure
in case of reception of LL_UNKNOWN_RSP PDU from peer device.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Remove the explicit enable of Extended and Periodic
Advertising support in Controller, the feature is no
longer experimental in the Controller and is now enabled
by default when application uses them by enabling as
Host feature.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add two new Kconfigs: BT_ISO_CENTRAL and BT_ISO_PERIPHERAL
that is used to do central or peripheral only builds,
similar to the BT_CENTRAL or BT_PERIPHERAL Kconfigs.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
CTE request tests were not working because there was missing
a code that sets conn.llcp.cte_req.is_enabled flag.
If the flag is not set, then the CTE request state machine
comletes its execution immediately as if the request was
disabled by Host in the meantime.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
The periodic CTE_REQ disable command, requested by Host, may be locked
until connection is dropped due to missing CTE_RSP from peer device.
That is caused by implementation of CTE_REQ disable and CTE_REQ
control procedure handling.
The procedure is marked as active when CTE request was send to peer
device. It is marked as inactive after completion of the procedure.
That caused locking of CTE disable on a semaphore.
The BT 5.3 Core Spec, Vol 4, Part E, section 7.8.85 says the HCI_LE_-
Connection_CTE_Request_Enable should be considered active on a conne-
ction from when Host successfully issues the command with Enable=0x1
until a command is issued with Enable=0x0 or single LLCP CTE request
has finished (CTE_Request_Interval=0x0). Also there is a clarification
from BT SIG that the command with Enable=0x0 does not affect any
initiated LLCP CTE request. That means Controller is allowed to finish
already started procedure and it is not allowed to start new LLCP CTE
request procedure after completion of the command with Enable=0x0.
Taking that into account, there is no need to synchronize ULL and LLL
in regard of disable the LLCP CTE request while the procedure is
pending. Controller is free to complete the procedure or terminate it.
The change removes all code related with cte_req.is_active, disable
callback and waiting of ULL for LLL to finish the LLCP CTE request.
The ULL will complete the HCI_LE_Connection_Request_Enable with
Enable=0x0 immediately. In case the procedure is disabled in before
the response arrives, then further processing of the response is
dropped and the procedure context released.
The context is not released by the code responsible for disable
handling, to have single place where it is done.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
The audio stream receive callback now contains a
recv_info struct, which contain crucial information
such as timestamps and packet validity.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The values represent an enum, and it makes sense for the
enum values to follow the enum type name, so an
_DIR_ infix was added to the values.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Many functions and struct fields had the directory/type
value, but named in different ways and stored in different ways.
This change updates all uses of it to use the same name
and type.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The enum bt_audio_pac_type does not fully
represent the what the value is used for.
The typical use of it is not for just published
audio capabilities (PAC), but rather describes the
type, or direction, of audio endpoints.
For the unicast client, the type/direction is
relative to the unicast server.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Verifies ISOAL functionality for VS RX data path by implementing weak
function ll_data_path_sink_create, and implementing sink callbacks.
Test verifies construction of sink and checks that SDUs are emitted in
VS sink implementation.
Test relies on the Nordic synchronous receiver implementation, and is
compiled under CONFIG_BT_CTLR_ISO_VENDOR_DATA_PATH, which is enabled in
the project file.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Assign BT_CTLR_ADV_DATA_LEN_MAX value to 255 to match the
corresponding BT_CTLR_SCAN_DATA_LEN_MAX value.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The bt_audio_broadcast_source_create function will now
take an array of stream pointers, instead of an array
of streams. This is to make the API more flexible as
well as more consistent with the unicast API.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
In bt_audio_unicast_group_create, bt_audio_unicast_group_add_streams
and bt_audio_unicast_group_remove_streams to use an array
of pointers, instead of an array of streams.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
There were no unit tests that verify if instant value send in
LL_PHY_UPDATE_IND PDU are correct. The commit adds missing tests.
Besides that there is a small update to all ull_cp_phy_update calls,
to improve readability of the code. Magic number was changed to
HOST_INITIATED macro.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
There was missing kconfig option that enables refactored LLCPs.
That caused build error in Direction Finding connection_cte_tx_params.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
The ll_scan_set::per_sync was renamed to ll_scan_set::periodic.
Direction finding connectionless_cte_rx test didn't build.
The commit fixes the issue.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add the release procedure for the unicast audio tests.
This also run the existing tests multiple times to ensure
that the states are properly changed across multiple
attempts.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Terminate connection with a MIC failure if an unexpected control PDU
is received during the Encryption Start procedure.
Add a greedy option to pdu_is_expected() to make sure the procedure
processes all unexpected control PDU in all cases.
Add unit test inspired by Bluetooth Qualification test
LL/SEC/CEN/BV-14-C,
Central Receiving unexpected PDU during encryption start
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
Add support for both LL_REJECT_IND and LL_REJECT_EXT_IND when waiting
for the the response to the LL_ENC_REQ and LL_START_ENC_REQ.
Add unit test to test both LL_REJECT_IND and LL_REJECT_EXT_IND as
responses to LL_ENC_REQ.
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
Chose correct rejection PDU based on features supported on remote peer
when rejecting due to missing LTK.
Update unit test setup with faking that a feature exchange procedure
has run.
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
Terminate connection with a MIC failure if an unexpected control PDU
is received during the Encryption Start procedure.
Add unit test inspired by Bluetooth Qualification test
LL/SEC/PER/BI-05-C,
Peripheral Receiving unexpected PDU during encryption start
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
Compile out misc. members not used when Connection Parameter Request
is not supported.
Implement missing tests re. unsupported features in CU/CPR procedure
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Increasing the test coverage of notification on EATT bearers.
- test implementation
Signed-off-by: Alexandru Carbuneanu <alexandru.carbuneanu@nordicsemi.no>
ATT_READ_BY_TYPE_RSP returns Attribute Data List so handle it in the
application.
This affects GATT/CL/GAR/BV-03-C.
Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
When a running procedure receives a REJECT or UNKNOWN_RSP PDU that is
not an expected part of the procedure flow this leads to termination
of the connection
This affects procedures:
CU/CPR, CTE, PHY, PING, DLE, FEX, VEX, CHMU
Unit tests are updated to cover the updated behaviour.
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Update debug project configuration file to cover building of
Bluetooth with Extended Advertising support without Extended
Scan Filter Policy.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
For clients with both a single and multiple ATT channels:
- Read a characteristic before reading the DB hash and then retrying
- Read the DB hash and then do the reads
- Retry the reads without reading the DB hash
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
EATT channels shall be encrypted. Without encrypting the link, all
requests will be sent on the fixed ATT channel.
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
The sync mechanism using Babblesim backchannels picked up self-sent
messages. Use the device number as data to disambiguate messages from
other devices.
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
Changes the media_proxy API to pass structs by reference instead of by
value.
Also pass structs by reference in internal functions in media player
and in media controller test.
Add pointer checks to the public API implementation where
user/application code provides structs by reference.
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
Changes the media control client API to pass structs by reference
instead of by value.
Also change internals of test to pass struct by reference.
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
Testing of IV update, IV recovery and deferring of
the IV update procedure in case of ongoing segmented
transaction.
Signed-off-by: Aleksandr Khromykh <Aleksandr.Khromykh@nordicsemi.no>
Now refactored Connection Parameter Request procedure supports
parameter checking, and implements reject_ext_ind on invalid parameters
Updates to TODO description for remaining work
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Change CONFIG_BT_RECV_IS_RX_THREAD into a
choice:CONFIG_BT_RECV_CONTEXT with the following options
(names can be discussed further of course):
CONFIG_BT_RECV_BLOCKING
CONFIG_BT_RECV_WORKQ_BT
CONFIG_BT_RECV_WORKQ_SYS
This way users would be able to choose what to run most of
the BLE stack on, they wouldn't be forced to a single model.
We would default to CONFIG_BT_RECV_BLOCKING so that we wouldn't
need to change the system workqueue stack size by default, instead
asking users to do so if they select the CONFIG_BT_RECV_WORKQ_SYS option
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
Move include paths and add new target_include_directories to support
backwards compatibility:
* /include -> /include/zephyr
example: <irq.h> -> <zephyr/irq.h>
Issue #41543
Signed-off-by: Yuval Peress <peress@google.com>
This platform requires a special setup and has its own workflow. Do not
list it as integration platform as it violates the rule of having to be
built which is not possible due to missing environment.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Don't autoconnect EATT as this was confusing PTS and resulted in
multiple tests failures. When needed PTS will connect EATT bearer.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Checks that the server returns "Database Out Of Sync" error on two bearers
when the client is change-unaware and returns success after the database
hash has been read.
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
Making sure struct bt_l2cap_chan has absolutely no members related
to dynamic channels.
That way we ensure that there is no overhead for a build where only
fixed channels are used.
It's not enough that the dynamic channel-related members are put behind
ifdefs - they should be completely moved out from the struct definition.
Furthermore, the public l2cap.h header file already has a struct
that's meant to be used for dynamic channels: struct bt_l2cap_le_chan!
However, currently dynamic channel support is a mess - it's a mix
between these two structs. The bt_l2cap_le_chan struct should really
be an extension of the bt_l2cap_chan struct, i.e. the former should
contain as a member the latter.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
Use same simulation length for TBS, bass, broadcas and unicast as for
the other tests. Simulation length must be larger than time-out
value, to give the test a chance to time out.
The time-out value have previosly been aligned for the other tests.
TBS was not done at that time, as it was still being upstreamed.
(Unsure about why bass, unicast and broadcast were not done at the
same time - they may have been in PRs).
See commits f7cd6afb79 and
73f5ffcf4e
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
This macro conflicts with C++'s std::condition_variable::wait_for
and makes it very difficult to use Zephyr with C++. Replace it with
an all uppercase name which fits the naming standard better.
Signed-off-by: Yuval Peress <peress@google.com>
llcp_lr_pause()/llcp_rr_pause() only pauses currently pending procedures
in their respective request machines, any future initiations are not
paused, thus they are allowed to run, when the opposite was expected.
Change the procedure pause logic into a global pause on the request
machines them self, this is essence what the per-procedure pause
flag was trying to achieve.
Add new query function llcp_?r_ispaused() to not expose the logic behind
the pause functionality.
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
Change LLCP TX data pause into using mask to allow for pausing from
multiple different sources - but only once per source
(the underlying TX queue still just has an integer counter).
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
The PHY update procedure may trigger a DLE update in certain
situations
When a limited number of rx buffers is available there may not be
enough for doing the phy update and dle update notifications
at once.
Fixes#41788
Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
The test now uses the public bt_eatt_count function to wait until the
expected number of EATT channels are connected.
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
If the Kconfig BT_EATT_AUTO_CONNECT is enabled (on by default), the
host will try to connect BT_EATT_MAX EATT channels when a connection
to a peer is established.
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
Increase to 250 simultaneous connections in the BabbleSim
test. Update connection interval to accommodate 250
non-overlapping connections and a scan window. And make the
use of is_disconnecting flag consistent between central and
peripheral sample.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
No longer skip this test case
Remove TODO re. chmap test
Def'ing out CENTRAL API tests as ull_central is mocked
Fix rssi test case
Fix feature_exchange_wrong_handle test case
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Getting rid of TODOs that are fairly straight forward to resolve
* introduce role checks in ENC API
* Remove ASSERT on re-rx of LL_VERSION_IND, ignore instead
* in tests/.../ctrl_chmu: rename variable and initialize initial ch map
* in tests/.../mock_ctrl/util.c: Changing TODO into FYI
* in tests/.../helper_features.h update mask and remove TODO comment
* in ull_llcp_remote.c: re-order cases in proc_with_instant switch
* in ull_conn_upd.c: PARAM REQ only uses REJECT_EXT_IND
* in ull_llcp_common.c: in CENTRAL on rx of LL_MIN_USED_CHANNELS_IND
chose to do nothing re. channel map. Update unit test accordingly
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Add build only tests to cover Periodic Advertising ADI
support in advertising state and in Periodic
Synchronization state.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Some names of the test cases are duplicated within the project.
This commit contains the proposed names of the test scenarios.
Signed-off-by: Katarzyna Giadla <katarzyna.giadla@nordicsemi.no>
Truncate strings being notified to fit the ATT_MTU, to prevent
notifications from not being delivered due to being too long.
For now uses the minimum ATT_MTU, as the MCS does not yet track
connections.
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
Add a new callback structure for Bluetooth authentication
This struct is meant to replace the information-only
callbacks in bt_conn_auth_cb. The reason for this is that
due to the nature of bt_conn_auth_cb, it can only be registered
once. To allow mulitple users gain information about pairing
and bond deletions, this new struct is needed.
Samples, tests, etc. are updated to use the new struct.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This patch removes the redundant test case step.
Neither VCS/VCP nor MICS/MICP require ATT MTU to be other than default
23 bytes.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This enables automatic MTU exchange for services that require MTU size
bigger than default ATT MTU to operate.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
autopts was updated to properly require support for Accept Filter List
in Auto Connection Establishment Procedure related tests. This patch
enabled support for it and adds required BTP support.
This was affecting following qualification test cases:
GAP/CONN/ACEP/BV-03-C
GAP/CONN/ACEP/BV-04-C
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Add Kconfig file for the media proxy, for high-level media control
configuration.
The media proxy did not have a Kconfig file, it was relying on the
Kconfigs for GATT media control client and server.
The purpose is to unify the media control configurations, to make the
different media control functionalities available separately, and to
separate the high-level media control from the bluetooth media control
server and client.
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
Separate out the Kconfig for the media player.
Also removes some unused MCS configs.
The media player has been using MCS configs, while it should be the
other way around.
Also, this will make it easier to move the media player elsewhere, as
has been discussed.
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
Updating test lists, commenting out test that fail with refactored LLCP
Introducing refactored LLCP specific test lists for GAP and GATT
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
This command is used to obtain 'Implementation eXtra Information for Test'
(IXIT) values that are required to proceed with BT qualification tests.
Signed-off-by: Tim Sørensen <tims@demant.com>
- Implemented ISO-AL TX interface functions for fragmentation of
unframed PDUs
- Implemented ISO-AL source construct and its creation for an input
data path
Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
Use non-zero SID value so that regressions in use of
Periodic Advertiser List implementation is catch in
testing.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This was affecting following qualification test cases:
GAP/SEC/SEM/BV-56-C
GAP/SEC/SEM/BV-57-C
GAP/SEC/SEM/BV-58-C
GAP/SEC/SEM/BV-59-C
GAP/SEC/SEM/BV-60-C
GAP/SEC/SEM/BV-61-C
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Add tests checking that secure network beacon interval cannot be
less than 10s and not more than 600s for a provisioned node.
Signed-off-by: Alperen Sener <alperen.sener@nordicsemi.no>
There are no more context defines specific to metadata, the ones
coming from Assigned Numbers shall be used.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Rename
BT_CTLR_LLCP_PROC_CTX_BUF_NUM
to
BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM
to match naming scheme of
BT_CTLR_LLCP_REMOTE_PROC_CTX_BUF_NUM
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
Add a separate procedure context pool for remote initiated procedures.
Make it configurable in size by BT_CTLR_LLCP_REMOTE_PROC_CTX_BUF_NUM.
Fix all unit tests referring to the amount of free context buffers.
Fixes#41823
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
Refactor the PAC location read and write. Instead
of storing the location in the service, the
location is now stored in the application, and
is retrieved by the service via callbacks.
Similarly, if a client writes the location, this
request is being sent to the application.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Return error code from tx_end callback to bt_mesh_test_send caller. This
will help to understand where test failed.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Increase main thread stack size so that the sample can be run on
nrf52832 and nrf52840 DKs.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
The capabilities callback did not provide information about
the type of the endpoint being configured, making it
impossible for the application to determine if it is a
sink or source endpoint.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Audio streams as defined by the BAP spec does not
support bidirectional audio streams. This commit
updates the API and implementation to match that.
The use a bidirectional CIS with 2 audio stream will
be added in a future commit.
This removes the _IN_ and _OUT_ and _INOUT_ QOS
values, as well as the direction of the codec QOS
struct.
To keep direction for internal use, the direction
has been added to the endpoint struct.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Make it consistent for audio.h and capabilities.h that the
array size parameter appear after the array parameter.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Selecting the new LLCP is a 'choice' in Kconfig, so setting
CONFIG_BT_Ll_SW_LLCP_LEGACY to 'n' does not select the new LLCP
Instead CONFIG_BT_LL_SW_LLCP needs to be set explicitly to 'y'
Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
Extend the existing bsim Heartbeat test
to check the publication callback functionality.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Test the rejection (LL_UNKNOWN_RSP) of unsupported remotely initiated
procedures in both the central and peripheral role.
Unsupported opcodes are handled by Kconfig manipulation and removal of
source files.
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
Test the rejection (LL_UNKNOWN_RSP) of invalid remotely initiated
procedures in both the central and peripheral role.
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
Move the instance as the first parameter of the client function calls
and callbacks, for consistency with the server implementation.
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
Move the metadata request bitfields to the common header files.
This is part of merging the ots_client and ots header files.
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
Merge Kconfig file for OTS server and client.
Rename the client config from _OTC to _OTS_CLIENT
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
Ztest based unit test of ISO adaptation layer.
Testing of unframed case, single SDU, recombined from
one and two PDUs.
Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
First L2CAP ecred bsim test.
Signed-off-by: Alexandru Carbuneanu <alexandru.carbuneanu@nordicsemi.no>
Signed-off-by: Martin Tverdal <martin.tverdal@nordicsemi.no>
The callbacks were implemented to notify the application
about the state of the ISO. However, since then, callbacks
such as `started` and `stopped` have been implemented,
and as such the `connected` and `disconnected` callbacks
no longer server any purpose.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The pb_adv_reprovision test takes a long time to execute, as it's
running 10 provisioning sessions in a row. Any side effects from the
provisioning process should come into play already on the first
reprovisioning, so we can safely reduce this to only 3 provisioning runs
without losing any test coverage.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
The wallclock time timeout of the test execution is limited to let CI
abandon hanging test cases. Increase this timeout to account for
additional tests running in parallel in CI, which has caused enough
resource contention to make CI break the time limit.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
This PR add more checks for model extension functionality for BLE Mesh.
It adds checking of:
* Models across multiple elements (should not share subscription lists)
* Sibling models (if models that extend the same model share
a subscription list)
* Subscription list entry allocation (models within extension list
use subscription list capacity of each other).
Signed-off-by: Aleksandr Khromykh <Aleksandr.Khromykh@nordicsemi.no>
The minimum CMake version required is 3.20.0, but the unittests
for the LLCP controller still referred to 3.13.1 as the minimum
Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
pb_adv_reprovision is failing in CI, but the error cannot be reproduced
locally. Disable the test as a hotfix for main, so we can determine the
issue and re-enable the test in a separate PR.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
We have single server but it can accept multiple connections so
keep same requirements for all connection attempts.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Add tests checking that:
- invalid beacons are dropped and do not affect beacon interval;
- valid beacons with old Net Keys are either processed or dropped
depending on the Key Refresh phase;
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Remove the BT_AUDIO_DEBUG Kconfig option.
Given that all the audio modules are guarded by the BT_AUDIO config,
it seems excessive to also have a separate guard for audio module
debug. It is sufficient that this is turned on/off module by module.
Note that the BT_AUDIO_DEBUG was also located in the wrong file - the
babs Kconfig file, not the main Kconfig file.
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
The abbreviations cen and per may be confusing, so they are
expanded into central and peripheral
Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
There were some references to slave and master left in the unittests
for the refactored LLCP.
These are changed in respectively peripheral and central
Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
Tests that when a collision happens, the connection attempt is retried
and that it succeeds.
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
HCI/GEV/BV-01-C tries to send 255 bytes over HCI, as part of sending
an unknown/unsupported command, but the default buffer size
is 65, which results in a buffer overflow and undefined behaviour.
Instead of crashing hard we now check the buffer length.
In order for EDTT tests to pass we set the buffer size to 255
Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
Update the WAIT_TIME definition and timeout-message so that the time
out message actually prints the elapsed time instead of "0".
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
Increase the simulation lengths in the test scripts (where needed) to
be longer than the WAIT_TIME defined in common.h, so that simulations
will not end before the test has a chance to do proper time out.
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
Test that verifies correct handling of Version exchanged procedure
called twice on the same connection failed. The reason was wrong
number of expected free procedure context objects. It was expected
that there will be one context not released.
That was wrong because the context is released just after the procedure
completes in idle state. The second and following calls to the procedure
do not start any PDU exchange, so the procedure ends immediately.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
The tests for direction finding connected mode were not building
correclty. There were missing Kconfig options that enable missing
functionality to be tested.
Tests were not failing because there were no expected positive
behavior tests added.
Added changes allow to validate all implemented test cases.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
To avoid violation of BT 5.3 Core Vol 6, Part B section 5.1.10.1
there was added a command pause mechanism that allows to postpone
handling of CTE REQ if there is pending PHY change procedure or
PHY change if there is pending CTE REQ procedure.
The commit adds unit tests for the functionality.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Fix missing Kconfig value for Scan Max Data in the
Broadcast Audio test.
Regression in commit faa89c779c ("Bluetooth: Controller:
Fix Periodic Adv Report to scan max data length").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add broadcast babblesim test cases that tests basically
functionality. Due to the lack of ISO support in the
controller, this won't actually start any audio streams.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add support for the BAP broadcast sink role. This role
allows a device to sync to a broadcast ISO stream.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add initial babblesim tests for unicast audio.
Due to lack of ISO support in the babblesim, these
won't attempt to actual initate audio streams.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add the BAP unicast client implementation. This role
can discover BAP unicast server services and initiate
BAP audio streams.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add the Basic Audio Profile (BAP) unicast server
functionality. This allows a device to act as the
unicast server role, which can accept unicast streams
initiated by a unicast client.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Adds initial GATT BSIM tests for the client
and server functionality, testing simple
reads and writes.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The CP bit is read in DF connected mode while interpreting
LL_CTE_RSP PDU, hence it must be available in struct pdu_data
type.
There were missing two Kconfig options in new LLCP tests.
They were reponsbile for disable of CP bit instruct pdu_data.
That caused tests to fail during compilation.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Fixes build issues for tests in related with CTE REQ and
hci commands.
Fixes issues in unit tests for CTE REQ/RSP control proedures.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Test covering a corner case scenario where the LPN has received a
friend offer, but has not yet established a connection. In this case
the LPN terminate callback should not be triggered if the LPN is
disabled, which is monitored by this test.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
Merges bt_csis_client_discover and
bt_csis_client_discover_sets, as they should be done
together for the discovery procedure from the CSIP
spec.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Rename struct bt_csis_client_set to
struct bt_csis_client_csis_inst, as that is more descriptive
of the actual content of the struct.
This also avoids the confusion about what a "set" is,
which is clearly not a single instance of CSIS
on a single remote server.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Several APIs worked on the bt_csis_client_set struct,
which not only included information about a set, but
also a reference to a specific CSIS instance.
A specialized struct only for the set information
is more useful in those scenarios.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify bt_csis_client_get_lock_state to be the Ordered Access
procedure, which means that instead of reading a single lock value
on a single device, it will read the lock value for all
set members supplied in the function, and return true if any
of them is locked, or false otherwise.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Remove the addr struct from bt_csis_client_set_member as that
was only used by the upper layers and not the CSIS client
itself, and as such should only reside in the
upper layers.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Change how the SIRK is exposed to the upper layers.
The SIRK will always be the unencrypted 16 octet
SIRK now, instead of a struct.
This not only allows us to avoid having a
__packed struct in the API, but also gives a better
API as we don't expose encrypted data to the upper layers.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Refactor bt_csis_client_discover_sets to use the
bt_csis_client_set_member struct instead of a bt_conn.
The bt_csis_client_set_member represents a remote server
(set member), and make it possible to avoid sending indexes
of instances around instead of bt_csis.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Remove the lock and release sets functions, as well
as the discover member function as they have been removed
from the implementation a while ago.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Use the bt_csis_client_set_member struct to store the individual
bt_csis client struct. This way they are exposed to the
client application.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Provides interface, data structures and demuxing capability for ISO RX
PDU allocation and transport from LLL to HCI.
Uses the RXFIFO composite for simplicity and reduced overhead.
Signed-off-by: Morten Priess <mtpr@oticon.com>
The host reassembles fragmented advertising reports from the controller.
Non-complete advertising reports from different advertisers may not be
interleaved. If non-complete advertising reports from an advertiser
is received while advertising reports from another advertiser is
reassembled, an error message is logged and the advertising report is
discarded. Future scan results may be incomplete.
Advertising reports from legacy PDUs or complete extended advertising
reports may be interleaved as these do not require reassembly.
If the controller sends more advertising data than fits in the
reassembly buffer, the data is truncated. Further advertising reports
from the advertiser are discarded until the final complete advertising
report is received and discarded.
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
There were changes done to controller code that cause
tests to do not build and fail during execution.
Changes are related with:
- modified code related with extended advertising ADI
field handling
- added generic double buffer data structure that is
used in controller
- moved code that was building only when DF is enabled
- added EVENTS_PHYEND that is not available in nrfbsim
board
The PR addresses those issues.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
In connected mode when Receiving Constant Tone Extensions feature
is enabled, controller shall be able to receive CTE in any
data channel packet.
The commit adds required changes to allow receive of CTE for
all data channel packets in peripheral role.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Test scripts should be executable.
The regression system will work around it by making them executable
if they are not, but that causes changes to the local tree.
Fix it instead so people doesn't get local changes when running regression.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Different tests should use different simulation ids so they don't
collide with each other at random when run in parallel.
Fix it.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
bsim test build system hides compile warnings.
The problem had been fixed before but due to a regression came again.
This commit adds extra cc flags to prevent this.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Updated the ISO BabbleSim test to use Periodic Sync Receive
enable command to disable Periodic Sync reports and yet
receive the BIGInfo report.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit adds 3 tests that check:
- Publish period state
- Publish retransmit count and interval steps states
- Canceling periodic publication and publication retransmission
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Bsim devices work asynchronously before access to Phy.
Interprocess OOB communication might be broken because of this.
PR adds synchronization for devices. Drift is 100ms between them.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Update the testnames according to the Bluetooth 5.3 specification
for inclusive naming
Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
There is a common implementation of connection handling code
that may be shared by tests: connection_cte_req and connection_cte-
tx_params.
This commit removes code implemented in common.c and common.h
files. The same code is currently available in ../df/common/
directory.
All calls were updated to use function from common implementation.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add unit tests for HCI command HCI_LE_Set_Connection_CTE_-
Transmit_Parameters.
Part of a code that was available in df/connection_cte_req/common.c,
related with artificial handling of connection, is moved to
df/common/bt_conn_common.c.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
This commit adds 3 tests that check:
- Publish period state
- Publish retransmit count and interval steps states
- Canceling periodic publication and publication retransmission
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Increase the L2CAP buffer count, for the media control shell to work.
(The buffer count was set to an even higher value in the
topic-le-audio branch, but that setting was not upmerged.)
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
The le-audio host shell enables extended advertising. Therefore, for
the shell to be usable, extended and periodic advertising must also be
enabled for the controller.
The controller configuration are added to board-specific files for the
time being, as the advertising features are still experimental
upstream.
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
Update the configuration file to use BT_FILTER_ACCEPT_LIST
instead of the deprecated BT_WHITELIST.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The define for PDU_AC_LL_SIZE_EXTRA was removed in main, but not in
the topic-branch. The merge of topic/branch erroneously reintroduced
this define, so it needs to be removed
Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
HCI tests HCI/DSU/BV-05-C and HCI/GEV/BV-01-C fail when
compiling with debug optimisations turned on.
Therefor revert to not compiling with debug optimisations.
Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
Update the macro prototype to explicitly require the length of the
desired user data. Update all in-tree usage of this macro.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Adds preprocessor ifdefs to reconfigure() in L2CAP tester application
depending on the KConfig option CONFIG_BT_L2CAP_ECRED
Fixes issue #40456
Signed-off-by: Johan Lundin <johan.lundin@nordicsemi.no>
For consistency we run the gatt and gap tests also with the new
LLCP. The test lists for legacy and new LLCP are identical
and therefor no separate test lists have been introduced
Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
Rename the mockup file from ull_periph.c into ull_peripheral.c
so that it has the same name as its equivalent in the BT
controller
Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
If IUT is acting as a central device and peer lost bond we need
to re-pair to restore bond. PTS is not sending any WID for this
so bonding needs to be initiated implicitly by IUT.
This was affecting GAP/SEC/AUT/BV-25-C qualification test case.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Use the host BIG Sync APIs to test the BIG Sync establish
and Sync Terminate implementation in the controller.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix the bsim test_iso application so as to sync with periodic
adveritising. Increase the timeout so that the test passes.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Construction of BIGInfo with mandatory parameters and
placing it in the ACAD of Periodic Advertising PDU.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added tests to check Broadcast ISO allocations are released
on terminate, and new Broadcast ISO create is successful.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Remove option CONFIG_USB_UART_CONSOLE where it has no influence
or enable CONFIG_SHELL_BACKEND_SERIAL_CHECK_DTR without taking
a detour through CONFIG_USB_UART_CONSOLE.
Check the compatibility of chosen property instead
of usage of CONFIG_USB_UART_CONSOLE option.
Align how to wait for the readiness of CDC ACM UART.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Pushes all work done in the topic-ble-llcp branch into main branch
This is a refactoring of the LL control procedures; the refactored
control procedures are hidden behind a KConfig option and
per default disabled
Goal of the refactoring:
close issue Link Layer Control Procedure overhaul #15256
make it easier to add/update control procedures
Refactoring consists in principal of writing explicit state machines
for the control procedures.
To reduce the risk of regression errors unit-tests have been added
Following control procedures are implemented:
Connection update procedure
Channel map update procedure
Encryption procedure
Feature exchange procedure
Version exchange procedure
ACL termination procedure
Connection parameters request procedure
LE Ping procedure
Data Length Update procedure
PHY update procedure
Min. nr. Of channels used procedure
Constant Tone extension request procedure
This is a joined work by the people listed in the signed-off-by
list (in alphabetical order)
Signed-off-by: Andries Kruithof Andries.Kruithof@nordicsemi.no
Signed-off-by: Erik Brockhoff erbr@oticon.com
Signed-off-by: Piotr Pryga piotr.pryga@nordicsemi.no
Signed-off-by: Szymon Janc szymon.janc@codecoup.pl
Signed-off-by: Thomas Ebert Hansen thoh@oticon.com
Signed-off-by: Tommie Skriver tosk@demant.com
Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
Enable ISO (unicast and broadcast) for the BT shell.
This allows users to use the ISO features (if supported by
the controller) in the shell.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Adds support for reading multiple variable length characteristics.
Previously read_multiple() always set the variable flag to false.
This is used by GATT/CL/GAT/BV-03-C.
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
A FEM in this case is an external Front-End Module. This is basically
a range booster with some extra amplification in the TX and RX paths.
This feature is supported for the Nordic open source controller. See
the changes to the ubx_bmd345eval_nrf52840 board for a quick summary
of what you have to do to take advantage of this.
(This patch doesn't actually remove the feature in the openisa HAL,
though, because that never implemented the required GPIO handling
routines.)
We are using the 'fem' property previously added to the
nordic,nrf-radio's devicetree binding, which points to the FEM that is
in use. If you have this property and the node it points to is
enabled, the controller subsystem respects it. Otherwise, FEM support
is disabled.
This obsoletes the following Kconfig options, which are now unused:
- CONFIG_BT_CTLR_GPIO_PA
- CONFIG_BT_CTLR_GPIO_PA_PIN
- CONFIG_BT_CTLR_GPIO_PA_POL_INV
- CONFIG_BT_CTLR_GPIO_PA_OFFSET
- CONFIG_BT_CTLR_GPIO_LNA
- CONFIG_BT_CTLR_GPIO_LNA_PIN
- CONFIG_BT_CTLR_GPIO_LNA_POL_INV
- CONFIG_BT_CTLR_GPIO_LNA_OFFSET
- CONFIG_BT_CTLR_FEM_NRF21540
- CONFIG_BT_CTLR_GPIO_PDN_PIN
- CONFIG_BT_CTLR_GPIO_PDN_POL_INV
- CONFIG_BT_CTLR_GPIO_CSN_PIN
- CONFIG_BT_CTLR_GPIO_CSN_POL_INV
- CONFIG_BT_CTLR_GPIO_PDN_CSN_OFFSET
The PA and LNA pins are now specified via fem-specific devicetree
properties in the FEM node:
- The "generic" PA/LNA case is handled with the ctx-gpios and
crx-gpios properties of the generic-fem-two-ctrl-pins compatible,
respectively.
- If the fem is an nRF21540, use the tx-en-gpios and rx-en-gpios
properties instead (and also respectively). This allows us to specify
FEM properties in a way that makes sense for the hardware datasheet,
while still handling them in a uniform way within the controller.
We support this in the nRF5 HAL with a new radio_nrf5_fem.h
sub-header, which pulls in radio_nrf5_fem_generic.h or
radio_nrf5_fem_nrf21540.h depending on the fem node's compatible, if
one is defined. These in turn let us replace the implementation
routines in radio.c with DT equivalents.
Keep in-tree users and devicetree binding documentation up to date.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Recently there was added ADI support to periodic advertising.
There was missing implementation of ADI for periodic advertising
chained PDUs and direction finding. Also unit tests for periodic
advertising chains required update to handle ADI field.
The commit provides missing implementation.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit add the BabbleSim tests for the media control client, the
media control service and the media proxy. This is a part of the
upmerge of the le-audio media control files.
These tests have been developed and maintained along with the media
control functionality. The tests are believed to cover all
implemented media control functionality.
The commit is a pure copy of the files and content in the
topic-le-audio branch, with the exception that some include paths have
been modified to correspond to new locations of files and that the
tests have been guarded with ifdefs.
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
test guards
Add entries for media control builds to testcase list. This is a part
of the upmerge of media control from the topic-le-audio branch.
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
Upmerge of the project settings for media control from the
topic-le-audio branch.
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
audio.conf changes
This allows to do directed advertising with peer address set to RPA.
To do this according to specification IUT must first read Central
Address Resolution characteristic to check if peer supports it.
This is affecting GAP/CONN/DCON/BV-05-C qualification test.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Move the header file csis.h from the internal location to
the public include directory. This file is supposed to provide
the public API for CSIS and the CSIS client, but is not fully
complete yet.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Adds the coordinated set identification service (CSIS) client.
This is still a work in progress and thus there are no public
API for it yet, and some code changes will still be needed.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Adds the coordinated set identification service (CSIS) server.
This is still a work in progress and thus there are no public
API for it yet, and some code changes will still be needed.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The mesh shell module owns the composition data for the shell
application, which makes it impossible to use it outside of the
application itself. To support the shell as a generic debugging
component that can be added to any application, we have moved the
composition data out of shell.c, and into the application.
Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
As the already existing macro K_MEM_SLAB_DEFINE results in
two variable definitions, the preceding static modifier leads to
a seemingly working solution, though linkage conflicts will occur
when the same memory slab name is used across multiple modules.
The new K_MEM_SLAB_DEFINE_STATIC macro duplicates the functionality of
K_MEM_SLAB_DEFINE with the difference that the static keywords are
internally prepended before both variable definitions.
The implementation has been tested on my Zephyr project (the build
issue faded out). The documentation has been updated altogether
with all incorrect occurences of static K_MEM_SLAB_DEFINE.
Signed-off-by: Pavel Hübner <pavel.hubner@hardwario.com>
Add iterations of connections and disconnections to
Babblesim test of Bluetooth Low Energy Central role
functionality by scanning for other devices and establishing
connection to upto 62 peripherals with a strong enough
signal.
Enable Auto PHY Update and Auto Data Length Update procedure
in the central_multilink sample.
Enable Auto PHY Update and Auto Data Length Update procedure
in the peripheral_identity sample. Fixed issues related to
rotation of identities after maximum number of connection
iterations are repeated.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add mixed Legacy Directed Advertising and Extended Advertising
test in the babblesim coverage for Extended Advertising
feature.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
bt_conn_unref() requires valid conn pointer but could be called with
NULL in case valid connection was not found in disconnect_eatt_chans().
Fixes#39851
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Migrating the test suites to the register functionality allows the
main.c source to focus on the state of the system instead of "which"
test to run. In this example, test_main() now calls:
* ut_bt_setup() and updates the state
* common_create_adv_set(), updates the state, and notifies the
registered tests that the state has been updated which would trigger
a run.
* common_delete_adv_set(), updates the state, and again notifies
the registered tests that the state has been updated.
Signed-off-by: Yuval Peress <peress@chromium.org>
This allows to track security levels and check for lost bond of peer
peripherals.
This was affecting GAP/SEC/AUT/BV-21-C qualification test.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Move the LE audio configuration to a new audio.conf file
in the bluetooth shell project, similar to the mesh.conf
file.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This allows for better control over IUT behaviour by Upper Tester.
PTS and TS require inconsistent behaviour in terms of how IUT should
return credits. Some tests require return on explicit UT request and
some require that IUT returns credits autonomously.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
PR adds testing of subscription of the tree of extended models.
Extended models should share subscription list among them.
Signed-off-by: Aleksandr Khromykh <Aleksandr.Khromykh@nordicsemi.no>
The receiver and transmitter in the test are synchronized by
use of sleep functions. The change in handling of periodic
advertising synchronized event caused missmach in waiting
times. Receiver is notified about established synchronization
later that it was in the past. Due to that the wait for end
of transmitter operation was too long.
Temporary fix for the problem is decrease of receiver sleep
time by one periodic advertising interval.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
In test cases MESH/NODE/TNPT/BV-04-C and MESH/NODE/TNPT/BI-01-C
the PTS is sending incomplete Seg Ack 3 times and in some cases we run
out of retransmit attempts before PTS sends complete Seg Ack. As a
workaround, increase Segment Retransmit Count to improve stability of
these tests.
Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
In some scenarios when there is a need for multiple re-transmissions of
segmented messages the default value of 2 seconds may be not enough.
In my experience this improves stability of Configuration Client tests
involving multiple PTS instances.
Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
Remove explicit disable of Channel Selection Algorithm #2
in the mesh tests that use Extended Advertising.
Fixes#39188.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This allows UT to reconfigure MTU of a channel and get notfied when
channel configuration changed.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Implement support for Periodic Advertiser List to be used
in LE Periodic Advertising Create Sync command.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add unit tests that will ensure the CTE disable operation does not
cause breaking of LLL operations by too early release of chained PDUs.
The tests verify if numbers of PDUs in free PDUs fifo and free PDUs
memory pool are correct.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Use separate DUT and TST builds in EDTT HCI tests so that
the tester can send Data Length Requests with txOctets and
maxTxTime as required by the test specification. TST build
has HCI parameter checks disabled.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
PR includes test that combines and checks OOB public key
provisioning with all possible OOB authentications
and OOB public key provisioning without auithentication.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
BubbleSim tests that check provisioning with all possible (from spec)
OOB authentications
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
bsim test build system hides compile warnings.
This commit adds extra cc flags to prevent this.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Replace the old whitelist-related terms with the new filter accept list
one from the Bluetooth spec v5.3.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
For ECFC L2CAP test we user overlay with disabled EATT and
bt_eatt_disconnect_one() is available only with EATT enabled.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
The Bluetooth Core Specification, version 5.3, has introduced multiple
changes to several widely-used terms in order to make them inclusive.
Update the public API to reflect this, excluding hci.h, which will be
done in a subsequent commit.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
To test fallback to remaining bearers PTS might request IUT to
disconnect one of the connected EATT channels, while the others remain
intact. Test function must be added, because we cannot create L2CAP
server on EATT PSM and manage this server as normal and have EATT
enabled at same time.
This is affecting GATT/SR/GAW/BV-14-C
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
BTP change extended L2CAP_CONNECT command by ECFC flag, which determines
which connection procedure is used (non-enhanced or ecred). Now, only
this flag determines the procedure used, not number of requested
channels.
This was affecting L2CAP/ECFC/BV-25-C
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
The conn_callbacks was duplicated in the file, due to a missing
delete when BT_CONN_CB_DEFINE was introduced.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
To check security of connection in read_value() we need to actually
pass connection not NULL.
This is affecting GATT/SR/GAR/BI-11-C
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
There was a change in parameters list of function ull_adv_sync_pdu_-
alloc. There was a call in commmon.c file in connectionless_cte_chains
unit tests with use of former parameters list. That caused a compilation
error.
The commit fixes the compilation issue.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Removes all the dead ternary expressions in the mesh bluetooth tester.
Fixes#37983.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Some test cases require the IUT to respond with a certain error. To get
the stack to return this error to PTS the application needs to be
configured specifically for this test case.
Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
This ensures that all mesh settings were removed from persistent storage
after node reset.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This commit adds a test checking that a node removes all data from
persistent storage after being unprovisioned.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Add support for setting initial values in bt_vcs_register_param
when registering a VCS service
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Update the connected ISO API to be more
similar to the broadcast ISO API as well
as the HCI spec.
This updated API allows for more flexibility
and will better support scenarios such as true
wireless setup, as ISO channels and connections
are more independent now.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Reapply the part of 4b5cd92312
that added new functionality/fixed the actual issues described
in the original commit message withtout the further cleanup.
There was also some cross-commit content from
2b91ebe16e
as part of the cleanup in test_friendship.c which is also included.
+ added cleanup also to test_provision.c on request from Aleksandr.
Original commit msg:
-----------
Multiple bsim devices cannot store individual settings
with the existing settings backend for bsim.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
-----------
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
This reverts commit 4b5cd92312.
global_device_nbr is used by many bsim tests.
And many of those are now off tree in preparation of the LE-Audio
work. Removing this for cleanliness now is not nice on others.
=> Revert
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
The test checks the resistance of ble mesh stack to replay attack.
Replay protection cache shall store seqAuth last frames.
Device shall filter out such messages on the transport layer.
Power on\off sequence shouldn't impact that
since replay protection cache is stored in settings subsystem.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Multiple bsim devices cannot store individual settings
with the existing settings backend for bsim.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Add usb.overlay which contains chosen node and cdc-acm-uart node.
Update USB configuration and test case.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The scanner should not cause a device to crash or malfunction
if invalid packets are received.
Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
Increases the friendship unseg app payload size in the friend message
test and enables asserts to test the error described in #37519.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Move to CMake 3.20.0.
At the Toolchain WG it was decided to move to CMake 3.20.0.
The main reason for increasing CMake version is better toolchain
support.
Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Adds a test to check value of the IV Update
counter at the time of provisioning based on
the status of IV Update flag. Also ensures that
the counter is reset if the mesh stack state
is reset.
Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
When device is first provisioned with IV Update
flag is set to 0, it should wait for minimum of
96 hours before going into IV Update In Progress
state. Such limit does not apply, if device is
provisioned with IV Update flag is set to 1.
Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
This commit tests persistence storage for access layer:
- Model publication
- Model subscription
- Model app keys binding
- Model data
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This commits fixes an issue where an existing entry in a settings file
causes settings file corruption when storing new value.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Add unit tests for HCI commands:
- HCI_LE_Set_Connection_CTE_Receive_Parameters,
- HCI_LE_Connection_CTE_Request_Enable.
Tests validate current implementation of commands handling in HCI/ULL.
Handling of the HCI_LE_Connection_CTE_Request_Enable is not complete,
thus tests don't validate positive behavior the functions.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add a little wait before completing the test to ensure both
central and peripheral side of the test completes before the
test exits.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Adds a low_lat name to the duplicated low_lat babblesim tests to allow
them to run in parallel with their counter parts.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Fix failure due to advertising report count being
incremented faster than the wait loop that had longer delay
compared to the received interval of the advertising report.
Fixes#37652.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Currently, with EATT enabled, when bt_gatt_read is called with multiple
handles first it'll try to use gatt_read_mult_vl, and if it fails
gatt_read_mult will be used to try again. Add option to skip
the gatt_read_mult_vl and use gatt_read_mult right away. This is needed
by tests that expect BT_ATT_OP_READ_MULT_REQ but support variable
lenght, thus don't return BT_ATT_ERR_NOT_SUPPORTED.
Removed fallback from read multiple vl to read multiple on
BT_ATT_ERR_NOT_SUPPORTED error.
This was affecting:
GATT/CL/GAR/BV-05-C, GATT/CL/GAR/BI-18-C, GATT/CL/GAR/BI-19-C,
GATT/CL/GAR/BI-20-C, GATT/CL/GAR/BI-21-C, GATT/CL/GAR/BI-22-C
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
Test advertising re-enable to cover reset of event counter,
duration and the number of events.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Bluetooth host may request to send more than one CTE in
connectionless mode. That is relized by periodic advertising
chained PDUs.
To check correctness of implementation of such functionality
new unit tests were added.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
GATT/SR/GAD/BV-03-C will read attr value, but we parse NULL
from `attr->read` which point to `attr_read` function.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
Since Zephyr supports EATT, which is reflected in ICS GATT_2_3
(Enhanced ATT bearer Attribute Protocol Supported (L2CAP fixed EATT PSM
supported) and GATT_2_3a (Enhanced ATT bearer supported over LE)
in GATT tests preamble 4.2.1.4 (Setup EATT Bearer over LE) is used
instead of 4.2.1.2 (Setup ATT Bearer over LE). Let's enable
EATT by default, allowing to run almost all GATT tests without
additional overlay.
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
Adds support for testing of persistence storage
for mesh Babblesim tests. Adds a sample test
for testing provisioning data.
Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
Verify that AD Data when switching to Legacy Directed, and
restore it when switching back to Legacy Non-Directed
Advertising mode.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Some recent updates to the bluetooth shell test cause build failures
in CI for platforms that don't have a uart that supports interrupts
(ie ip_k66f or xmc45_relax_kit).
As these tests are build-only a single platform is sufficient to get
coverage and utilize platform_allow to limit to just one board target
intead of integration_platforms. As this will limit to the single
platform for both PR based CI and nightly CI (integration_platforms
only is utilized for PR based CI, so we'd need other filtering for
the nightly CI and there isn't any value in building these tests
on more than the single platform so platform_allow makes the most
sense).
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Some of the shell tests need a devicetree "fixed-partition" and
"storage_partition" for the settings partition support. Not all
boards support this, so filter the tests on the devicetree having
this.
Fixes#37115
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Babblesim test of Bluetooth Low Energy Central role
functionality by scanning for other devices and establishing
connection to upto 62 peripherals with a strong enough
signal.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
If bsim tests are built without errors then warnings are hidden.
A couple of them has sneaked in recent PRs.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Add a couple of compile tests for the bt shell for
BT audio, including checking that the services can be
compiled individually without error.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Adds a BabbleSim test for provisioning multiple devices in a row. This
scenario had a regression in #33782, which is fixed in #35405.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Align the capitalization of the term "Bluetooth Mesh" to Bluetooth mesh"
in the documentation. This is done to to match the new updated naming
convention done in Bluetooth SIG. In the upcoming spec versions, it its
used "Bluetooth mesh" with the lower case convention.
Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
Tests check transmission, receiving beacons in situations
of IV update (with test mode on) and key refresh procedures.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Updated ISO test to demonstrate ACAD field in periodic
advertising PDUs. Here, test changing the periodic
advertising data.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The purpose of this PR is to automatically test the
host in the native environment.
It is used to simulate /dev/tty*, can replace by /dev/pts/*.
Also, device log will be output to stdio by default.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
Remove the bt_conn pointer from the AICS API, as the
instance pointer is enough to determine if it is a client
and perform client operations on the cached connection pointer.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>