Bluetooth: controller: Fix for scanner Rx window hang

With the fix in commit 3c23c6f53d ("Bluetooth: controller:
Fix assert due to stale tick count") it is required that a
skipping event shall abort the previous role in order to
enable the ticker_job to resume and reschedule next ticker
expiry.

In the scan_adv sample, with continuous scanning, an
advertiser would pre-empt it, but if the advertiser skipped
its event without aborting the scanner, the scanner is hung
with its rx window without a timeout, and HCI command to
stop the advertiser will wait forever to complete.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2017-06-30 10:57:04 +02:00 committed by Johan Hedberg
commit b5235207d3

View file

@ -4358,6 +4358,12 @@ static u32_t event_common_prepare(u32_t ticks_at_expire,
/* Check for stale ticks_at_expire */
if (ticker_ticks_diff_get(ticker_ticks_now_get(), ticks_at_expire) >
TICKER_US_TO_TICKS(RADIO_TICKER_START_PART_US)) {
/* Abort any running role, as it probably is the cause for
* stale ticks_at_expire.
*/
event_stop(0, 0, 0, (void *)STATE_ABORT);
/* TODO: How much consecutive skips is tolerable? */
return 1;
}