2597 Commits

Author SHA1 Message Date
Vinayak Kariappa Chettimada
0b1b099196 Bluetooth: Controller: Fix PAST sync_offset_us calculation
Fix the missing use of remainder value in the sync_offset_us
calculations. Also, Periodic Sync reception is relative to
Peripheral event hence ticks_anchor does not require the
ticker margin and event jitter to be subtracted.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2026-01-22 14:09:11 +00:00
Szymon Janc
258eef1017 tests: Bluetooth: Bump qualification materials to Core Spec 6.2
This enables Bluetooth Core 6.2. No functional changes.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2026-01-20 15:33:36 +00:00
Emil Gydesen
d74f5d7d23 Bluetooth: Audio: depend on UTF8
Add a dependency for UTF8 for LE Audio. Since (nearly?) all
string in LE Audio are UTF8 and that the stack wants to be
able to check and validate strings coming both from remove
deviecs and from the application, it will depend on the utf8
API that is guarded by CONFIG_UTF8.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-01-20 13:20:52 +00:00
Gaetan Perrot
e38ddf4edf tests: bluetooth: btp_mesh: return error when blob target list is full
cmd_blob_target() always returned 0 even when the target list was
full, making error checks at call sites unreachable.

Return a proper error code when no more targets can be added so
callers can correctly detect and handle the failure.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-19 16:03:28 +00:00
alperen sener
8907c9ab8d tests: Bluetooth: tester: Fix Central Address Resolution chr. read
CAR characteristic read process was incomplete, CAR status was not
actually stored.

Added a new BTP_GAP_EV_PEER_CAR_RECEIVED to tester. This is to
prevent disconnect events before IUT successfully reads CAR from
central.

Updated start_directed_advertising() so that if the central has
no CAR support we must not send directed advertisements. IUT
might enter another connectable mode according to specification,
thus IUT starts sending connectable undirected advertisements with
resovable address.

Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
2026-01-19 10:04:25 +01:00
Emil Gydesen
d30ed27049 Bluetooth: Tester: Remove empty file hci_ipc.conf
The file is unused and the use of it has been removed from
autopts.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-01-16 11:40:13 +00:00
Tom Hughes
32b63c63ed tests: bluetooth: classic: Remove self assignment
When building with clang it warns about self-assignment in the
bluetooth.classic.sdp_s test:

tests/bluetooth/classic/sdp_s/src/sdp_server.c:258:5: error: explicitly
assigning value of variable of type 'const struct shell *' to itself
[-Werror,-Wself-assign]
  258 |         sh = sh;
      |         ~~ ^ ~~
tests/bluetooth/classic/sdp_s/src/sdp_server.c:277:5: error: explicitly
assigning value of variable of type 'const struct shell *' to itself
[-Werror,-Wself-assign]
  277 |         sh = sh;
      |         ~~ ^ ~~
tests/bluetooth/classic/sdp_s/src/sdp_server.c:290:5: error: explicitly
assigning value of variable of type 'const struct shell *' to itself
[-Werror,-Wself-assign]
  290 |         sh = sh;
      |         ~~ ^ ~~
tests/bluetooth/classic/sdp_s/src/sdp_server.c:368:5: error: explicitly
assigning value of variable of type 'const struct shell *' to itself
[-Werror,-Wself-assign]
  368 |         sh = sh;
      |         ~~ ^ ~~
4 errors generated.

The "sh" variable is used later in the functions.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2026-01-15 11:08:21 +00:00
Emil Gydesen
f90d497147 tests: Bluetooth: Tester: Various format fixes for the Readme
Since this file is not built with the documentation system,
some of the references didn't work. References to tools, boards,
etc. have been encapsulated by the appropriate ticks.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-01-07 12:31:52 +01:00
Emil Gydesen
6345dab3de Bluetooth: Audio: Use BT_CONN_ROLE over BT_HCI_ROLE
Use the host defined roles, rather than the HCI defined ones.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-01-06 19:14:19 +00:00
Emil Gydesen
f3b63a1bd6 Bluetooth: CCP: Server: Add support for get UCI
Add support for getting the UCI.
For now the UCI will be duplicated by the TBS
implementation, but will be optimizied in the future
so only one copy of the UCI exists.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-01-06 10:28:23 +01:00
Evgenii Kosenko
5006ca5610 tests: Bluetooth: Tester: Enable Encrypted Advertising Data
Btp got support of EAD in f04d0196de, enabling config flag will enable
GAP/SCN/BV-01-C and GAP/ADV/BV-20-C to be executed

Signed-off-by: Evgenii Kosenko <Evgenii.Kosenko@silabs.com>
2025-12-23 15:12:50 +01:00
Grzegorz Chwierut
29e8a95004 tests: Aligned with changes in pytest-twister-harness plugin
Aligned with changes in pytest plugin, where added support
of multiple connections from one device.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2025-12-22 20:36:34 +01:00
Dima Kushchevskyi
e157c16fab tests: bluetooth: ascs: make callback expectation checks more generic
The existing ASCS test callback verification functions scale poorly and are
not easily reusable across different cases.

This change introduces a more generic approach to expectation checks by
adding `expect_bt_bap_unicast_server_cb_release_called(_expected_count,
_streams)` and similar functions, improving readability and maintainability
of ASCS unit tests.

Fixes #58034

Signed-off-by: Dima Kushchevskyi <d.kushchevskyi@sirinsoftware.com>
2025-12-19 10:20:14 +02:00
Biwen Li
b196917f6c tests: bluetooth: audio: ascs: fix build issues
Fix build issues,
- error: format %x expects argument of type
  unsigned int, but argument 7 has type ssize_t
  {aka long int} [-Werror=format=]
  zassert_false(ret < 0, "attr->read returned unexpected (err 0x%02x)"
  , BT_GATT_ERR(ret));

Signed-off-by: Biwen Li <biwen.li@nxp.com>
2025-12-18 12:06:06 +01:00
Lyle Zhu
ba2bd21156 tests: Bluetooth: Update at test suites
Remove the dedicated buffer from the test case.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-12-18 05:33:30 +01:00
Sylvio Alves
f8d2e00a0e includes: remove duplicated entries in zephyr-tree
Remove duplicated #include directives within the same
preprocessor scope across the Zephyr tree.

Duplicates inside different #ifdef branches are preserved
as they may be intentional.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-12-17 13:57:38 -05:00
Lyle Zhu
761fcc8d01 tests: Bluetooth: Classic: GAP_S: Fix case tc_gap_s_2 failure issue
In the case, when the connection is established on the local side, the
test script will require peer device to send ACL disconnection
request. But due to the timing issue, the connected event may be not
notified on the peer device side when the peer device received the ACL
disconnection requirement. The exception will happen. It causes the
case to fail.

Wait for the connected event of the peer device before sending the ACL
disconnection request.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-12-17 10:53:55 +02:00
Lyle Zhu
e660314ffe tests: Bluetooth: Classic: SDP_S: Reduce time consumption
The case `sdp_discover_with_range` will consume much time to
exhaustively enumerate all supported attribute id ranges. It will
consume much time.

Optimize the set of the supported attribute ID ranges to reduce
the time consumption.
Such as, the discovered attribute ID list is [1, 2, 3, 4, 7, 9, 256].
In the original implementation, the range count is 35511. While in
the optimized range count is 105.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-12-17 10:53:34 +02:00
Lyle Zhu
68ff83079e tests: Bluetooth: Classic: Fix sm_key_persist_004 failure issue
For the case sm_key_persist_004, the disconnected event may be
printed before the log `Pairings successfully cleared` since there
is no order between log `Pairings successfully cleared` and the
disconnected event. It causes the script discards the disconnected
event in this case and rise the assert issue.

For the case sm_key_persist_004, check the disconnected event in
the captured log. If it is not found, wait the disconnected event
until timeout.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-12-17 10:53:24 +02:00
Lyle Zhu
6fdc675eae tests: Bluetooth: Classic: Fix sm_init_035 failure issue
For the case sm_init_035, the similar issue also be found. The
message `Enter 16 digits wide PIN code for` may be printed after
the shell prompt. The assert issue also be found in this case.

For the case sm_init_035, check the message `Enter 16 digits wide
PIN code for` in the captured log. If it is not found, wait the
message until timeout.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-12-17 10:52:53 +02:00
Emil Gydesen
df86199532 tests: Bluetooth: Tester: BAP broadcast BSIM test
Adds BSIM testing of the BAP broadcast features of the BT Tester.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-12-16 10:06:33 +01:00
Emil Gydesen
4f0f02df90 tests: Bluetooth: Tester: BAP unicast BSIM test
Adds BSIM testing of the BAP unicast features of the BT Tester.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-12-16 10:06:33 +01:00
Szymon Janc
09c80e18e6 tests: Bluetooth: Update ICS to TCRL pkg101
Updated to TCRL pkg101.

Security Mode 2 supporte removed (GAP,SM,GATT). Bumped supported
LE Audio profiles versions and enabled implemented features (notably
TMPA UMS)

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-12-11 17:00:28 +01:00
Emil Gydesen
4e98b05755 tests: Bluetooth: Tester: Fix bad BIS sync shift
The shift is an old leftover from when the BAP API was
different and BIT(1) means BIS Index 1, but now BIT(0)
means BIT Index 1.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-12-09 09:53:35 -05:00
Emil Gydesen
ca085cee3c tests: Bluetooth: Tester: Enable CAP commander and handover
Enable the CAP Commander role for the BT tester. This will
help pass some TMAP and GMAP tests that require the CAP
Commander to be enabled.

The actual implementation of the tests related to the
CAP commander is not implemented.

TMAP also requires that handover is supported if we
support both unicast and broadcast, so enable the config
for now. Support for the handover tests will follow in
a separate commit.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-12-08 06:14:17 -05:00
Lyle Zhu
0f1fcbb139 tests: Bluetooth: Classic: GAP_C: Reduce time consumption
In current implementation, the useless for loop is called in function
`_wait_for_shell_response()` if the target message has been found. It
causes the case will consume too much time.

Exit the useless for loop to reduce the time consumption when the
target message is found.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-12-05 11:12:28 -05:00
Lyle Zhu
eaa7cfff24 tests: Bluetooth: Classic: GAP_S: Reduce time consumption
In current implementation, the useless for loop is called in function
`_wait_for_shell_response()` if the target message has been found. It
causes the case will consume too much time.

Exit the useless for loop to reduce the time consumption when the
target message is found.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-12-05 11:12:18 -05:00
Lyle Zhu
91f19de3f8 tests: Bluetooth: Classic: rfcomm_s: Check connect event before send
Sometimes, the command `rfcomm_s send 9 1` will fail to execute due
to the DLC has not been established.

Check the DLC connected event before sending shell command
`rfcomm_s send 9 1`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-12-04 14:03:06 -05:00
Sylvio Alves
d14a547d42 dts/dtsi: add missing zephyr prefix for consistency
Many dts/dtsi files where its dt-bindings are in-tree
do not include zephyr prefix in the #include path.
Add it to make it consistent globally.

Some dt-bindings that resides in hal can not be changed.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-12-03 15:38:17 -05:00
Piotr Kosycarz
9cd1247615 tests: bluetooth: audio: pacs: move native_sim to common
Move platform def into common section.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2025-12-03 10:38:37 -05:00
Piotr Kosycarz
20eabf354d tests: bluetooth: audio: ascs: set native_sim in common
Use native_sim for all configurations.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2025-12-03 10:38:37 -05:00
Szymon Janc
c37f0567b1 Tests: Bluetooth: tester: Update LL overlay configuration
Match number of supported periodic advertising instances with
configure extended advertising instances and increase number
of advertising buffers to match qualification tests requirements.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-12-02 15:24:00 -05:00
Emil Gydesen
1d1f66c509 tests: Bluetooth: CCP: Modify server unittests to native_sim
Modify the unit tests to use the native_sim board instead of the
unit_testing board.
The native_sim board allows us to use the kernel in a more
regular way, while still being able to treat the tests as
unittest.

To support mocking we cannot rely on the default
Kconfig options and values. The required Kconfig options
to satisfy dependencies are overridden in the Kconfig
file and the necessary Kconfig files are sourced.
We cannot enable e.g. CONFIG_BT as that would attempt
to pull in a lot of files we do not want in this test.

This commit also removes unused includes in the CMakelists

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-12-02 11:21:21 +01:00
Emil Gydesen
522b8697b0 tests: Bluetooth: CCP: Modify client unittests to native_sim
Modify the unit tests to use the native_sim board instead of the
unit_testing board.
The native_sim board allows us to use the kernel in a more
regular way, while still being able to treat the tests as
unittest.

To support mocking we cannot rely on the default
Kconfig options and values. The required Kconfig options
to satisfy dependencies are overridden in the Kconfig
file and the necessary Kconfig files are sourced.
We cannot enable e.g. CONFIG_BT as that would attempt
to pull in a lot of files we do not want in this test.

This commit also removes unused includes in the CMakelists

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-12-02 11:21:11 +01:00
Emil Gydesen
96630fa564 tests: Bluetooth: CCID: Modify initiator unittests to native_sim
Modify the unit tests to use the native_sim board instead of the
unit_testing board.
The native_sim board allows us to use the kernel in a more
regular way, while still being able to treat the tests as
unittest.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-12-02 11:21:03 +01:00
Emil Gydesen
90b05da76a tests: Bluetooth: CAP: Modify commander unittests to native_sim
Modify the unit tests to use the native_sim board instead of the
unit_testing board.
The native_sim board allows us to use the kernel in a more
regular way, while still being able to treat the tests as
unittest.

To support mocking we cannot rely on the default
Kconfig options and values. The required Kconfig options
to satisfy dependencies are overridden in the Kconfig
file and the necessary Kconfig files are sourced.
We cannot enable e.g. CONFIG_BT as that would attempt
to pull in a lot of files we do not want in this test.

This commit also removes unused includes in the CMakelists

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-12-02 11:20:55 +01:00
Emil Gydesen
50a5cb3ec6 tests: Bluetooth: ASCS: Modify unittests to native_sim
Modify the unit tests to use the native_sim board instead of the
unit_testing board.
The native_sim board allows us to use the kernel in a more
regular way, while still being able to treat the tests as
unittest.

To support mocking we cannot rely on the default
Kconfig options and values. The required Kconfig options
to satisfy dependencies are overridden in the Kconfig
file and the necessary Kconfig files are sourced.
We cannot enable e.g. CONFIG_BT as that would attempt
to pull in a lot of files we do not want in this test.

This commit also removes unused includes in the CMakelists,
and cleans up the code.
Since the kernel is actually running, we also need to support
that e.g. k_work items are actually scheduled, and that we have
to wait for them to finish. test_drain_syswq has been implemented
as a way to drain the system workqueue before we check for
callbacks or perform subsequent actions.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-12-02 11:20:48 +01:00
Emil Gydesen
540e6c6c75 tests: Bluetooth: BAP: Modify Broadcast unittests to native_sim
Modify the unit tests to use the native_sim board instead of the
unit_testing board.
The native_sim board allows us to use the kernel in a more
regular way, while still being able to treat the tests as
unittest.

To support mocking we cannot rely on the default
Kconfig options and values. The required Kconfig options
to satisfy dependencies are overridden in the Kconfig
file and the necessary Kconfig files are sourced.
We cannot enable e.g. CONFIG_BT as that would attempt
to pull in a lot of files we do not want in this test.

This commit also removes unused includes in the CMakelists,
and moves the mock bap_broadcast_source.c file to the
correct location.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-12-02 11:20:40 +01:00
Alexander Svensen
f6cbd2f3a8 tests: bluetooth: tester: Start stream from connected_cb
- When we are a peripheral we want to be able to start a stream
  from the stream_connected_cb, given that we are in an enabling state
  and the stream is in the sink direction

Signed-off-by: Alexander Svensen <alexander.svensen@nordicsemi.no>
2025-12-01 12:25:40 -05:00
alperen sener
7ae81e6ad0 tests: bluetooth: tester: add support for wid 145 and 167
wid 145 requests handle of a UUID of a long characteristic. wid 167
requests to remove the characteristic by handle requested in wid 145.

2 new commands are added to support these wids:
- BTP_GATT_GET_HANDLE_FROM_UUID to request handle of a certain UUID
- BTP_GATT_REMOVE_HANDLE_FROM_DB to remove attribute by handle.

Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-12-01 12:24:20 -05:00
Ivan Pankratov
6ccc58a8f6 dts: bindings: Rename generic-fem-two-ctrl-pins to radio-fem-two-ctrl-pins
Rename generic FEM binding to use 'radio-' prefix for consistency with
other radio bindings (radio.yaml, ble-radio.yaml).

Updated 3 board files, Nordic BLE controller HAL, documentation, and
test overlays. Added missing settle-time properties to pan1783a board.

Signed-off-by: Ivan Pankratov <ivan.pankratov@silabs.com>
2025-12-01 12:22:33 -05:00
Emil Gydesen
f537b770e2 tests: Bluetooth: CAP: Unit tests: Delete group after creation
Some of the CAP initiator unit tests did not delete the group
after creation, even if they easily could.

Especially for test_initiator_unicast_group_add_streams it was
a problem, as the stream added was stack allocated, and by the
end of the test it was deallocated, causing issues when the
group was finally deleted in
cap_initiator_test_unicast_group_after.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-12-01 12:22:13 -05:00
Emil Gydesen
bfe66fc548 tests: Bluetooth: CAP: Modify initiator unittests to native_sim
Modify the unit tests to use the native_sim board instead of the
unit_testing board.
The native_sim board allows us to use the kernel in a more
regular way, while still being able to treat the tests as
unittest.

To support mocking we cannot rely on the default
Kconfig options and values. The required Kconfig options
to satisfy dependencies are overridden in the Kconfig
file and the necessary Kconfig files are sourced.
We cannot enable e.g. CONFIG_BT as that would attempt
to pull in a lot of files we do not want in this test.

This commit also removes unused includes in the CMakelists

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-12-01 12:22:13 -05:00
Omkar Kulkarni
d8ed0f8e3d tests: Bluetooth: Tester: Audio: Adds BRS
This commit adds API to tester to allow exposing of Broadcast Receive
State.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2025-11-26 11:05:19 +00:00
Emil Gydesen
b8e71e6098 tests: Bluetooth: Tester: Allow connecting CIS in QoS state
Add support for connecting the CIS in QoS state.
To support this some checks were added to check the CIS
state while entering the enabling state, as well as the
ASE state when the CIS was connected to determine when to
send the ASE start opcode.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-11-25 13:04:46 +01:00
Emil Gydesen
29f4f24019 tests: Bluetooth: Add ASCS CIS connection events
Add support for the ASCS CIS connection state events.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-11-25 13:04:46 +01:00
Lyle Zhu
e7cb176018 Bluetooth: tester: Add command to send connectionless data
Add command `BTP_L2CAP_CONNLESS_SEND` to send connectionless data with
specific PSM.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-11-24 17:19:20 +01:00
Lyle Zhu
efcbb1f060 Bluetooth: tester: Classic: change L2CAP server count to 2
If CONFIG_BT_CLASSIC is enabled, change the count of L2CAP server to 2.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-11-24 17:19:20 +01:00
Lyle Zhu
4450c9b96c Bluetooth: tester: Classic: L2CAP: Support local busy
If the option BTP_L2CAP_CONNECT_V2_OPT_HOLD_CREDIT or
BTP_L2CAP_LISTEN_V2_OPT_HOLD_CREDIT is set, set the local flag
`hold_credit`. When the data received, holds the buffer and returns
the error code `-EINPROGRESS`.

The held buffers will be released if the L2CAP channel disconnect
callback is triggered. Or only of the held buffers will be released
if the L2CAP BTP command `credits` is received.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-11-24 17:19:20 +01:00
Lyle Zhu
1e9493393d Bluetooth: tester: L2CAP: Set TX data buffer count to windows size
If `CONFIG_BT_CLASSIC` and `CONFIG_BT_L2CAP_MAX_WINDOW_SIZE` are
defined, set the TX data buffer count to
CONFIG_BT_L2CAP_MAX_WINDOW_SIZE. Or, set the TX data buffer count to
CHANNELS.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-11-24 17:19:20 +01:00