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 dce1a41a apps/bttester: do not fail pairing if it's already active
dce1a41a is described below

commit dce1a41a7dc9ad6b0cc6ac8dab40b6f8ee2a2c93
Author: Krzysztof Kopyściński <[email protected]>
AuthorDate: Fri Jun 16 14:22:01 2023 +0200

    apps/bttester: do not fail pairing if it's already active
    
    Sometimes it's simpler to call pair() even when procedure is already
    active. Do not fail command in this case, as it doesn't influence
    already ongoing procedure.
---
 apps/bttester/src/gap.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/apps/bttester/src/gap.c b/apps/bttester/src/gap.c
index 655a82ec..c28853a0 100644
--- a/apps/bttester/src/gap.c
+++ b/apps/bttester/src/gap.c
@@ -1457,7 +1457,8 @@ pair(const uint8_t *data, uint16_t len)
         goto rsp;
     }
 
-    if (ble_gap_security_initiate(desc.conn_handle)) {
+    rc = ble_gap_security_initiate(desc.conn_handle);
+    if (rc != 0 && rc != BLE_HS_EALREADY) {
         status = BTP_STATUS_FAILED;
         goto rsp;
     }

Reply via email to