Commit graph

2414 commits

Author SHA1 Message Date
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
571f26cf1a Bluetooth: Rename BLE to Bluetooth (LE) where applicable
The BLE acronym is not an official description of Bluetooth
LE, and the Bluetooth SIG only ever refers to it as Bluetooth
Low Energy or Bluetooth LE, so Zephyr should as well.

This commit does not change any board or vendor specific
documentation, and the term BLE may still be used in those.
It will be up to the vendors to update it if they want,
since many of them are using the term BLE in their
products.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-12 12:24:18 +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
Håvard Reierstad
997814cf8c Bluetooth: testlib: Add addr string macro
Adds a macro returning a string representation of a Bluetooth address.
This allows you to print multiple addresses in a single printk or
LOG... call.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2025-02-12 09:40:07 +01:00
Emil Gydesen
b67d291207 Bluetooth: Host: Add type check for bt_conn API
Added a new function, bt_conn_is_type, that returns whether
the provided conn object is of the provided type.

This check is then used to ensure that the conn objects
supplied to other bt_conn function are of the right type.
The right type has also been documented for these functions.

This is an initial commit for a larger change in the BT Host,
as similar checks should be added to the L2CAP, GATT, ISO,
Audio and possibly Mesh APIs.

The type check could have been implemented by using the
bt_conn_get_info function, but that requires additional
function calls as well as memory allocation and copy.
Since bt_conn_is_type is designed to be widely used, it
was suited for its own function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-11 22:04:51 +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
Emil Gydesen
446ad0948d Bluetooth: PACS: Test and fix PACS Kconfig combinations
Add unit tests for all possible PACS combinations and
fix issues found.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-10 22:25:47 +01:00
Emil Gydesen
e7b6fd0b4b Bluetooth: PACS: Fix several issues with pacs_register
Fixed the following issues:
1) Missing guard before accessing parameters
2) Fixed bad sizeof when resetting
3) Fixed several bad offsets when removing attributes

Added tests to verify that it works now.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-10 22:25:47 +01:00
Emil Gydesen
58605542a6 tests: Bluetooth: PACS: Add unit test of PACS register
Adds initiation unittesting of PACS by testing
the bt_pacs_register API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-10 22:25:47 +01:00
Thomas Deppe
f3bdd2bc8c Bluetooth: Host: Add support for Advertising Coding Selection
Adds API for Advertising Coding Selection.

Introduces two new advertising options to configure the advertiser's
requirement concerning coding scheme when LE Coded PHY is configured.
While the Bluetooth v6.0 specification makes a distinction betweeen
preferred and required advertising PHY options, a simplification is
made to only expose the required PHY options. Inline with how LE Coded
PHY is implemented; this API will set both the primary and secondary
advertising PHY's to the same coding scheme.

The support is enabled by CONFIG_BT_EXT_ADV_CODING_SELECTION, and requires
a controller that selects CONFIG_BT_CTLR_ADV_EXT_CODING_SELECTION_SUPPORT.

Signed-off-by: Thomas Deppe <thomas.deppe@nordicsemi.no>
2025-02-08 10:09:41 +01: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
026a2c54ae tests: Bluetooth: Audio: Spring cleanup for audio test files
Add missing and remove unused includes. Fix spelling mistakes.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-04 12:03:04 +01:00
Théo Battrel
e3cf59bfd3 Tests: Bluetooth: Add MTU exchange procedure in testlib
Add `bt_testlib_att_exchange_mtu` function to simplify the procedure.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2025-01-30 11:15:03 +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
Emil Gydesen
9688c2d43f Bluetooth: CCP: Initial CCP Client implemenation
Added initial CCP client implementation that simply
does discovery of TBS on a remote CCP server.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-01-28 09:46:39 +01:00
Valerio Setti
9d0b1248ca test: Bluetooth: crypto: increase stack size for all the boards
Bring the change that was already in place for the qemu_cortex_m3 board
to all the other ones, since also nrf52840 had a similar problem
(see issue #82812).

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-01-27 17:10:21 +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
David Leach
d29e2f342d boards: nxp: add RT1060 EVKC support
MIMXRT1060 EVK rev C initial support files.

Signed-off-by: David Leach <david.leach@nxp.com>
2025-01-21 19:27:39 +01:00
Vinayak Kariappa Chettimada
5dffad061c Bluetooth: Controller: Fix regression in connection update
The connection event at the connection update instant was
skipped due to previous ticker node in use that is being
stopped was registering a relative occupied time that
overlapped with the new ticker node being started for
scheduling the connection with new interval.

Added mock interface for ticker_stop_abs() hence needed by
the Controller unit testing.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-01-21 15:13:16 +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
Emil Gydesen
eff93d268a Bluetooth: BAP: Add common capability check
Instead of having 2 separate and non-equal checks for
capabilities in ASCS and the Broadcast Sink, there is now
a single function in pacs.c that performs the
check.

This reduces code size and makes it easier to maintain.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-01-15 19:04:31 +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
Aleksandr Khromykh
967b096ad9 Bluetooth: Mesh: use secure storage in ble mesh
Commit:
 - adds dependency of the mbedtls psa usage on secure storage
 - removes PSA ITS emulator and enables usage of
   the secure storage in ble mesh bsim tests
 - enables secure storage in all ble mesh and related samples

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2025-01-14 13:23:47 +01:00
Yago Fontoura do Rosario
ee326138ca tests: bluetooth: Add missing mocks after fix on host
* Two mocks were missing in kernel mocks

Signed-off-by: Yago Fontoura do Rosario <yafo@demant.com>
2025-01-13 20:22:20 +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
Andries Kruithof
c9a9f0ab08 Bluetooth: Audio: Add tests for the CAP cancel command
This adds unittests and babblesim tests for the CAP cancel command

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2025-01-08 19:10:11 +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
9cfc546eba Bluetooth: Audio: Shell: Add logging and testing build tests
Added a test for disabled logging and for diabled testing
to ensure that the shell builds without error when those
are disbaled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-01-07 00:27:17 +01:00
Vinayak Kariappa Chettimada
9678ff2041 Bluetooth: Controller: Include mem and ecb in-system tests
Include mem and ecb implementation in-system tests.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-01-01 02:04:33 +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
Declan Snyder
8ed80ddb37 boards: mimxrt1060_evk: Convert to variants
Convert qspi and hyperflash to variants instead of revisions by popular
demand.

And convert evkb into a revision instead of a different board.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-12-20 22:59:59 +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
Andries Kruithof
b8428df7c6 tests: Bluetooth: CAP: remove compiler warning
There is an unused variable, which may result in a compiler warning.

Since we can not guarantee the value of this variable
we can not test for it, so it is removed.

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-12-19 04:19:01 +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
Fabio Baltieri
8183c991f8 tests: fix various unit tests warnings
Fix various unit test build warnings, unused variables, set but unused
variables, wrong types etc...

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-12-16 20:48:56 +01:00
Johan Hedberg
56cc148508 tests: bluetooth: Remove broken ECC unit tests
These are currently failing CI and don't really have a maintainer or
someone who'd fully understand how they're supposed to work. Let's remove
them for now and longer term work on reintroducing them in a form that's
maintainable and understood by people actively developing the Bluetooth
host stack.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-12-12 16:19:50 +01:00
Sebastian Panceac
f7bae12cef bluetooth: smp: Fix build warnings for central with OOB legacy only
Currently, there are build warnings that are triggered when building
for BT central and legacy OOB pairing only:
CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY=y
CONFIG_BT_CENTRAL=y

There was a PR that handled this issue in the past https://github.com/zephyrproject-rtos/zephyr/pull/74400.
Unfortunately, this PR even though it fixed the warnings it also
broke the BT peripheral and legacy OOB pairing only build:
CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY=y
CONFIG_BT_PERIPHERAL=y

https://github.com/zephyrproject-rtos/zephyr/pull/82552 was merged in
order to fix the issue with the peripheral build configuration.
Unfortunately, this PR reintroduced the warnings for BT central and
legacy OOB pairing.

This commit brings changes to make sure that both the BT central and
peripheral builds with OOB legacy pairing are buildable and
warnings free.

Also in this commit, a new build test case is added for the BT central
and legacy OOB pairing along the existing BT peripheral test case

Signed-off-by: Sebastian Panceac <sebastian.panceac@ext.grandcentrix.net>
2024-12-12 11:05:38 +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
Pavel Vasilyev
0d0669167b tests: bluetooth: buf: Test the freed buf callback
This commit adds a unit test that checks the freed buffer callback of
the bluetooth data buffer API.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-12-10 11:09:36 +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