Commit graph zephyr/tests/bluetooth
Author SHA1 Message Date
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
Lyle Zhu
b9e1f53b1f Bluetooth: tester: Add BTP command BTP_L2CAP_LISTEN_V2
Add a new BTP L2CAP command BTP_L2CAP_LISTEN_V2 to extend the L2CAP
server feature.

Compared with BTP command `listen`, two fields are added, including
`mode` and `options`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-11-24 17:19:20 +01:00
Lyle Zhu
3588a116bc Bluetooth: tester: Add BTP command BTP_L2CAP_CONNECT_V2
Add a new BTP L2CAP command BTP_L2CAP_CONNECT_V2 to set extend the
L2CAP connect request.
Compared with BTP command `connect`, two fields are extended,
including `mode` and `options`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-11-24 17:19:20 +01:00
Lyle Zhu
8d97c8a4bf Bluetooth: tester: Add L2CAP ECHO REQ BTP command
Add a BTP command `BTP_L2CAP_SEND_ECHO_REQ` to send L2CAP ECHO REQ.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-11-24 17:19:20 +01:00
Lyle Zhu
ccb7084899 Bluetooth: tester: Support L2CAP BR ECHO req/rsp
Register ECHO callbacks in function `tester_init_l2cap()`.

Unregister ECHO callbacks in function `tester_unregister_l2cap()`.

Send ECHO response if ECHO request is received.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-11-24 17:19:20 +01:00
Lyle Zhu
7c3c864016 Bluetooth: tester: Support BR L2CAP channel data receiving
Add the function `br_alloc_buf_cb()` to allocate receiving buffer for
BR L2CAP channel.

Add the function `br_recv_cb()` to report the received BR L2CAP
channel data.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-11-24 17:19:20 +01:00
Lyle Zhu
c0f46f6371 Bluetooth: tester: Support L2CAP retransmission and flow-control mode
Configure the following configurations to support the L2CAP
retransmission and flow-control mode.
CONFIG_BT_L2CAP_RET=y
CONFIG_BT_L2CAP_FC=y
CONFIG_BT_L2CAP_ENH_RET=y
CONFIG_BT_L2CAP_STREAM=y
CONFIG_BT_L2CAP_FCS=y
CONFIG_BT_L2CAP_EXT_WIN_SIZE=y
CONFIG_BT_L2CAP_MAX_WINDOW_SIZE=5

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-11-24 17:19:20 +01:00
Lyle Zhu
b6f555b750 Bluetooth: tester: Support BR L2CAP send data command
If the channel id is more than ARRAY_SIZE(channels), send L2CAP data
through BR transport.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-11-24 17:19:20 +01:00
Emil Gydesen
7bbf704f60 tests: Bluetooth: Tester: Add validation of preconfig values
Add checks for the values in btp_ascs_preconfigure_qos
to determine if they are valid. If they are invalid
we reject the command.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-11-22 05:11:54 -05:00
Aleksandr Khromykh
f93e78b7f7 tests: bluetooth: tester: fix model rx handler
Commit fixes the model rx handler.
Model can receive maximum access payload.
Test should be able fit maximum access payload and
its own header for serial communication.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2025-11-20 08:59:31 -05:00
Emil Gydesen
318067ec6c tests: Bluetooth: tester: Removed bad guard in btp_gap.h
As per the Zephyr coding guidelines, functions declarations
in header files should not be conditionally compiled.

This fixes an issue with tester_gap_clear_adv_instance
where btp_gap.c always expect it to be available.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-11-20 08:58:56 -05:00
John Batch
3c126ef124 tests: cyw920829m2evk_02: Updating tests boards for multiple socs
Updating supported tests for the cyw920829m2evk_02 board to support
multiple socs.

Signed-off-by: John Batch <john.batch@infineon.com>
2025-11-20 06:02:48 -05:00
Timothy Keys
6bfa6fa9a8 bluetooth: host: shell: Add SCI shell commands
This adds support for Shorter Connection Interval commands in the bt
shell.

Signed-off-by: Timothy Keys <timothy.keys@nordicsemi.no>
2025-11-19 09:15:18 -05:00
Timothy Keys
c14dcaf199 bluetooth: host: Change uses of interval to interval_us
Since Shorter Connection Intervals changes the unit that connection
intervals can be represented in. It is necessary to change how
they are stored and represented.

This commit deprecates interval in favour of interval_us.

Remove use of interval in internal bt_conn struct since it is no longer
needed.

Signed-off-by: Timothy Keys <timothy.keys@nordicsemi.no>
2025-11-19 09:15:18 -05:00
Pavel Vasilyev
116d4ddb89 tests: bluetooth: qualification: Remove data signing related ICS
This commit removes data signing related ICS.

Removed ICS:
- SM 6/1: Signing Algorithm Generation
- SM 6/2: Signing Algorithm Resolving
- GATT 3/13: Signed Write Without Response
- GATT 9/10: Signed Write Command
- GATT 7/3: LE Security mode 2
- GAP 25/2: LE Security mode 2
- GAP 35/2: LE Security mode 2
- GAP 25/5: Connection data signing procedure
- GAP 35/5: Connection data signing procedure
- GAP 25/6: Authenticate signed data procedure
- GAP 35/6: Authenticate signed data procedure
- GAP 27b/8: Connection Signature Resolving Key (CSRK)
- GAP 37b/8: Connection Signature Resolving Key (CSRK)

The following tests are not supported any longer:
- GAP/SEC/CSIGN/BI-01-C
- GAP/SEC/CSIGN/BI-02-C
- GAP/SEC/CSIGN/BI-03-C
- GAP/SEC/CSIGN/BI-04-C
- GAP/SEC/CSIGN/BV-01-C
- GAP/SEC/CSIGN/BV-02-C
- GATT/CL/GAW/BV-02-C
- SM/CEN/SIGN/BV-01-C

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-11-19 06:52:38 -05:00
Pavel Vasilyev
66679c1886 tests: bluetooth: init: Remove duplicate prj_<x>.conf files
Remove duplicated prj.conf file.

prj_6, prj_7, prj_14 are identicall. Since prj_6.conf is unchanged,
keeping it.

prj_8, prj_9, prj_15 are identicall. Since prj_15.conf is
unchanged, keeping it.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-11-19 06:52:38 -05:00
Pavel Vasilyev
b7b35b89ed bluetooth: host: Deprecate CONFIG_BT_SIGNING
This commit deprecates:
- the `CONFIG_BT_SIGNING` Kconfig option
- `BT_GATT_CHRC_AUTH` property

IOW, this commit deprecates the LE Security mode 2 support.

Explanation:

Erratum ES-26047 introduced in Bluetooth Core Specification v6.2
requires SingCounter to be persistently stored to prevent replay
attacks.

Currently, the Host doesn't store SignCounter, therefore the device is
vulnerable to replay attacks after reboot.

Additionally, the current implementation doesn't assume that SignCounter
of a received message can be incremented by more than one and thus may
not validate correct message.

The Bluetooth Security and Privacy Best Practices Guide recommends to
not using Data signing and recommends to use LE Security mode 1 levels
2, 3 or 4 instead.

The Signed Write Without Response sub-procedure, which is the only user
of Data signing, is optional (see Vol 3, Part G, Table 4.1).

See also ES-18901.

The aforementioned reasons make no sense to keep this feature.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-11-19 06:52:38 -05:00
Aleksandr Khromykh
613d228002 bluetooth: mesh: update max oob size till 32 bytes
Commit updates maximum OOB authentication size from 8 bytes
till 32 bytes according to specification errata ES-27446.
Since previous OOB API does not allow to expose OOB values
with such width the new API has been introduced.
The previous API was deprecated and hidden under
BT_MESH_PROV_OOB_API_LEGACY option and left for backward
compatibility with existing code base.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2025-11-18 10:48:18 -05:00
Frode van der Meeren
48f82d1e34 tests: bluetooth: tester: Fix VCS tests
Zephyr automatically sets the persisted flag for VCS if the volume is
changed after the service is registered. As some of these PTS tests
require a set volume with the flag cleared, the initial volume needs to
be set before registering VCS.

Signed-off-by: Frode van der Meeren <frode.vandermeeren@nordicsemi.no>
2025-11-18 10:48:01 -05:00
Emil Gydesen
42ad1a3821 tests: Bluetooth: Tester: Increase ISO buffers
The ISO buffers defaults to 1, but since there are
risks that the ISO RX events cannot be sent to
the upper tester via UART before the next RX,
the RX is increased. This also allows to better
support cases where the ISO interval is larger than
the SDU interval.
The ISO TX buffers are similarly increase to help
prevent cases where a TX isn't scheduled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-11-18 10:45:41 -05:00
Alexander Svensen
52f2686de6 tests: bluetooth: tester: CSIS: Add more commands
- Add command for setting the set size
- Add command for setting the SIRK
- Allows the following tests to pass:
 - CSIS/SR/CN/BV-01-C
 - CSIS/SR/CN/BV-02-C
 - CSIS/SR/CN/BV-03-C
 - CSIS/SR/CN/BV-04-C

Signed-off-by: Alexander Svensen <alexander.svensen@nordicsemi.no>
2025-11-18 08:12:06 -05:00