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

Race in _determineLPF2HubType #157

Open
antlai opened this issue May 27, 2022 · 1 comment
Open

Race in _determineLPF2HubType #157

antlai opened this issue May 27, 2022 · 1 comment

Comments

@antlai
Copy link
Contributor

antlai commented May 27, 2022

In Android smartphones (with webbluetooth) device.subscribeToCharacteristic() and device.writeToCharacteristic() cannot run concurrently without triggering the error in #131 , i.e., GATT operation failed for unknown reason.

To avoid that, in _determineLPF2HubType we need to await device.subscribeToCharacteristic() before starting device.writeToCharacteristic(). We also need subscribeToCharacteristic() to return the promise returned by startNotifications() (in webbleabstraction.ts)

This seems to have fixed all my connection problems.

It is just four lines changed, I'll submit a pull request...

Thanks for a great library!

Antonio

@vene4ka
Copy link

vene4ka commented Jun 2, 2023

not helping with #131

nathankellenicki added a commit that referenced this issue Apr 26, 2024
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

No branches or pull requests

2 participants