Commit graph

723 commits

Author SHA1 Message Date
Emil Gydesen
df6b5981bf Bluetooth: Audio: depends on GATT instead of select
Modify the Kconfig options to depend on the GATT
features rather than selecting them.

This is part of an effort to reduce the amount of
selects we use in LE Audio.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-21 09:19:47 +01:00
Emil Gydesen
0fa9701a26 Bluetooth: Tester: Added flag parameter to CAP stop cmd
Added a flag parameter so that it is possible
to use the bt_cap_initiator_unicast_audio_stop to perform
disable+stop without releasing the streams by setting the
RELEASE flag.

This allows us to use the bt_cap_initiator_unicast_audio_stop
function to just disable streams without releasing them,
as that is requested by some PTS tests such as
CAP/INI/UST/BV-40-C.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-18 13:18:32 -05:00
Emil Gydesen
1f55b8d8a4 tests: Bluetooth: Tester: Increase conn interval
Increase the conn interval from 30 to 60 for more stability
in test with multiple lower testers (up to 3).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-18 13:18:00 -05:00
Emil Gydesen
f9b5de2d0a tests: Bluetooth: Tester: Set conn = NULL in btp_gap
bt_conn_le_create logs an error if the provided conn is
not NULL. This small change cleans up the log a bit to
avoid the warning.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-16 15:25:41 -05:00
Emil Gydesen
75f5f71200 tests: Bluetooth: Tester: Redefine service IDs as hex
Everything else is defined as hex, so it makes sense to
be consistent. This will also make it easier to find the
service IDs in the logs that primarily already log
commands and events as hex.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-16 15:24:08 -05:00
Emil Gydesen
9a5fa367ba tests: Bluetooth: Tester: Format BTP cmd/evt/rsp logs as hex
Since the values are defined as hex, e.g. 0x82, it is easier
to compare with the log if they also log them as such.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-16 15:24:08 -05:00
Emil Gydesen
8386929944 tests: Bluetooth: Tester: Log conn changes
Log the address and the err/reason values in the connected
and disconnect callbacks.

Since these values are not part of the BTP events it is
difficult to follow the order and reason why disconnects
happen when debugging.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-16 14:56:51 -05:00
Emil Gydesen
8703381764 Bluetooth: Host: Add conversion macros from ms to various units
Add conversion macros from milliseconds to various units.
The purpose of these macros is to make it more clear/easier
for users to set and read values using milliseconds rather
than the various BT units which may be in 0.625, 1.25 or 10ms
units.

This is especially useful when comparing related values using
different units, such as advertising interval (0.625ms units)
and periodic advertising interval units (1.25ms units).

Users will have to be aware that these macros can provide slightly
different values than what is provided, if the provided values
do not match the units.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-16 14:06:03 -05:00
Nidhal BEN OTHMEN
a199f7f9d3 tests: bluetooth: tester: Fix bluetooth tester for nucleo_wba55cg
Fix compilation error by specifying usart1 to be used for uart-pipe.
Add a board-specific configuration file to disable the console,
so, the usart1 will be used only for bluetooth and to specify
the BT_HCI_TX_STACK_SIZE.

Signed-off-by: Nidhal BEN OTHMEN <nidhal.benothmen@st.com>
2024-11-16 13:29:39 -05:00
Vinayak Kariappa Chettimada
525ba389bc tests: Bluetooth: tester: Workaround Bus Fault in nRF53x using full RAM
Workaround failing autopts weekly run due to tester
application having Bus Fault in the nRF53 NET core hci_ipc
firmware at startup.

Having atleast 32 bytes free in nRF53x hci_ipc sample to
avoid Bus Fault when Zephyr Kernel does SYSINIT calls.

Reduce supported ISO Broadcaster instance and ISO TX buffer
counts in the Controller hci_ipc firmware.

Add sysbuild support for tester application so that the
build is CI verified.

sysbuild commandline for LE audio PTS testing:

  # west build --sysbuild -b nrf5340_audio_dk/nrf5340/cpuapp
    -d build/tester tests/bluetooth/tester
    -DEXTRA_CONF_FILE="overlay-le-audio.conf"

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-11-08 09:25:28 -06:00
Emil Gydesen
5ebe1194be tests: Bluetooth: Tester: Fix use of uninitialized cig_id for CAP
The CAP tests used u_group->cig->index but the u_group->cig may
have been deleted when the stream is released, which meant
that u_group->cig == NULL when e.g. unicast_stop_complete_cb
was called and that could cause failing tests as the index
would just be a uninitialized value.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-31 09:23:16 -05:00
Emil Gydesen
3a8ce6efb4 tests: Bluetooth: tester: Add logging of messages for BTP
Add log statements for each command, event and response
for debugging purposes.

Tests do not send enough of these to clutter the IUT logs
and it is useful for debugging to more easily determine
what command triggered a function call or when the
responses and events are sent to the AutoPTS client.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-30 14:27:23 -05:00
Emil Gydesen
1dd59ea203 Bluetooth: Audio: Remove BT_AUDIO_BROADCAST_CODE_SIZE
Removed the LE Audio specific definition and instead
refer to the value defined by iso.h as it is ISO/Core
that defines this size, and not BAP/Audio.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-25 22:43:40 +01:00
Fredrik Danebjer
f970b066d2 Bluetooth: audio: Add possibility to use static broadcast id
Removed the generation of broadcast id inside the stack. It is now up
to the application to generate this by itself. The CAP sample has
been modified to allow either a static broadcast, or a random one.
All of this is handled in the application.

Signed-off-by: Fredrik Danebjer <frdn@demant.com>
2024-10-25 14:07:25 +02:00
Abderrahmane Jarmouni
94b000591d tests: testcase.yaml: replace deprecated OVERLAY_CONFIG w\ EXTRA_CONF_FILE
Replace some OVERLAY_CONFIG that were missed in a pervious PR.

Signed-off-by: Abderrahmane Jarmouni <git@jarmouni.me>
2024-10-24 14:06:54 +02:00
Babak Arisian
7f820d59c0 Bluetooth: Audio: Update SCAN_DELEGATOR dependency to GATT_DYNAMIC_DB
Changed dependency of the BT_BAP_SCAN_DELEGATOR to GATT_DYNAMIC_DB
from 'select' to 'depends on' and solved all loop dependencies
caused by this change.

Fixes #79108

Signed-off-by: Babak Arisian <bbaa@demant.com>
2024-10-23 16:53:37 +02:00
Emil Gydesen
afb7d961d2 tests: Bluetooth: tester: Add nRF5340 ADK as platform
Add support for building and running the BT tester on the
nrf5340_audio_dk.

This is copying the configuration used for the nRF5340 DK.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-22 20:39:30 +02:00
Szymon Janc
298c01cb97 Bluetooth: Tester: Set ISO MTU to 310
This makes sure we always fit all configurations. Worst case is two
audio streams in 48_6 configuration in single ISO channel (2x155).

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2024-10-22 14:05:31 +02:00
Szymon Janc
5453acb9b7 Bluetooth: Tester: Fix BTP response for BAP Send Data command
struct btp_bap_send_rp is already fixed size and contain extra
response byte.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2024-10-22 14:05:31 +02:00
Szymon Janc
3e5472d4c3 Bluetooth: Tester: Send test data when entering streaming state
For now this seems to be required by PTS as there is not Upper Tester
action for this in Test Specification.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2024-10-22 14:05:31 +02:00
alperen sener
a5010504bc tests: bluetooth: tester: Add nrf54l15dk and remove nrf54l15pdk
Rename the config files according to nrf54l15dk.

Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
2024-10-16 16:35:32 +01:00
Szymon Janc
4a3807789d bluetooth: tester: Enable support for writable appearance
This was affecting GAP/GAT/BV-06-C qualification test.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2024-10-15 13:53:03 +02:00
Emil Gydesen
730b2f7c69 Bluetooth: Tester: Force initial conn param to 30ms
Modify the GAP connect to use 30ms. The default parameters
typically ended up with 50ms which is OK in most cases,
but for ISO related test cases, using an ACL interval that
is a multiple of the ISO SDU interval (7.5/10ms) generally
provides better stability. 30ms is the lowest multiple
of both 7.5 and 10ms, and was thus chosen.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-15 04:06:53 -04:00
Lars Knudsen
e0a262b33f Bluetooth: Audio: Fix initial Broadcast source values
If the Broadcast ID is initially set to 0x000000,
which is valid, comparison logic on add of an
actual Broadcast ID of 0x000000 fails.

Likewise for SID.

Moving INVALID_BROADCAST_ID define to bap.h

Signed-off-by: Lars Knudsen <LAKD@demant.com>
2024-10-14 13:04:31 +02:00
Aleksander Wasaznik
8cfad44852 Bluetooth: Deprecate adv auto-resume
The host-based adv auto-resume function has both a problematic
implementation and disagreement in the community around how it should
behave. See the issue linked resolved below for details.

This patch makes the deprecation visible to the user. The user will be
better served by a auto-resume tailored their applications use case,
based on more primitive host API like `conn_cb.recycled`, which has
obvious behavior that is unlikely to change.

Resolves: https://github.com/zephyrproject-rtos/zephyr/issues/72567

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-10-08 16:57:01 +02:00
Frode van der Meeren
29b78abd16 bluetooth: tester: audio: Add verification for bis stopping
Adds a semaphor to make sure the stream has properly been stopped by the
controller before returning from btp_bap_broadcast_source_stop.

Signed-off-by: Frode van der Meeren <frode.vandermeeren@nordicsemi.no>
2024-10-07 13:39:33 +02:00
Emil Gydesen
dc97bbd35f Bluetooth: Audio: Rename bt_audio_codec_qos -> bt_bap_qos_cfg
The QoS structure is not related to a codec, but rather a
stream, and should thus not use the "Codec" name.

The BAP and ASCS specs refer to the QoS as
"QoS configuration" several places, so it is an obvious
choice for a name.

Since the structure is defined and used by BAP, the prefix
was changed from bt_audio to bt_bap.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-04 16:34:22 +01:00
Emil Gydesen
a4d628efcb tests: Bluetooth: tester: Implement TBS registration
TBS registration was changed from static to dynamic
and the BT Tester application need to be updated to use
the dynamic registration.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-04 10:47:03 +01:00
Håvard Reierstad
8049c24994 Bluetooth: Mesh: Add prefix to Subnet Bridge API
Adds the `bt_mesh_brg_cfg` prefix to the public Subnet Bridge API, and
aligns the function and callback naming with the rest of the Bluetooth
Mesh API.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-10-02 14:54:13 +01:00
Emil Gydesen
fa4f2ffc47 Bluetooth: CAP: Add support for doing just disable for unicast stop
The unicast_stop function is changed to primarily do a
BAP disable instead of a release, with optional
support for releasing the streams once they have been disabled.

This also adds unittests for the procedure which also
allow us to remove the invalid param testing from the BSIM tests.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-01 09:54:04 +02:00
alperen sener
9ae8ebfade Tests: Bluetooth: Tester: Increase the number of max mesh tx segments
Increasing the number of max tx segments to be able to fit composition
page 0 into composition data status message.

After the subnet bridge config client and server are added to the
tester, the size needed to report composition data page 0 increased.
Current behaviour of the tester is correct, dropping the element when
there is not enough space in data field, however the PTS application
does not handle the composition data status message without element.

Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
2024-09-30 17:12:34 +01:00
Babak Arisian
c0cfe49a54 Bluetooth: BASS: Add support for dynamic registration of BASS
Added support for dynamic registration and unregistration of the
Broadcast Audio Scan Service (BASS) within the scan delegator.
This enables both scan delegator and BASS to be registered or
unregistered dynamically at runtime.

Signed-off-by: Babak Arisian <bbaa@demant.com>
2024-09-26 17:42:39 -04:00
Alberto Escolar Piedras
66a70a2ffd tests/bluetooth: Don't test on native_posix
native_posix is now deprecated.
Building these tests in both native_sim and native_posix does not
improve coverage for the tests or subsystem but doubles CI time.
As anyhow native_posix will be removed all together in
2 releases, let's remove it already for these.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-09-25 04:04:36 -04:00
Emil Gydesen
f57a040808 Bluetooth: BAP: Add bondable requirement for BAP
BAP mandates support for bondable mode for all central and
peripheral roles.

Due to Kconfig circular dependencies, some additional
Kconfig changes had to be made.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-09-19 18:27:53 +01:00
Emil Gydesen
ae58f474a1 Bluetooth: VCP: Vol ctlr rename flags to vol_flags
Rename the volume flag field from the generic "flags"
to "vol_flags" as the generic "flags" will be used for
other values in a future commit.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-09-17 14:52:37 -04:00
Ingar Kulbrandstad
d41e834bbe tests: bluetooth: mesh: Removed native_posix and renamed sim_ids
Removed deprecated native_posix as test platform.
Added unique sim_ids for tests with the psa as a overlay.
Fixed clang-format issues.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Pavel Vasilyev
76f015b61f bluetooth: mesh: brg_cfg_cli: copy buf in synchronous api
When a synchronous API is used, the content of `buf` will not be
valid by the time the thread that called the synchronous API is woken up
again.

Therefore, the simplest way to solve this is when a user allocates the
buffer which will be filled up with the content of the buffer passed to
the model callback.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Ingar Kulbrandstad
21fa5c81d2 Bluetooth: Tester: Mesh: Added support for Bridge client/server
Added support for the Bridge Configuration client and server
to the tester application.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Emil Gydesen
eb22e1fc98 Bluetooth: TBS: Make GTBS mandatory
Any places that checked for GTBS is now always enabled
as GTBS is mandatory to support, and the Kconfig option
was removed.

Also removed a duplicate Kconfig option for TBS,
BT_TBS_SERVICE_COUNT, as it was unused.

The other Kconfig option BT_TBS_BEARER_COUNT is used
instead exclusively to set it if needed.

Since GTBS can now exist alone, it must also
support having its own calls and other values.
This means that the GTBS and TBS instances now share
the same underlying struct.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-09-17 09:45:48 +02:00
Fredrik Danebjer
c9da274eb2 Bluetooth: ascs: Add dynamic ASE registration
Added option to set the ASE count through the bap API, making ASE
configuration runtime available. The upper limit of ASEs are still
bound by the Kconfig options set for ASEs.

Signed-off-by: Fredrik Danebjer <frdn@demant.com>
2024-09-11 07:41:12 -04:00
Henrik Brix Andersen
159f7dbbb1 lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h
Move the network buffer header file from zephyr/net/buf.h to
zephyr/net_buf.h as the implementation now lives outside of the networking
subsystem.

Add (deprecated) zephyr/net/buf.h header to maintain compatibility with old
file path.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2024-09-07 11:19:05 -05:00
Emil Gydesen
57b35e1047 Bluetooth: TBS: Allow multiple callbacks for client
The TBS client callbacks are just informative so we
provide the information to multiple listeners.

To support this for the long strings, the function
handle_string_long_read was refactored.

This also allows for multiple users of the TBS client.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-09-05 12:24:47 +01:00
Szymon Janc
ad0c1e12f6 tests: bluetooth: tester: Fix buffer sizes on nRF5340
This was affecting multiple CAP/INI/UST qualification tests.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2024-09-02 12:30:06 -04:00
Emil Gydesen
3e9197a58a Bluetooth: Mesh: Rename mesh test primitives
Since testing.c/h was moved to mesh, all functions and
structs in those files now follow a bt_mesh_test_*
naming scheme to be consistent with the naming in Zephyr.

Due to missing includes in many files, this commit also
added some that were missing in order to build since
the order of includes have changed.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-08-27 15:14:08 -04:00
Emil Gydesen
f1b182b585 Bluetooth: Mesh: Move testing.h to mesh subsys instead of include
The file is only ever used by mesh and it is even stated in the
header of the file that it is internal APIs.

The include file has been merged with the host testing.h file
as that was mesh specific as well. Similarly the testing.c
file was also moved

This is part of a process to clean up the file structure of
Bluetooth as it's a bit messy, which is evident from the
MAINTAINERS.yml file.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-08-27 15:14:08 -04:00
Szymon Janc
d9f348962c tests: bluetooth: tester: Fix BTP_BAP_BROADCAST_SINK_BIS_SYNC command
After recent changes to BIS bitfield it is no longer required to adjust
BIS Index bitfield.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2024-08-22 14:23:05 -04:00
Szymon Janc
6d19bcf333 tests: bluetooth: tester: Fix user_data size in pools
There was hardcoded value for user_data which is no longer valid.
Use proper CONFIG_BT_CONN_TX_USER_DATA_SIZE for that.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2024-08-21 18:27:37 +01:00
Chang An
e8db417a00 LE Audio: add conn parameter for bt_vcp_vol_rend_cb
Add conn parameter to status/flags callbacks of bt_vcp_vol_rend_cb
to differentiate between remote and local changes.

Signed-off-by: Chang An <chang.an_1@nxp.com>
2024-08-20 14:45:35 +02:00
Aytürk Düzen
5f00c18005 tests: bluetooth: tester: add nrf54h20 configs
Added:
nrf54h20dk_nrf54h20_cpuapp.overlay: Choose uart136 hwfc 115200
nrf54h20dk_nrf54h20_cpuapp.conf

Signed-off-by: Aytürk Düzen <ayturk.duzen@nordicsemi.no>
2024-08-20 14:44:44 +02:00
Guotao Zhang
28093cc4ef Bluetooth: tester: Increase the adv buf size to consider the extend adv
[Description]
Device hang is observed when LE Scan
[Root Cause]
For le_ext_adv_report, Data[i] of one adv report is 0-229,
for the adv_buf of saving, it just is 73 bytes, so sometimes
the bytes of adv report is more than the adv_buf, resulted hang
[Fix]
consider the le ext adv case.
[Testing]
After modified, Device hang is not observed after stress
testing with LE Scan

Signed-off-by: Guotao Zhang <guotao.zhang@nxp.com>
2024-08-05 16:29:36 +02:00