Skip to content

Commit 30928c2

Browse files
theob-prokartben
authored andcommitted
Bluetooth: Host: Remove unnecessary #ifndef
The functions `le_sc_oob_config_set`, `generate_dhkey` and `display_passkey` in `smp.c` were only defined when `CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY` was not defined. This created issues at build time. Remove the guard as the code calling those functions is not guarded itself. Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
1 parent 9fa82f0 commit 30928c2

File tree

1 file changed

+2
-5
lines changed
  • subsys/bluetooth/host

1 file changed

+2
-5
lines changed

subsys/bluetooth/host/smp.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3640,7 +3640,6 @@ static uint8_t sc_smp_check_confirm(struct bt_smp *smp)
36403640
return 0;
36413641
}
36423642

3643-
#ifndef CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY
36443643
static bool le_sc_oob_data_req_check(struct bt_smp *smp)
36453644
{
36463645
struct bt_smp_pairing *req = (struct bt_smp_pairing *)&smp->preq[1];
@@ -3685,7 +3684,6 @@ static void le_sc_oob_config_set(struct bt_smp *smp,
36853684

36863685
info->lesc.oob_config = oob_config;
36873686
}
3688-
#endif /* CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY */
36893687

36903688
static uint8_t smp_pairing_random(struct bt_smp *smp, struct net_buf *buf)
36913689
{
@@ -3800,7 +3798,8 @@ static uint8_t smp_pairing_random(struct bt_smp *smp, struct net_buf *buf)
38003798
return BT_SMP_ERR_UNSPECIFIED;
38013799
}
38023800

3803-
if (smp_auth_cb && smp_auth_cb->oob_data_request) {
3801+
if (!IS_ENABLED(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY) && smp_auth_cb &&
3802+
smp_auth_cb->oob_data_request) {
38043803
struct bt_conn_oob_info info = {
38053804
.type = BT_CONN_OOB_LE_SC,
38063805
.lesc.oob_config = BT_CONN_OOB_NO_DATA,
@@ -4185,7 +4184,6 @@ static uint8_t smp_security_request(struct bt_smp *smp, struct net_buf *buf)
41854184
}
41864185
#endif /* CONFIG_BT_CENTRAL */
41874186

4188-
#ifndef CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY
41894187
static uint8_t generate_dhkey(struct bt_smp *smp)
41904188
{
41914189
if (IS_ENABLED(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY)) {
@@ -4227,7 +4225,6 @@ static uint8_t display_passkey(struct bt_smp *smp)
42274225

42284226
return 0;
42294227
}
4230-
#endif /* CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY */
42314228

42324229
#if defined(CONFIG_BT_PERIPHERAL)
42334230
static uint8_t smp_public_key_periph(struct bt_smp *smp)

0 commit comments

Comments
 (0)