-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
samples: Bluetooth: Support multiple periodic synchronizations #42721
Conversation
Update Periodic Synchronization sample to support synchronization to multiple Periodic Advertisers. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Use custom interval for Periodic Advertising. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
@@ -130,7 +138,11 @@ static void term_cb(struct bt_le_per_adv_sync *sync, | |||
printk("PER_ADV_SYNC[%u]: [DEVICE]: %s sync terminated\n", | |||
bt_le_per_adv_sync_get_index(sync), le_addr); | |||
|
|||
atomic_dec(&sync_count); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes term_cb
function will be called, while sync_cb
is not called before this.
Usually it happen when sync fails exactly after calling bt_le_per_adv_sync_create
(but stnc creation function returns EXIT_SUCCESS).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handled in line 306
/* Restore sync_count */ | ||
atomic_set(&sync_count, sync_count_prev); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this will not work, if many already synchronized would terminate then the sync_count
will be restored to incorrect value.
Closing as #42518 is closed. |
Update Periodic Synchronization sample to support
synchronization to multiple Periodic Advertisers.
Signed-off-by: Vinayak Kariappa Chettimada [email protected]
One hour simulation log:
periodic_sync_multiple_one_hour.log