From 338cb747f049c1cd67be9665fe60c8aa2f6eeda7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kopy=C5=9Bci=C5=84ski?= Date: Tue, 1 Aug 2023 09:08:33 +0200 Subject: [PATCH] apps/bttester: fix check for address type in advertising_start() Encapsulated cases in correct configuration check (BTTESTER_PRIVACY_MODE). Used simple bit comparison, as glue module was dropped. --- apps/bttester/src/btp_gap.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/bttester/src/btp_gap.c b/apps/bttester/src/btp_gap.c index e0d43a4348..8056eaf13d 100644 --- a/apps/bttester/src/btp_gap.c +++ b/apps/bttester/src/btp_gap.c @@ -488,19 +488,19 @@ start_advertising(const void *cmd, uint16_t cmd_len, switch (addr_type) { case 0x00: break; -#if defined(CONFIG_BT_PRIVACY) +#if MYNEWT_VAL(BTTESTER_PRIVACY_MODE) case 0x01: - /* RPA usage is is controlled via privacy settings */ - if (!atomic_test_bit(¤t_settings, BTP_GAP_SETTINGS_PRIVACY)) { - return BTP_STATUS_FAILED; - } - break; - case 0x02: - /* NRPA is used only for non-connectable advertising */ - if (atomic_test_bit(¤t_settings, BTP_GAP_SETTINGS_CONNECTABLE)) { - return BTP_STATUS_FAILED; - } - break; + /* RPA usage is is controlled via privacy settings */ + if (!(current_settings & BIT(BTP_GAP_SETTINGS_PRIVACY))) { + return BTP_STATUS_FAILED; + } + break; + case 0x02: + /* NRPA is used only for non-connectable advertising */ + if (!(current_settings & BIT(BTP_GAP_SETTINGS_CONNECTABLE))) { + return BTP_STATUS_FAILED; + } + break; #endif default: return BTP_STATUS_FAILED;