Skip to content

Commit ca66f5b

Browse files
vkchettimadajhedberg
authored andcommitted
tests: Bluetooth: shell: Fix conditional compile error
When building the tests/bluetooth/shell application without the BT_CENTRAL feature, compilation fails: subsys/bluetooth/shell/bt.c:1642: undefined reference to `bt_conn_create_auto_le' Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 2709b14 commit ca66f5b

File tree

1 file changed

+4
-0
lines changed
  • subsys/bluetooth/shell

1 file changed

+4
-0
lines changed

subsys/bluetooth/shell/bt.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,6 +1633,7 @@ static int cmd_wl_clear(const struct shell *shell, size_t argc, char *argv[])
16331633
return 0;
16341634
}
16351635

1636+
#if defined(CONFIG_BT_CENTRAL)
16361637
static int cmd_wl_connect(const struct shell *shell, size_t argc, char *argv[])
16371638
{
16381639
int err;
@@ -1656,6 +1657,7 @@ static int cmd_wl_connect(const struct shell *shell, size_t argc, char *argv[])
16561657

16571658
return 0;
16581659
}
1660+
#endif /* CONFIG_BT_CENTRAL */
16591661
#endif /* defined(CONFIG_BT_WHITELIST) */
16601662

16611663
#if defined(CONFIG_BT_FIXED_PASSKEY)
@@ -1782,7 +1784,9 @@ SHELL_STATIC_SUBCMD_SET_CREATE(bt_cmds,
17821784
SHELL_CMD_ARG(wl-add, NULL, HELP_ADDR_LE, cmd_wl_add, 3, 0),
17831785
SHELL_CMD_ARG(wl-rem, NULL, HELP_ADDR_LE, cmd_wl_rem, 3, 0),
17841786
SHELL_CMD_ARG(wl-clear, NULL, HELP_NONE, cmd_wl_clear, 1, 0),
1787+
#if defined(CONFIG_BT_CENTRAL)
17851788
SHELL_CMD_ARG(wl-connect, NULL, "<on, off>", cmd_wl_connect, 2, 0),
1789+
#endif /* CONFIG_BT_CENTRAL */
17861790
#endif /* defined(CONFIG_BT_WHITELIST) */
17871791
#if defined(CONFIG_BT_FIXED_PASSKEY)
17881792
SHELL_CMD_ARG(fixed-passkey, NULL, "[passkey]", cmd_fixed_passkey,

0 commit comments

Comments
 (0)