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

fix: remove_bond request should be handled after disconnect #571

Merged

Conversation

kkkbird
Copy link
Contributor

@kkkbird kkkbird commented Jul 17, 2024

this PR is about to fix #363 case 1, this.request will reset to null in call of nextRequest(false) below and callback for removeBond won't be invoked correctly even though bond status change signal is received later. how ever it may introduce unintended side effects as noted in the comment above. Please help to review it.

if (r != null) {
if (r.type != Request.Type.DISCONNECT && r.type != Request.Type.REMOVE_BOND) {
// The CONNECT request is notified below.
// The DISCONNECT request is notified below in
// notifyDeviceDisconnected(BluetoothDevice).
// The REMOVE_BOND request will be notified when the bond state changes
// to BOND_NONE in the broadcast received on the top of this file.
r.notifyFail(gatt.getDevice(),
status == BluetoothGatt.GATT_SUCCESS ?
FailCallback.REASON_DEVICE_DISCONNECTED : status);
request = null;
}
}

@philips77 philips77 merged commit 92494c5 into NordicSemiconductor:main Aug 27, 2024
1 check passed
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.

cannot receive connection state change after removeBond() sometimes
2 participants