You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2026/09/09 20:14:48 UTC

(mynewt-nimble) branch master updated (613761c65 -> 2cf66a2b1)

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

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


    from 613761c65 npl/linux: Honor finite event queue timeouts
     new 8bb4c360d nimble/bttester: Fix NRPA logic in bttester
     new 2cf66a2b1 nimble/bttester: Report connectable state in controller info

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 apps/bttester/src/btp_gap.c | 44 +++++++++++++++++++++++++++++---------------
 1 file changed, 29 insertions(+), 15 deletions(-)


(mynewt-nimble) 02/02: nimble/bttester: Report connectable state in controller info

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 2cf66a2b17235319d82e6ded7aa2a6ccdcc5eec6
Author: Szymon Czapracki <sz...@codecoup.pl>
AuthorDate: Wed Apr 8 13:11:43 2026 +0200

    nimble/bttester: Report connectable state in controller info
    
    Set CONNECTABLE in current_settings based on the current advertising
    parameters so controller_info reports the actual runtime state.
---
 apps/bttester/src/btp_gap.c | 42 ++++++++++++++++++++++++++++--------------
 1 file changed, 28 insertions(+), 14 deletions(-)

diff --git a/apps/bttester/src/btp_gap.c b/apps/bttester/src/btp_gap.c
index 44e189a48..7f68b8eb7 100644
--- a/apps/bttester/src/btp_gap.c
+++ b/apps/bttester/src/btp_gap.c
@@ -150,6 +150,20 @@ controller_index_list(const void *cmd, uint16_t cmd_len,
     return BTP_STATUS_SUCCESS;
 }
 
+#if MYNEWT_VAL(BLE_EXT_ADV)
+static struct ble_gap_ext_adv_params adv_params = {
+    .primary_phy = BLE_HCI_LE_PHY_1M,
+    .secondary_phy = BLE_HCI_LE_PHY_1M,
+    .sid = 1,
+    .legacy_pdu = 1,
+};
+#else
+static struct ble_gap_adv_params adv_params = {
+    .conn_mode = BLE_GAP_CONN_MODE_NON,
+    .disc_mode = BLE_GAP_DISC_MODE_NON,
+};
+#endif
+
 static uint8_t
 controller_info(const void *cmd, uint16_t cmd_len,
                 void *rsp, uint16_t *rsp_len)
@@ -202,6 +216,20 @@ controller_info(const void *cmd, uint16_t cmd_len,
     supported_settings |= BIT(BTP_GAP_SETTINGS_ADVERTISING);
     supported_settings |= BIT(BTP_GAP_SETTINGS_SC);
 
+#if MYNEWT_VAL(BLE_EXT_ADV)
+    if (adv_params.connectable) {
+        current_settings |= BIT(BTP_GAP_SETTINGS_CONNECTABLE);
+    } else {
+        current_settings &= ~BIT(BTP_GAP_SETTINGS_CONNECTABLE);
+    }
+#else
+    if (adv_params.conn_mode != BLE_GAP_CONN_MODE_NON) {
+        current_settings |= BIT(BTP_GAP_SETTINGS_CONNECTABLE);
+    } else {
+        current_settings &= ~BIT(BTP_GAP_SETTINGS_CONNECTABLE);
+    }
+#endif
+
     if (ble_hs_cfg.sm_bonding) {
         current_settings |= BIT(BTP_GAP_SETTINGS_BONDABLE);
     }
@@ -219,20 +247,6 @@ controller_info(const void *cmd, uint16_t cmd_len,
     return BTP_STATUS_SUCCESS;
 }
 
-#if MYNEWT_VAL(BLE_EXT_ADV)
-static struct ble_gap_ext_adv_params adv_params = {
-    .primary_phy = BLE_HCI_LE_PHY_1M,
-    .secondary_phy = BLE_HCI_LE_PHY_1M,
-    .sid = 1,
-    .legacy_pdu = 1,
-};
-#else
-static struct ble_gap_adv_params adv_params = {
-    .conn_mode = BLE_GAP_CONN_MODE_NON,
-    .disc_mode = BLE_GAP_DISC_MODE_NON,
-};
-#endif
-
 static uint8_t ad_flags = BLE_HS_ADV_F_BREDR_UNSUP;
 
 #if MYNEWT_VAL(BTTESTER_PRIVACY_MODE) && MYNEWT_VAL(BTTESTER_USE_NRPA)


(mynewt-nimble) 01/02: nimble/bttester: Fix NRPA logic in bttester

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8bb4c360d1f63f05681afa5c396844c70c5780ab
Author: Szymon Czapracki <sz...@codecoup.pl>
AuthorDate: Wed Apr 8 13:09:25 2026 +0200

    nimble/bttester: Fix NRPA logic in bttester
    
    NRPA should only be allowed for non-connectable advertising.
    The previous condition was inverted and rejected the valid case.
    
    Reject NRPA only when advertising is connectable.
---
 apps/bttester/src/btp_gap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apps/bttester/src/btp_gap.c b/apps/bttester/src/btp_gap.c
index 1fdaed762..44e189a48 100644
--- a/apps/bttester/src/btp_gap.c
+++ b/apps/bttester/src/btp_gap.c
@@ -547,7 +547,7 @@ start_advertising(const void *cmd, uint16_t cmd_len,
         break;
     case 0x02:
         /* NRPA is used only for non-connectable advertising */
-        if (!(current_settings & BIT(BTP_GAP_SETTINGS_CONNECTABLE))) {
+        if ((current_settings & BIT(BTP_GAP_SETTINGS_CONNECTABLE))) {
             return BTP_STATUS_FAILED;
         }
         break;