Skip to content
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

Closed

Conversation

cvinayak
Copy link
Contributor

@cvinayak cvinayak commented Feb 11, 2022

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

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);
Copy link
Contributor

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).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handled in line 306

Comment on lines +305 to +306
/* Restore sync_count */
atomic_set(&sync_count, sync_count_prev);
Copy link
Contributor Author

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.

@cvinayak
Copy link
Contributor Author

Closing as #42518 is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants