From dce1a41a7dc9ad6b0cc6ac8dab40b6f8ee2a2c93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kopy=C5=9Bci=C5=84ski?= Date: Fri, 16 Jun 2023 14:22:01 +0200 Subject: [PATCH] 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 655a82ec3..c28853a0e 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; }