This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new 338cb747 apps/bttester: fix check for address type in 
advertising_start()
338cb747 is described below

commit 338cb747f049c1cd67be9665fe60c8aa2f6eeda7
Author: Krzysztof Kopyściński <[email protected]>
AuthorDate: Tue Aug 1 09:08:33 2023 +0200

    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 e0d43a43..8056eaf1 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(&current_settings, 
BTP_GAP_SETTINGS_PRIVACY)) {
-                       return BTP_STATUS_FAILED;
-               }
-               break;
-       case 0x02:
-               /* NRPA is used only for non-connectable advertising */
-               if (atomic_test_bit(&current_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;

Reply via email to