Commit graph

2414 commits

Author SHA1 Message Date
Alperen Sener
1af9b40f6f Bluetooth: Test: Mesh: change mesh shell test log mode
Changing the log mode to minimal to reduce flash size

Signed-off-by: Alperen Sener <alperen.sener@nordicsemi.no>
2022-12-19 10:09:53 +00:00
Jonathan Rico
57d7d62bee Bluetooth: host: add bsim test for #52059
The test should fail.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-12-19 09:37:25 +00:00
Emil Gydesen
0114bc8199 Bluetooth: Audio: Shell: Add TBS Client debug logging in audio.conf
Add TBS client debug logging like all the other modules.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-16 14:46:57 +01:00
Emil Gydesen
18fe973df2 Bluetooth: Audio: Shell: Enable optional TBS features
Enable the optional TBS features to provide a full TBS experience.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-16 14:46:57 +01:00
Emil Gydesen
24d22ebbdb Bluetooth: Audio: Shell: Add support for more connections
Add support for 3 connections. Mainly we need to support
at least 2 connection to use the CSIP Set Coordinator role,
but some sets may also be 3 or even larger.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-16 14:46:57 +01:00
Emil Gydesen
cc9006f211 Bluetooth: Audio: Shell: Add EATT to audio.conf
Add EATT support for audio.conf as that is quite useful
for LE Audio.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-16 14:46:57 +01:00
Troels Nilsson
c0a5b1ef7b bluetooth: controller: Reduce user ops status to uint8_t
The status field is currently a uint32_t even though there are only
3 possible values. Reducing it to a uint8_t allows status to fit in
existing padding in the struct, saving 4 bytes per ticker_user_op

Updated function signatures to match; ticker_op_func left as-is
to avoid having to update a whole bunch of files for no real benefit

Signed-off-by: Troels Nilsson <trnn@demant.com>
2022-12-16 11:02:30 +00:00
Jonathan Rico
8bc094610c Bluetooth: host: update l2cap stress test
Do these things:
- use the proper macros for reserving the SDU header
- make every L2CAP PDU fragment into 3 ACL packets
- set tx data and verify rx matches the pattern
- measure segment pool usage

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-12-15 09:58:07 +00:00
Jonathan Rico
ef19c64f1b Bluetooth: host: poll on CTLR buffers instead of host TX queue
When there are no buffers, it doesn't make sense to repeatedly try to send
the host TX queue.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-12-15 09:58:07 +00:00
Erik Brockhoff
1f97652998 Bluetooth: controller: refactor ull_rx_put/sched
Instead of calling both ull_rx_put and ull_rx_sched, combine into one
function

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-12-09 12:44:39 +01:00
Erik Brockhoff
ddeb0e9f6e Bluetooth: controller: refactor ll_rx_put/sched
Instead of calling both ll_rx_put and ll_rx_sched, combine into one
function

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-12-09 12:44:39 +01:00
Morten Priess
a803588d2c Bluetooth: controller: Add handle to ll_data_path_sink_create
For making handle available in vendor sink creation, add ISO handle
to function prototype.
Expose datapath allocation via new ull_iso_datapath_alloc function.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2022-12-09 11:18:49 +01:00
Krzysztof Kopyściński
bfb3ec5253 tests: bluetooth: tester: allow to add more CCCs
Specification states that: "Only one Client Characteristic Configuration
declaration shall exist in a characteristic definition." This was
wrongly understood as "Ony one CCC can exist in GATT Server". When we
add next characteristic `ccc_added` flag is cleared so next CC can be
added (for this characteristic).

Added array for CCC values so it's no longer shared between CCCs.

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2022-12-09 11:18:39 +01:00
Nirosharn Amarasinghe
e4e5ef97eb tests: Bluetooth: controller: corrected input PDU time stamps
-- Corrected PDU time stamps to match expected reference anchor point
-- Corrected failing test_rx_unframed_dbl_split according to expected
   time stamps.

Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
2022-12-07 10:15:17 +00:00
Szymon Czapracki
f9db7fe065 Bluetooth: tester: Extract services from bttester
This commits extracts mesh, gat, gap, l2cap from
bttester.h into corresponding header files for
better readability.

Signed-off-by: Szymon Czapracki <szymon.czapracki@codecoup.pl>
2022-12-02 13:35:50 +02:00
Christian Taedcke
0308167cea tests: Bluetooth: Remove setting a unused define
The underlying Kconfig setting NET_BUF_USER_DATA_SIZE is not used anywhere,
so this define is removed here.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2022-12-01 15:50:35 +01:00
Erik Brockhoff
0604a4d2f1 Bluetooth: controller: store STO value instead of pre-calculated reload
Instead of storing the calculated reload value (in conn intervals) in
the conn object, now store the timeout value, and perform calculation
when used. This allows using the timeout value across all CIS's without
having to re-calc and store on change of TO

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-12-01 10:32:34 +01:00
Thomas Ebert Hansen
f192fccf3a Bluetooth: controller: Add lock around LLCP data
Add mayfly locking around the access to the local pending procedure list
as it is accessed by both thread and mayfly.

Fixes #45427

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-11-30 12:49:15 +01:00
Ahmed Moheb
71aa52d79d tests: bluetooth: host: Add UT for bt_keys_find_addr()
Unit test project for bt_keys_find_addr().
This part of subsys/bluetooth/host/keys.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-11-30 12:31:46 +01:00
Anas Nashif
ba7d730e9b tests/samples: use integration_plaforms in more tests/samples
integration_platforms help us control what get built/executed in CI and
for each PR submitted. They do not filter out platforms, instead they
just minimize the amount of builds/testing for a particular
tests/sample.
Tests still run on all supported platforms when not in integration mode.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-29 16:03:23 +01:00
Emil Gydesen
bbc85e0b2c Bluetooth: Audio: Use bt_vcp_vol_ctlr instead of bt_vcp
Use the `bt_vcp_vol_ctlr` opaque type instead of the more
generic `bt_vcp`.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-28 17:43:40 +01:00
Emil Gydesen
ae11b5879b Bluetooth: Audio: Remove bt_vcp from vol rend API
Remove the struct bt_vcp pointer from the volume
renderer API, as there is only ever a single
Volume Renderer instance on a device.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-28 17:43:40 +01:00
Emil Gydesen
c82af2885e Bluetooth: Audio: Split vol_ctlr and vol_rend callback structure
Split the `bt_vcp_cb` struct into separate structure for
the volume controller and the volume renderer.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-28 17:43:40 +01:00
Emil Gydesen
7f69b866f0 Bluetooth: Audio: Specify bt_vcp_vol_rend API
The VCP server, known as the volume renderer, has a
more explicity bt_vcp_vol_rend API naming scheme now.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-28 17:43:40 +01:00
Emil Gydesen
71bd487cc4 Bluetooth: Audio: Add separate API for VCP vol controller
Add a separate API for the VCP volume controller (client).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-28 17:43:40 +01:00
Emil Gydesen
966c9f80e7 Bluetooth: Audio: Remove the bt_vcp_vocs API
Remove the bt_vcp_vocs API as it did the same as the
bt_vocs API, and did not really any functionality.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-28 17:43:40 +01:00
Emil Gydesen
bfbb704c8e Bluetooth: Audio: Remove the bt_vcp_aics API
The AICS functionality can be exercised using the
bt_aics API instead. These functions did very little
besides cluttering up the bt_vcp API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-28 17:43:40 +01:00
Emil Gydesen
ce2b8f9fe1 Bluetooth: Audio: Rename VCS to VCP
Renames almost all occurences of VCS to VCP, as we want to
use the profile as the namespace for volume control.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-28 17:43:40 +01:00
Emil Gydesen
aaac86dada Bluetooth: Audio: Rename vcs.h to vcp.h as well as the Kconfig file
Rename vcs.h to vcp.h to better detail what the
file contains, as it is more than just VCS. This also
renames the Kconfig file.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-28 17:43:40 +01:00
Stephanos Ioannidis
5a5e15fc95 tests: bluetooth: bsim_test_multiple: Increase test timeout
This commit increases the timeout value for the `bsim_test_multiple`
BSIM test because it may take longer to complete with the
parallelisation enabled due to the context switching overhead and the
overallocation of the CPU cores.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-11-27 03:41:11 +09:00
Stephanos Ioannidis
1de363d9d5 tests: bluetooth: bsim_bt: Enable parallel compilation
This commit updates the Bluetooth BSIM test compilation script to build
multiple tests simultaneously in order to improve CPU utilisation.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-11-27 03:41:11 +09:00
Théo Battrel
e458f5aae6 Bluetooth: Use Zephyr standard log system instead of bluetooth/common/log
The `bluetooth/common/log.h` and `bluetooth/common/log.c` files have been
removed. Files that were using them have been updated to use
`zephyr/logging/log.h` instead.

Those replacement have been done consequently:
- `/BT_DBG/LOG_DBG/`
- `/BT_ERR/LOG_ERR/`
- `/BT_WARN/LOG_WRN/`
- `/BT_INFO/LOG_INF/`
- `/BT_HEXDUMP_DBG/LOG_HEXDUMP_DBG/`
- `/BT_DBG_OBJ_ID/LOG_DBG_OBJ_ID/`

Also, some files were relying on the `common/log.h` include to include
`zephyr/bluetooth/hci.h`, in those cases the include of `hci.h` has
been added.

For files that were including `common/log.h` but not using any logs,
the include has been removed and not replaced.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2022-11-25 17:08:36 +01:00
Mariusz Skamra
55b7d904ed Bluetooth: tests: shell: Fix build test for CAP Acceptor
This fixes check whether shell application can be built without CAP
Acceptor Set Member support.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-11-25 10:44:51 +01:00
Emil Gydesen
292db21a18 Bluetooth: Audio: Use svc_inst instead of bt_csip for set_member
Use the service instance struct instead of the more generic
`bt_csip` for the CSIP set member API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-24 15:23:48 +01:00
Emil Gydesen
87f86cebe2 Bluetooth: Audio: Rename bt_csip to bt_csip_set_member
Renamed remaining structs and functions that are not
for the set coordinator to use the set member CSIP
role name.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-24 15:23:48 +01:00
Emil Gydesen
93b3944a51 Bluetooth: Audio: Rename CSIS to CSIP
Renamed the coordinated set implementation to use the
profile (CSIP) name instead of the service (CSIS) name, as
the former is more general.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-24 15:23:48 +01:00
Théo Battrel
53ee728227 Bluetooth: Bluetooth: tests: host: Replace host_mocks/print_utils.h
Replace `host_mocks/print_utils.h` which does not exist anymore with
`common/bt_str.h`.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2022-11-24 15:21:39 +01:00
Jonathan Rico
77f7acace0 Bluetooth: tests: host: Update CMakeLists files
Update CMakeLists files to include new required files and new paths.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-11-24 15:21:39 +01:00
Jonathan Rico
c12709b1ef Bluetooth: tests: host: disable logging in UT
A PR got in after some changes were done to the BT logging system. This
nulls the error by not including the logging framework in this unit test.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-11-24 15:21:39 +01:00
Emil Gydesen
40e3930ebd Bluetooth: Audio: Broadcast source subgroup and BIS codec support
Updates the broadcast source API to create subgroups and
to set BIS specific codec configuration

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-24 10:21:36 +01:00
Ahmed Moheb
37de395fc5 tests: bluetooth: host: Add UT for prng_init()
Unit test project for prng_init().
This is part of subsys/bluetooth/host/crypto.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-11-24 10:06:05 +01:00
Ahmed Moheb
b86150ff0c tests: bluetooth: host: Add mocks for crypto.c
Add required mocks to be able to compile/test /bluetooth/host/crypto.c

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-11-24 10:06:05 +01:00
Ahmed Moheb
cba3ed9ad1 tests: bluetooth: host: Add UT for bt_keys_add_type()
Unit test project for bt_keys_add_type().
This part of subsys/bluetooth/host/buf.c unit testing

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-11-24 10:05:54 +01:00
Ahmed Moheb
f674a56a13 tests: bluetooth: host: Add UT for bt_keys_find_irk()
Unit test project for bt_keys_find_irk().
This part of subsys/bluetooth/host/keys.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-11-24 10:05:40 +01:00
Ahmed Moheb
932e49e020 tests: bluetooth: host: Add UT for bt_keys_get_type()
Unit test project for bt_keys_get_type().
This part of subsys/bluetooth/host/keys.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-11-24 10:05:32 +01:00
Aleksandr Khromykh
75f562cfe6 tests: Bluetooth: Mesh: improve test system clock precision
Increase system clock precision in the test system.
It helps for some events happen in more precise time and
prevents time overlapping between them.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2022-11-24 10:03:04 +01:00
Aleksandr Khromykh
8b4548c599 tests: Bluetooth: Mesh: fix bsim settings backend
PR fixes bsim settings backend issue.
Backend looses line if setting name of new line is
the occurence of the any existing lines.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2022-11-24 10:03:04 +01:00
Ahmed Moheb
5b1c6566b8 tests: bluetooth: host: Add UT for bt_keys_find()
Unit test project for bt_keys_find().
This part of subsys/bluetooth/host/keys.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-11-24 09:35:04 +01:00
Morten Priess
afd14d6573 Bluetooth: controller: CIS Central fixes from EBQ run
Various fixes for issues found during EBQ run.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2022-11-18 12:48:13 +01:00
Vinayak Kariappa Chettimada
a6beef4b26 Bluetooth: Controller: Replace Central connection spacing Kconfig
Replace the BT_CTLR_ADVANCED_SCHEDULING_CENTRAL_CONN_SPACING
Kconfig with BT_CTLR_CENTRAL_SPACING to configure the
the spacing from the beginning of a central connection event
to beginning of the next central connection when supporting
multiple simulataneous central connections.

If the BT_CTLR_CENTRAL_SPACING in microseconds is smaller
then the required time reservation for a connection event,
for given maximum data length and PHY in use, then the
calculated time reservation will be used as the spacing
between consecution central connection events.

The change fixes an issue wherein use of old Kconfig with
higher values causes new central connections to be placed
in between already connected central role if there was
free time space available to fit the new connections time
reservation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-11-17 14:44:17 +01:00