Commit graph

723 commits

Author SHA1 Message Date
Emil Gydesen
9d4cc4b49b Bluetooth: BAP: Add a set of suggested intervals to use with BAP
Add a selection of interval values that are suitable for BAP,
which will allow better coexistence between ISO and ACL,
for both broadcast and unicast. Some of these are defined
by the BAP spec, and some are defined by Zephyr, since they
do have a suggested value from BAP.

Samples and tests have been updated to use these new values.
Peripheral samples have also been updated with
CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS so that the connection
parameters from the centrals aren't updated to something else
shortly after.

The shell has also been updated to use the LE Audio (BAP) values
if audio is enabled, and the audio.conf file has disabled automatic
updating of the connection parameters as the peripheral, as we rarely
(if ever) want to do that.

Due to the connection interval change, CI hit an issue
with test_bass_broadcast_code in test_main_client_sync, where
the reading of the long receive state did not finish before we
attempted to do another procedure, so the function was updated to have
a retry.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-11 08:58:51 +01:00
Graham Wacey
fb620ef59c tests: bluetooth: tester: Implement BAP/BSRC/SCC/BV-38-C
- Make ext_adv and per_adv into arrays for multiple BIGs
 - Create bap_broadcast-source_setup_v2 command
  - Handles broadcast_id as an input

Signed-off-by: Graham Wacey <graham.wacey@nordicsemi.no>
Signed-off-by: Alexander Svensen <alexander.svensen@nordicsemi.no>
2025-03-10 11:09:57 +01:00
Alexander Svensen
6d19fc2b86 tests: bluetooth: tester: Make brcst_source_stop synchronous
- Add semaphore to make sure source is stopped before proceeding
- This ensures source can be released after this command is finished

Signed-off-by: Alexander Svensen <alexander.svensen@nordicsemi.no>
2025-03-07 19:53:44 +01:00
Théo Battrel
75885e81de Tests: Bluetooth: Fix stack overflow for tester
Increase value of `CONFIG_BTTESTER_BTP_CMD_THREAD_STACK_SIZE` for
nrf54L15 board to avoid stack overflow.

Remove the config in the Mesh overlay as it's was also added for nrf54L15.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2025-02-28 18:30:08 +01:00
Szymon Janc
c20bd87d3d tests: bluetooth: tester: Fix invalid checks in oob_data_request
CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY disables all but legacy OOB
pairing (including LE SC) and is not intended for enabling/disabling
support for legacy OOB pairing. bt_le_oob_set_legacy_tk() depends on
CONFIG_BT_SMP_SC_PAIR_ONLY so just use same check here.

For BT_CONN_OOB_LE_SC only supported way to disable LE SC OOB is
to force BT_SMP_OOB_LEGACY_PAIR_ONLY which disables all pairing
except legacy OOB support.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-02-26 15:05:33 +01:00
Evgenii Kosenko
4a16d62e56 bluetooth: tester: btp: adds testcase tester legacy adv
Adds testcase to build tester with forced legacy advertisements,
CONFIG_BT_EXT_ADV=n.

Signed-off-by: Evgenii Kosenko <Evgenii.Kosenko@silabs.com>
2025-02-18 18:37:59 +01:00
Evgenii Kosenko
d8f8dd4c14 bluetooth: tester: btp: refactors periodic adv selection
Takes in use IS_ENABLED as preferred way of guarding Kconfig option for
enabling periodic advertising api, CONFIG_BT_PER_ADV. It enables compiling
guarded code get warning/errors and not link it if not used.

Signed-off-by: Evgenii Kosenko <Evgenii.Kosenko@silabs.com>
2025-02-18 18:37:59 +01:00
Evgenii Kosenko
1633f98e26 bluetooth: tester: btp: refactors LE secure pairing selection
Takes in use IS_ENABLED as preferred way of guarding Kconfig option for
enabling legacy LE secure pairing, CONFIG_BT_SMP_SC_PAIR_ONLY. It enables
compiling guarded code get warning/errors and not link it if not used.

Signed-off-by: Evgenii Kosenko <Evgenii.Kosenko@silabs.com>
2025-02-18 18:37:59 +01:00
Evgenii Kosenko
0b2fbf9903 bluetooth: tester: btp: fixes ext adv selection
Disabling extended advertising, CONFIG_BT_EXT_ADV, fails to compile cause
references not guarded ext_adv variable when tester_gap_create_adv_instance
is called. Fixes by taking in use IS_ENABLED as preferred way of guarding
Kconfig option. It enables compiling guarded code to get warning/errors and
not to link if not used.

Signed-off-by: Evgenii Kosenko <Evgenii.Kosenko@silabs.com>
2025-02-18 18:37:59 +01:00
Evgenii Kosenko
bf7dfc5e8d bluetooth: tester: btp: refactors privacy selection
Takes in use IS_ENABLED as preferred way of guarding Kconfig option for
enabling privacy, CONFIG_BT_PRIVACY. It enables compiling guarded code get
warning/errors and not link it if not used.

Signed-off-by: Evgenii Kosenko <Evgenii.Kosenko@silabs.com>
2025-02-18 18:37:59 +01:00
Evgenii Kosenko
fed5561130 bluetooth: tester: btp: refactors OOB legacy selection
Takes in use IS_ENABLED as preferred way of guarding Kconfig option for
forcing OOB legacy, CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY. It enables
compiling guarded code get warning/errors and not link it if not used. If
def macro is left in btp_handler structure to reduce code size when the
config is not present.

Signed-off-by: Evgenii Kosenko <Evgenii.Kosenko@silabs.com>
2025-02-18 18:37:59 +01:00
Emil Gydesen
907261b619 Bluetooth: BAP: Remove GATT_CACHING req for unicast server
The unicast server does not need GATT caching and it was likely
incorrectly added earlier as a dependency.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-14 19:15:57 +00:00
Steffen Jahnke
16c4b6a51a tests: Add necessary configurations for PAN B511 EVB
Running tests for PAN B511 evaluation board needs additional
configuartion.

Signed-off-by: Steffen Jahnke <steffen.jahnke@eu.panasonic.com>
2025-02-14 10:47:54 +01:00
Pavel Vasilyev
6c35d372dd tests: bluetooth: tester: mesh: Increase CMD tx bufs
Increase CONFIG_BT_BUF_CMD_TX_COUNT to avoid deadlock when running out
of buffers. See #77241 for the reference.

This fixes Mesh Provisioning Service tests (MESH/NODE/MPS).

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-02-12 16:05:45 +01:00
alperen sener
3cab4fe0dc tests: bluetooth: tester: Make BTP CMD thread stack size kconfig
Different test layers need different stack sizes for BTP CMD thread
and also AutoPTS might need to overwrite this config based on test
case.

Increase the stack size for mesh tests.

Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
2025-02-12 16:04:48 +01:00
Emil Gydesen
49d9b4cb69 Bluetooth: PACS: Remove BAP infix for pacs_register_param
Since the PACS service is not part of the bt_bap API it should
not use the bt_bap prefix, and instead just be bt_pacs like the
rest of the PACS API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-12 09:41:49 +01:00
Frode van der Meeren
913012ab81 tests: bluetooth: tester: Add PBP support
Implements the PBP commands of the BTP specs, in order to support
testing the PBP through autopts. This PR is in conjunction with the
following PR in AutoPTS: https://github.com/auto-pts/auto-pts/pull/1356

Signed-off-by: Frode van der Meeren <frode.vandermeeren@nordicsemi.no>
2025-02-11 11:43:51 +00:00
Ludvig Jordet
ce4bab5662 Tests: Bluetooth: Add hci_ipc config to Twister integration
This adds the configuration used when running PTS tests with hci_ipc to
the testcase.yaml, so they are built on integration by CI, avoiding
regression.

Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
2025-02-06 14:46:02 +01:00
Emil Gydesen
d9ab2eb353 tests: Bluetooth: Tester: Add missing PACS register
PACS needs to be dynamically registered which was
missing from the BT Tester.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-01-29 12:51:57 +01:00
Szymon Janc
24abac1207 tests: Bluetooth: Tester: Improve BTP MTU validation
Make sure MTU is validated to avoid reading pass command buffer.
Also make more explicit check in response length validation.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-01-27 17:08:54 +01:00
Szymon Janc
aff2875d21 tests: Bluetooth: Tester: Avoid union with packed structure
This may cause some compiler warnings due to flexible array being
used in btp_hdr. Simply avoid it and do explicit pointer type cast
where needed.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-01-27 17:08:54 +01:00
Johan Hedberg
09e86f3b69 Bluetooth: Host: Remove HCI ECC emulation
Remove the HCI command & event emulation layer for ECDH commands and
events. This means that we always do the necessary operations in the host.
The existing BT_ECC Kconfig option stays, but now gets automatically
enabled when necessary (e.g. based on the BT_SMP option), which is why this
commit removes so many explicit assignments in prj.conf files.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-01-23 10:14:46 +01:00
Emil Gydesen
176676d81f tests: Bluetooth: Tester: Reorder btp_buf to fix variable array
The `btp_hdr` needs to be last in the struct, as it has
a variable length array (data[]).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-01-21 11:12:02 +01:00
alperen sener
35aea49096 tests: bluetooth: tester: Increase number of PSA key slots for mesh
MESH PTS tests require different number of keys, as an example; only
one netkey requires 8 key slots and there are test cases that use at
least two netkeys which consume the default 16 slots, so it is better
to have enough slots all times. Setting slot count to 32.

Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
2025-01-14 13:38:15 +01:00
Emil Gydesen
48ac31c7a2 Bluetooth: TMAP: Remove double definitions of TMAP roles support
Both the TMAP kconfig file and public header file defined
which roles were supported.

The Kconfig file options were recently added and were more
up to date (and correct), and allows for other Kconfig files
to use these values, thus allowing for more flexibility when
implementing applications.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-01-09 15:49:10 +01:00
Emil Gydesen
e45830893f Bluetooth: CCP: Introduce new CCP API
The CCP API for the Call Control Profile works on top of the
TBS API, and will eventually replace parts of the TBS API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-01-08 07:50:32 +01:00
Emil Gydesen
fb1fcec983 tests: Bluetooth: Tester: More logging and verification for ISO RX
Add additional data to the logs and only send the event once we have
receive a successful SDU.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-12-27 14:09:29 +01:00
Emil Gydesen
2b197aff02 Bluetooth: BAP: Modify range of BT_BAP_BROADCAST_SNK_SUBGROUP_COUNT
The range of BT_BAP_BROADCAST_SNK_SUBGROUP_COUNT should be relative to
BT_BAP_BASS_MAX_SUBGROUPS. The broadcast sink depends on the scan
delegator, and thus it does not make sense for the broadcast sink
to support more subgroups than what the scan delegator supports.

Since this no longer relates to the number of streams, there
may be new runtime errors if applications attempt
to sync to more subgroups than the number of ISO channels
supported.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-12-27 12:36:40 +01:00
Valerio Setti
3fa522c720 tests/samples: remove ENTROPY_GENERATOR from BT related tests/samples
Since now Mbed TLS automatically selects ENTROPY_GENERATOR (or the
test generator, depending on the platform) we can remove this dependency
from all BT related tests and samples.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-19 17:53:37 +01:00
Emil Gydesen
62f90c62ab tests: Bluetooth: Tester: Refactor audio TX
Instead of relying on the bap_send_cmd and a ring buffer,
the tester will now automatically start transmitting on
streams can that transmit once they enter the streaming state,
and stop again once once they leave the streaming state.

This ensures that we are always sending, which help pass
the PTS tests that require us to send, without having the
autopts client constant telling the tester to send.

This also ensures that we actually send SDUs of the right size
by not relying on a ring buffer, but using a separate thread
that sends data from a predefined array of ISO mock data.

This is easily expandable to multiple streams (including a mix
of unicast and broadcast) using different SDU sizes and easy to
expand to also use one or more software codecs.

The design is based on the TX thread for the BAP Unicast
Client sample and the audio babblesim tests.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-12-17 17:53:23 +01:00
Valerio Setti
a4b9ef69c3 Revert "samples/tests: bluetooth: remove ENTROPY_GENERATOR selection"
This reverts commit 30f6dc43bab8ae1f26497eb000ff1ab4fb379c00.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-12 00:15:39 +00:00
Emil Gydesen
2b93e6b40e tests: Bluetooth: tester: Improve BAP adv intervals
Modify the extended and periodic interval to be values that
are more suited for audio as they are multiple
of the expected resulting ISO interval.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-12-11 21:32:45 +01:00
Chang An
90ff9c0883 Bluetooth: tester: enable VCS volume flags notify
[Description]
PTS case: VCS/SR/SGGIT/CHA/BV-03-C fail.

[Root Cause]
VCS/SR/SGGIT/CHA/BV-03-C require Volume Flags Characteristic properties
(Read/Notify), but tester volume flags notify is disabled by default.

[Fix]
add CONFIG_BT_VCP_VOL_REND_VOL_FLAGS_NOTIFIABLE=y in
tests/bluetooth/tester/overlay-le-audio.conf

[Testing]
After modified, VCS/SR/SGGIT/CHA/BV-03-C pass with log:
Test Case Ended	VCS/SR/SGGIT/CHA/BV-03-C	PASS	24	 00:00:01.010000
12/9/2024 11:31:55.027000 AM

Signed-off-by: Chang An <chang.an_1@nxp.com>
2024-12-11 08:01:20 +01:00
Axel Le Bourhis
5dfd41e51a nxp: combine MONOLITHIC_BT and MONOLITHIC_IEEE802154
Combine BLE and 802.15.4 monolithic build under a single config to make
it less error prone.
The choice between a BLE/802.15.4 combo firmware and a BLE only firmware
is done depending on the Soc (like RW610 vs RW612).

Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
2024-12-10 11:11:38 +01:00
Valerio Setti
8564df571a samples/tests: bluetooth: remove ENTROPY_GENERATOR selection
ENTROPY_GENERATOR is now automatically enabled if the board
has "zephyr,entropy" chosen property set, so there is no need
to manually select it.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-10 08:05:33 +01:00
Emil Gydesen
e12096ee4a tests: Bluetooth: Tester: Increase RTT_MESSAGE_SIZE
Sets CONFIG_LOG_BACKEND_RTT_MESSAGE_SIZE=256 as some log
messages are longer than 128 (default) and may be truncated
with the existing configuration and implementation.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-12-06 15:17:55 +01:00
Alexander Svensen
49e5a0dc5a bluetooth: tester: audio: Add NULL checks
- Add NULL checks for broadcast_source_stop
- Add NULL checks for broadcast_source_release
- Return -ESRCH if trying to stop ext_adv before creation

Signed-off-by: Alexander Svensen <alexander.svensen@nordicsemi.no>
2024-12-06 12:13:03 +01:00
Sergey Korotkov
2ee0e38929 Bluetooth: Host: more secure defaults for key size and legacy pairing
Default the Minimum encryption key size to 16.
Key with reduced size is easier to brut force.
Disable LE legacy pairing by default since it's not secure.

These defaults should suite majority of newly developed applications.
It's better to use sensible more secure defaults,
so applications that really need less secure option consciously change it,
not the other way around.
This may help to prevent downgrade attacks.

Signed-off-by: Sergey Korotkov <sergey.korotkov@nordicsemi.no>
2024-12-04 12:10:54 +01:00
alperen sener
b78eea256b Tests: Bluetooth: Tester: Mesh DFUM and BLOB should have own elements
Moving the blob client, dfd server and dfu server to their own
elements and increasing the CONFIG_BT_MESH_TX_SEG_MAX to 8 to fit
new composition data into composition data page status message.

Standalone mesh blob client and DFU distributor/update server models
requires one element and those elements only contain the main models
and the models they extend to.

Referring to MshMBT_v1.0 Section 6.1:
The BLOB Transfer Client model defines the messages listed in Table 6.1
, and requires one element: the BLOB Transfer Client Main element. The
BLOB Transfer Client Main element contains the BLOB Transfer Client
main model.

And referring to MshDFU_v1.0 Sections 6.1.1 and 6.2.1:
6.1.1
The Firmware Update Server model adds the state instances listed in
Table 6.1 and Table 6.2 and the messages listed in Table 6.3 to the
model it extends, and requires one element: the Firmware Update Main
element. The Firmware Update Main element contains the Firmware Update
Server main model and all the models that the main model extends.
6.2.1
The Firmware Distribution Server model adds the state instances listed
in Table 6.7 and Table 6.8 and the messages listed in Table 6.9 to the
model it extends, and requires one element: the Firmware Distribution
Main element. The Firmware Distribution Main element contains the
Firmware Distribution Server main model and all the models that the
main model extends.

Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
2024-12-04 09:23:44 +01:00
Valerio Setti
55c0b2ea45 tests: bt: enable entropy sources where missing
Moving from TinyCrypt to PSA Crypto API caused an entropy source
to be always required, so this commit adds it in tests where
necessary.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-27 16:40:47 -05:00
Valerio Setti
f4592382bb bt: use PSA for HCI ECC and rename BT_TINYCRYPT_ECC
This commit sets PSA Crypto API as the default library to perform
ECC-DH in HCI, replacing TinyCrypt (which is being deprecated).
Therefore the symbol BT_TINYCRYPT_ECC is renamed as BT_SEND_ECC_EMULATION.
References in samples/tests are also fixed.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-27 16:40:47 -05:00
Théo Battrel
66ff97e69b Bluetooth: Host: Deprecate BT_BUF_ACL_RX_COUNT symbol
Because the number of ACL RX buffers must be at least the number of
maximum connections plus one, increasing `CONFIG_BT_MAX_CONN` could
inadvertently lead to a build failure if the number of ACL RX buffers is
not also increased. This dependency may not be obvious to users.

To address this issue, this commit deprecates the
`CONFIG_BT_BUF_RX_COUNT` Kconfig symbol and computes the value in
`buf.h` using the new `BT_BUF_RX_COUNT` define. Note that the default
value and the minimum range value have been changed to 0 to "disable"
the option.

Additionally, to allow users to increase the number of ACL RX buffers,
this commit introduces the new `CONFIG_BT_BUF_RX_COUNT_EXTRA` Kconfig
symbol. The value of this symbol will be added to the computed value of
`BT_BUF_RX_COUNT`.

The configurations of tests and samples have been updated to reflect
these changes.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-11-27 10:30:59 +01:00
Aytürk Düzen
55bc3acf58 tests: bluetooth: tester: make hci_ipc confs generic for multi-core
nrf5340_hci_ipc.conf and nrf5340_hci_ipc_cpunet.conf were board specific
rename them for generic multi-core board support

Signed-off-by: Aytürk Düzen <ayturk.duzen@nordicsemi.no>
2024-11-27 08:16:50 +01:00
Aleksander Wasaznik
18fd49ea0e Bluetooth: Tester: Increase config values to make tests pass
Without this PTS tests do not pass. These values are copied from a
commit aimed at unifying the prj.conf files in this directory. I do not
know which of these are strictly necessary to make the tests pass.
Copying them all poses no harm since the unification will be done later
anyway.

Co-authored-by: Szymon Janc <szymon.janc@codecoup.pl>
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-11-27 08:16:18 +01:00
Aleksander Wasaznik
5a8daffc32 Bluetooth: Tester: Use BT_L2CAP_SEG_RECV for L2CAP tests
This API gives better control on L2CAP COC credits and suits better
for Upper Tester implementation.

Co-authored-by: Szymon Janc <szymon.janc@codecoup.pl>
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-11-27 08:16:18 +01:00
Emil Gydesen
322b177549 samples: Bluetooth: Reduce heap for hci_ipc
Reducing the heap requirement for the hci_ipc sample from
8KiB to 4KiB. It has been tested in various configurations to
work with 2300, but 4KiB was used to provide some leeway for
future updates.

The heap requirement is not documented, and it is unclear why
values lower than 2300 (not exact number) won't boot, and should
be investigated further.

Memory has become a very scarce resource for especially the ISO
builds for the nRF5340, which is why this is getting reduced.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-25 21:52:15 +01:00
Emil Gydesen
c4fbe38219 Bluetooth: BAP: Depend on BT_PER_ADV_SYNC instead of select
Change the select of BT_PER_ADV_SYNC and BT_EXT_ADV to
depends on. This is an effort to reduce the use of
select for Kconfig options.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-21 09:19:47 +01:00
Emil Gydesen
4c86a5cc8d Bluetooth: BAP: Depend on BT_PAC_{SNK,SRC} instead of select
Modify ASCS and BAP Broadcast sink to depend on the PAC options
instead of selecting them.

Since Kconfig does not support "depends on X if Y",
a select for PAC_{SRC,SNK} is used depending on
ASCS_ASE_{SRC,SNK}.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-21 09:19:47 +01:00
Emil Gydesen
c0f86011cb Bluetooth: BAP: Depend on BT_ISO_SYNC_RECEIVER instead of select
The BAP Kconfigs option now depends on
BT_ISO_BROADCASTER instead of selecting it.

This is an effort to reduce the use of select in LE Audio.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-21 09:19:47 +01:00
Emil Gydesen
d22c7b0cf2 Bluetooth: BAP: Depend on BT_ISO_BROADCASTER instead of select
The BAP_BROADCAST_SOURCE Kconfig option now depends on
BT_ISO_BROADCASTER instead of selecting it.

This is an effort to reduce the use of select in LE Audio.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-21 09:19:47 +01:00