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

Support for unregistering bt_conn callbacks #18316

Closed
mtpr-ot opened this issue Aug 15, 2019 · 0 comments
Closed

Support for unregistering bt_conn callbacks #18316

mtpr-ot opened this issue Aug 15, 2019 · 0 comments
Labels
area: Bluetooth Enhancement Changes/Updates/Additions to existing features

Comments

@mtpr-ot
Copy link
Collaborator

mtpr-ot commented Aug 15, 2019

Currently it's not possible to unregister bt_conn callbacks registered with bt_conn_cb_register(cb). This has the disadvantage that each callback need to have individual run-time switching built in, in order to disable.

Registering the same callback twice also has the sideeffect of generating double callbacks - which in some cases will cause unexpected behavior.

A new function bt_conn_cb_unregister(cb) should be implemented to allow unregistering a callback.

In a discussion about this feature, in #18237, the following was also noted:

  • Callback list should be re-implemented using sys_slist_t
  • Semaphore protection of list manipulation should be implemented, as these may occur from different threads
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

No branches or pull requests

1 participant