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>
This commit is contained in:
Sebastian Panceac 2024-12-10 00:53:22 +02:00 committed by Benjamin Cabé
commit f7bae12cef
2 changed files with 23 additions and 5 deletions

View file

@ -1,6 +1,7 @@
tests:
# Test that the Host builds with BT_SMP_OOB_LEGACY_PAIR_ONLY enabled
bluetooth.host_config_variants.config_bt_smp_oob_legacy_pair_only:
# and peripheral role
bluetooth.host_config_variants.config_peripheral_bt_smp_oob_legacy_pair_only:
extra_configs:
- CONFIG_BT_SMP=y
- CONFIG_BT_PERIPHERAL=y
@ -14,3 +15,20 @@ tests:
tags:
- bluetooth
build_only: true
# Test that the Host builds with BT_SMP_OOB_LEGACY_PAIR_ONLY enabled
# and central role
bluetooth.host_config_variants.config_central_bt_smp_oob_legacy_pair_only:
extra_configs:
- CONFIG_BT_SMP=y
- CONFIG_BT_CENTRAL=y
- CONFIG_BT_SMP_SC_PAIR_ONLY=n
- CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY=y
platform_allow:
- native_sim
- native_sim/native/64
integration_platforms:
- native_sim
tags:
- bluetooth
build_only: true