nimble/ll: Send number of events in case of advertising timeout
We shall send number of advertising events in case max number of events
was specified and timeout due to duration was reached. Since events
counter is only increased if max number of events was specified, we do
not need extra checks here.
@@ -3041,7 +3041,8 @@ ble_ll_adv_done(struct ble_ll_adv_sm *advsm)
if ((advsm->props & BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY) &&
(advsm->flags & BLE_LL_ADV_SM_FLAG_ADV_TERMINATE_EVT)) {
ble_ll_hci_ev_send_adv_set_terminated(BLE_ERR_DIR_ADV_TMO,
- advsm->adv_instance, 0, 0);
+ advsm->adv_instance, 0,
+ advsm->events);
/*
* For high duty directed advertising we need to send connection
@@ -3172,7 +3173,8 @@ ble_ll_adv_sec_done(struct ble_ll_adv_sm *advsm)
/* Check if advertising timed out */
if (advsm->duration && (aux->start_time >= advsm->adv_end_time)) {
ble_ll_hci_ev_send_adv_set_terminated(BLE_ERR_DIR_ADV_TMO,
- advsm->adv_instance, 0, 0);
+ advsm->adv_instance, 0,
+ advsm->events);
/*
* For high duty directed advertising we need to send connection
