Skip to content
Commit 2f8a579b authored by Piotr Pryga's avatar Piotr Pryga Committed by Carles Cufí
Browse files

samples: Bluetooth: df: Fix periodic sync termination handling



There was a bug it periodic advertising sync termination handling.
If a sync was terminated before sync established was reported,
for example sync may be filtered out by CTE type, then sample
will wait until sync_create_timeout_ms is reached.
Also sem_per_sync_lost semaphore is given in term_cb.
Result of the bug is next time a sync is established, CTE sampling
is enabled, sample starts waiting for periodic sync lost and
immediately ends waiting because sem_per_sync_lost is given.
Scan is restarted and already synchronized sync is terminated.

Correct behavior is, when term_cb is executed sem_per_sync_lost
may be given only if sync established was already reported.
Also sample must not wait for sem_per_sync if sync is terminated
due to wrong CTE type. It can end wait immediately.

Signed-off-by: default avatarPiotr Pryga <piotr.pryga@nordicsemi.no>
parent 2b066cb4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment