Skip to content

Commit 9b19a90

Browse files
jhedbergkartben
authored andcommitted
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 <[email protected]>
1 parent 534b54b commit 9b19a90

File tree

2 files changed

+6
-0
lines changed
  • samples/bluetooth

2 files changed

+6
-0
lines changed

samples/bluetooth/hci_pwr_ctrl/src/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
#include <zephyr/bluetooth/gatt.h>
2323
#include <zephyr/bluetooth/services/hrs.h>
2424

25+
BUILD_ASSERT(IS_ENABLED(CONFIG_BT_HAS_HCI_VS),
26+
"This app requires Zephyr-specific HCI vendor extensions");
27+
2528
static struct bt_conn *default_conn;
2629
static uint16_t default_conn_handle;
2730

samples/bluetooth/hci_vs_scan_req/src/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
#include <zephyr/bluetooth/hci_vs.h>
1111
#include <zephyr/bluetooth/addr.h>
1212

13+
BUILD_ASSERT(IS_ENABLED(CONFIG_BT_HAS_HCI_VS),
14+
"This app requires Zephyr-specific HCI vendor extensions");
15+
1316
#define DEVICE_NAME CONFIG_BT_DEVICE_NAME
1417
#define DEVICE_NAME_LENGTH (sizeof(DEVICE_NAME) - 1)
1518

0 commit comments

Comments
 (0)