Bluetooth: audio: has: Fix building with preset support disabled

This fixes regression causing compilation errors seen when the
code is built without preset support (BT_HAS_PRESET_COUNT = 0).

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This commit is contained in:
Mariusz Skamra 2023-06-05 08:49:05 +02:00 committed by Carles Cufí
commit 21599a6b14
3 changed files with 86 additions and 77 deletions

View file

@ -7,6 +7,13 @@ tests:
platform_allow: native_posix
tags: bluetooth
build_only: true
sample.bluetooth.hap_ha.monaural_no_presets:
harness: bluetooth
platform_allow: native_posix
tags: bluetooth
build_only: true
extra_configs:
- CONFIG_BT_HAS_PRESET_COUNT=0
sample.bluetooth.hap_ha.banded:
harness: bluetooth
platform_allow: native_posix

View file

@ -96,5 +96,9 @@ int has_server_init(void)
return err;
}
return has_server_preset_init();
if (IS_ENABLED(CONFIG_BT_HAS_PRESET_SUPPORT)) {
return has_server_preset_init();
}
return 0;
}