From 9551ac31af0348d7de6cbe7527de3e5ba205460d Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Tue, 2 Dec 2025 11:55:30 +0530 Subject: [PATCH] fix(nimble): Add change to cancel sync in case of reattempt --- nimble/host/src/ble_gap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c index 882984f02..4c1620eaf 100644 --- a/nimble/host/src/ble_gap.c +++ b/nimble/host/src/ble_gap.c @@ -2400,6 +2400,9 @@ ble_gap_rx_peroidic_adv_sync_estab(const struct ble_hci_ev_le_subev_periodic_adv /*Make application aware of the try */ ble_gap_reattempt_count(ev->sync_handle, ble_conn_reattempt.count); + /*Cancel ongoing sync , if any */ + ble_gap_periodic_adv_sync_create_cancel(); + rc = ble_gap_periodic_adv_sync_create(&ble_conn_reattempt.periodic_addr, ble_conn_reattempt.adv_sid, &ble_conn_reattempt.periodic_params, ble_conn_reattempt.cb, ble_conn_reattempt.cb_arg);