Commit graph

2414 commits

Author SHA1 Message Date
Ahmed Moheb
5eb19ab352 tests: bluetooth: host: Add UT for bt_le_oob_get_sc_data()
Unit test project for bt_le_oob_get_sc_data().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb
6c7a5aa930 tests: bluetooth: host: Add UT for bt_le_oob_set_sc_data()
Unit test project for bt_le_oob_set_sc_data().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb
7abdb2c9b2 tests: bluetooth: host: Add UT for bt_le_oob_set_legacy_tk()
Unit test project for bt_le_oob_set_legacy_tk().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb
811bdf8986 tests: bluetooth: host: Add UT for bt_le_ext_adv_oob_get_local()
Unit test project for bt_le_ext_adv_oob_get_local().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb
e1d0df2bb3 tests: bluetooth: host: Add UT for bt_le_oob_get_local()
Unit test project for bt_le_oob_get_local().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>

# Conflicts:
#	tests/bluetooth/host/id/CMakeLists.txt
2023-01-17 13:13:28 +01:00
Ahmed Moheb
ae32ce93d1 tests: bluetooth: host: Add UT for bt_br_oob_get_local()
Unit test project for bt_br_oob_get_local().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb
9338965c58 tests: bluetooth: host: Add UT for bt_id_set_adv_own_addr()
Unit test project for bt_id_set_adv_own_addr().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb
b31a4b3f70 tests: bluetooth: host: Add UT for bt_id_set_scan_own_addr()
Unit test project for bt_id_set_scan_own_addr().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb
15748f9a79 tests: bluetooth: host: Add UT for bt_id_set_create_conn_own_addr()
Unit test project for bt_id_set_create_conn_own_addr().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb
61c2f2e08a tests: bluetooth: host: Add UT for bt_id_delete()
Unit test project for bt_id_delete().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb
1f37971e08 tests: bluetooth: host: Add UT for bt_id_reset()
Unit test project for bt_id_reset().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb
7456b85e7e tests: bluetooth: host: Add UT for bt_id_get()
Unit test project for bt_id_get().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb
e6356c2770 tests: bluetooth: host: Add UT for bt_id_del()
Unit test project for bt_id_del().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb
af92e7f9d1 tests: bluetooth: host: Add UT for bt_id_add()
Unit test project for bt_id_add().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>

# Conflicts:
#	tests/bluetooth/host/id/CMakeLists.txt
2023-01-17 13:13:28 +01:00
Ahmed Moheb
10001af2b9 tests: bluetooth: host: Add UT for bt_id_adv_random_addr_check()
Unit test project for bt_id_adv_random_addr_check().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb
05ebdbbabc tests: bluetooth: host: Add UT for bt_id_scan_random_addr_check()
Unit test project for bt_id_scan_random_addr_check().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>

# Conflicts:
#	tests/bluetooth/host/id/CMakeLists.txt
2023-01-17 13:13:28 +01:00
Ahmed Moheb
053a7fdd37 tests: bluetooth: host: Add UT for bt_id_set_adv_random_addr()
Unit test project for bt_id_set_adv_random_addr().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb
7cf0ded736 tests: bluetooth: host: Add UT for bt_id_set_adv_private_addr()
Unit test project for bt_id_set_adv_private_addr().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>

# Conflicts:
#	tests/bluetooth/host/id/mocks/adv.c
#	tests/bluetooth/host/id/mocks/adv.h
2023-01-17 13:13:28 +01:00
Ahmed Moheb
4e6a92408e tests: bluetooth: host: Add UT for bt_id_set_private_addr()
Unit test project for bt_id_set_private_addr().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>

# Conflicts:
#	tests/bluetooth/host/id/CMakeLists.txt
2023-01-17 13:13:28 +01:00
Ahmed Moheb
9a0f610652 tests: bluetooth: host: Add UT for bt_lookup_id_addr()
Unit test project for bt_lookup_id_addr().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>

# Conflicts:
#	tests/bluetooth/host/id/CMakeLists.txt
2023-01-17 13:13:28 +01:00
Ahmed Moheb
abb7e8bfc2 tests: bluetooth: host: Add UT for bt_id_init()
Unit test project for bt_id_init().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb
28b14f7936 tests: bluetooth: host: Add UT for bt_setup_random_id_addr()
Unit test project for bt_setup_random_id_addr().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb
7df78a3785 tests: bluetooth: host: Add UT for bt_id_create()
Unit test project for bt_id_create().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb
8949f3da81 tests: bluetooth: host: Add UT for bt_setup_public_id_addr()
Unit test project for bt_setup_public_id_addr().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb
60345c1ddc tests: bluetooth: host: Add UT for bt_keys_update_usage()
Unit test project for bt_keys_update_usage().
This part of subsys/bluetooth/host/keys.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:02 +01:00
Ahmed Moheb
5768c45a9d tests: bluetooth: host: Add UT for bt_keys_store()
Unit test project for bt_keys_store().
This part of subsys/bluetooth/host/keys.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:02 +01:00
Théo Battrel
75c86730ee Bluetooth: Add BabbleSim test for MTU Update sample
Test that the Central receive the rigtht data from the Peripheral
notification.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2023-01-16 10:01:27 +01:00
Szymon Czapracki
35bd427927 Bluetooth: audio: Add configurable PACS supported contexts
Add the ability to change supported contexts in PACS.
Enhance the context command in the shell module to make it configurable.

Signed-off-by: Szymon Czapracki <szymon.czapracki@codecoup.pl>
2023-01-13 13:47:19 +01:00
Andries Kruithof
0239a2cf88 tests: Bluetooth: update unittests for Audio codecs
An LE controller shall no longer support
HCI_Read_Local_Supported_Codecs [v1]
The code in subsys/bluetooth/controller was updated for this
behaviour, and this commit updates the unittest

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-01-13 09:43:18 +01:00
Andries Kruithof
5f5f79486b tests: Bluetooth: update unittests for DF
Due to some refactoring the unittests for direction finding
started failing. This commit fixes the failing unittests

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-01-13 09:43:18 +01:00
Pavel Vasilyev
69a0058578 tests: bluetooth: mesh: Add separate assert macro with message support
ASSERT_OK macro is confusing as it accepts additional arguments, but
don't use them. This commit removes the confusion by making ASSERT_OK
macro accept only one argument. An additional macro ASSERT_OK_MSG is
added that mandates a format string that will be printed and optionally
arguments for the format string.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-01-11 10:47:06 +00:00
Pavel Vasilyev
abce1b9e42 tests: bluetooth: mesh: extend friend queue overflow test
Extend Friend Queue overflow test by overflow with segmented messages:
- when a segmented message is preempted by an unsegmented message;
- when a segmented message is preempted by another segmented message;

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-01-11 10:47:06 +00:00
Aleksandr Khromykh
8a58e86d42 tests: Bluetooth: Mesh: create reduced legacy configuration
mesh_shell application has been included recently some set new
abilities that added more functionality for testing.
That caused the application cannot fit in some supported plarforms
like qemu_cortex_m3. The reduced legacy configuration has been
added to fit stack into it. This platform is used in CI.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-01-11 09:39:34 +01:00
Emil Gydesen
a9071b361f Bluetooth: Audio: Add missing codec debug Kconfig
Add misisng codec debug Kconfig for the codec.c file.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-01-09 15:27:28 +00:00
Erik Brockhoff
2f61771948 Bluetooth: controller: consider host ctrl feature bits in feat exchange
Host controlled feature bits were not considered in feature exchange
procedure. This is fixed.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2023-01-08 19:48:38 +01:00
Emil Gydesen
8d86fa0125 Bluetooth: Audio: Add support for encrypted broadcast
Add support for adding a broadcast code to the broadcast
source.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-01-06 10:35:25 +00:00
Fabio Baltieri
f5b4acac57 yamllint: indentation: fix files in tests/
Fix the YAML files indentation for files in tests/.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-01-04 14:23:53 +01:00
Emil Gydesen
1e5be3f020 Bluetooth: Audio: Fix issue with unicast client src/snk ASE count
If either the sink or source ASE count was zero, calls to
ARRAY_SIZE(srcs) or ARRAY_SIZE(sinks) would cause a build warning.

The arrays should actually not be there at all if the respective
ASE count was 0, as that is just a waste of memory. The arrays,
and all uses of them, have been properly guarded.

This also adds a build assert to ensure that at least one
of them is non-zero, and that we also test building either
of them with the value 0.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-01-04 10:35:14 +01:00
Emil Gydesen
b9a6e04cb3 Bluetooth: Audio: Add AUDIO_ISO debug logging
Add a logging module for the audio_iso.c file, to enable
logging for that.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-01-04 10:35:14 +01:00
Fabio Baltieri
7dd902d035 yamllint: fix all yamllint comments-indentation errors
Fix all comments-indentation errors detected by yamllint:

yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \
  grep '(comments-indentation)'

This checks that the comment is aligned with the content.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-01-04 01:16:45 +09:00
Ahmed Moheb
4f3d5a10c4 tests: bluetooth: host: Add UT for bt_id_read_public_addr()
Unit test project for bt_id_read_public_addr().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-12-27 15:34:34 +01:00
Ahmed Moheb
ea6076116b tests: bluetooth: host: Add mocks for id.c
Add required mocks to be able to compile and test /bluetooth/host/id.c

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-12-27 15:34:34 +01:00
Ahmed Moheb
eceb8341e0 tests: bluetooth: host: Add UT for bt_keys_clear()
Unit test project for bt_keys_clear().
This part of subsys/bluetooth/host/buf.c unit testing

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-12-27 15:33:40 +01:00
Emil Gydesen
4e3205d238 Bluetooth: Audio: Add packing to unicast group create
Add the ISO packing field when creating a unicast group.

This refactors the structure of the unicast group create,
as it now takes both the packing as a group parameter, as well
as an array of stream-specific parameters.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-22 10:59:16 +01:00
Emil Gydesen
ba1949759d Bluetooth: Audio: Add packing field to broadcast source
Add support for setting the ISO packing field when
creating a broadcast source.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-22 10:59:16 +01:00
Erwan Gouriou
66d4c64966 all: Fix "#if IS_ENABLED(CONFIG_FOO)" occurrences
Clean up occurrences of "#if IS_ENABLED(CONFIG_FOO)" an replace
with classical "#if defined(CONFIG_FOO)".

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-12-21 10:09:23 +01:00
Lars Knudsen
081b83531b Bluetooth: has: Make HAS registration dynamic
This changes HAS registration to be dynamic and let's the
application set Hearing Aid Type and binaural features.

Often, devices are flashed with generic firmware with some
features stored post factory production, requiring
the settings to be moved from compile time to run-time.

This change will increase the RAM usage as the GATT
service is moved from ROM to RAM.

Signed-off-by: Lars Knudsen <larsgk@gmail.com>
Co-author: Soren Engquist <soren@engquist.dk>
2022-12-20 17:04:45 +00:00
Emil Gydesen
281a846060 Bluetooth: Audio: Move common broadcast sink test code to function
Move the functionality that is common between the two
broadcast sink test to a common function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-20 09:23:08 +01:00
Emil Gydesen
1424df424c Bluetooth: Audio: Add broadcast source metadata update function
Add API to do the BAP Broadcast Source Metadata update procedure,
which updates the metadata of a broadcast source while
it is streaming.

This is also makes all checks for the "head stream" the same.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-20 09:23:08 +01:00
Pavel Vasilyev
d0a660c87c tests: bluetooth: mesh: Update BT_MESH_LPN_RECV_DELAY default value
Update the default value of BT_MESH_LPN_RECV_DELAY to align with new
lower boundary for legacy advertiser.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/53189

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-12-19 15:31:55 +01:00