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

Bluetooth: Add a callback for notifying the previous bond state. #66

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

chejinxian
Copy link
Contributor

bug: v/54141

@chejinxian chejinxian requested a review from hyson710 as a code owner February 19, 2025 12:23
Copy link

@HanJing755 HanJing755 left a comment

Choose a reason for hiding this comment

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

LGTM

* // Handle bond state change
* }
*/
typedef void (*on_bond_state_changed_callback_v2)(void* cookie, bt_address_t* addr, bt_transport_t transport, bond_state_t previous_state, bond_state_t current_state, bool is_ctkd);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

parameter is enough?

/* callback bonding */
CALLBACK_FOREACH(CBLIST, adapter_callbacks_t, on_bond_state_changed,
addr, BT_TRANSPORT_BREDR, BOND_STATE_BONDING, false);
CALLBACK_FOREACH(CBLIST, adapter_callbacks_t, on_bond_state_changed_v2,
addr, BT_TRANSPORT_BREDR, previous_state, BOND_STATE_BONDING, false);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. initial value;
  2. power on;
  3. recommand v2 before v1.
  4. notify bonding once or bonding to bonding.

@@ -512,6 +534,7 @@ typedef struct {
on_connect_request_callback on_connect_request;
on_connection_state_changed_callback on_connection_state_changed;
on_bond_state_changed_callback on_bond_state_changed;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

client notify twice in different callback

@chejinxian chejinxian force-pushed the dev-bt branch 3 times, most recently from f665d1b to 42ce98e Compare February 22, 2025 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants