fix(nimble): Added change to copy adv params to be reused during reattempt adv

This commit is contained in:
Rahul Tank
2026-01-29 12:51:28 +05:30
parent 6baedb7959
commit 4ea7586add
+2 -8
View File
@@ -1348,7 +1348,7 @@ int ble_gap_slave_adv_reattempt(void)
rc = ble_gap_adv_start(ble_adv_reattempt.own_addr_type,
(ble_adv_reattempt.direct_addr_present == 1 ? &ble_adv_reattempt.direct_addr: NULL),
ble_adv_reattempt.duration_ms, NULL,
ble_adv_reattempt.duration_ms, &ble_adv_reattempt.adv_params,
ble_adv_reattempt.cb, ble_adv_reattempt.cb_arg);
if (rc != 0) {
return rc;
@@ -3757,6 +3757,7 @@ ble_gap_adv_start(uint8_t own_addr_type, const ble_addr_t *direct_addr,
}
ble_adv_reattempt.duration_ms = duration_ms;
memcpy(&ble_adv_reattempt.adv_params , adv_params, sizeof(struct ble_gap_adv_params));
ble_adv_reattempt.cb = cb;
ble_adv_reattempt.cb_arg = cb_arg;
#endif
@@ -4156,13 +4157,6 @@ ble_gap_ext_adv_configure(uint8_t instance,
#if MYNEWT_VAL(BLE_ENABLE_CONN_REATTEMPT) && NIMBLE_BLE_CONNECT
ble_adv_reattempt.instance = instance;
if (selected_tx_power) {
ble_adv_reattempt.selected_tx_power = *selected_tx_power;
ble_adv_reattempt.selected_tx_power_present = 1 ;
} else {
ble_adv_reattempt.selected_tx_power_present = 0 ;
}
ble_adv_reattempt.cb = cb;
ble_adv_reattempt.cb_arg = cb_arg;