samples: bluetooth: Add build asserts for VS-using samples

The README files of these samples already indicate that they use the
Zephyr-specific HCI vendor extensions, but this may still not be clear
enough to some users, as evidenced in #81779. Add build asserts to make
sure the samples only build when Zephyr VS extensions have been enabled.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
This commit is contained in:
Johan Hedberg 2024-11-24 12:50:21 +02:00 committed by Benjamin Cabé
commit 9b19a90daa
2 changed files with 6 additions and 0 deletions

View file

@ -22,6 +22,9 @@
#include <zephyr/bluetooth/gatt.h>
#include <zephyr/bluetooth/services/hrs.h>
BUILD_ASSERT(IS_ENABLED(CONFIG_BT_HAS_HCI_VS),
"This app requires Zephyr-specific HCI vendor extensions");
static struct bt_conn *default_conn;
static uint16_t default_conn_handle;

View file

@ -10,6 +10,9 @@
#include <zephyr/bluetooth/hci_vs.h>
#include <zephyr/bluetooth/addr.h>
BUILD_ASSERT(IS_ENABLED(CONFIG_BT_HAS_HCI_VS),
"This app requires Zephyr-specific HCI vendor extensions");
#define DEVICE_NAME CONFIG_BT_DEVICE_NAME
#define DEVICE_NAME_LENGTH (sizeof(DEVICE_NAME) - 1)