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

The discoverAllServicesAndCharacteristicsAsync function does not work on the second run #347

Open
Numax-cz opened this issue Dec 20, 2024 · 0 comments

Comments

@Numax-cz
Copy link

Numax-cz commented Dec 20, 2024

I noticed that the "discoverAllServicesAndCharacteristicsAsync" function does not work correctly if we try to call the function again.
Specifically, if there is a disconnect and reconnect between the function call. There is no then, no catch, just nothing.

I also noticed that this issue was resolved once I called the "await peripheral.discoverServicesAsync()" function before calling the "discoverAllServicesAndCharacteristicsAsync" function.

I tested this on RPI 4 model B rev 1.5 with kernel 6.1.21. Noble version: 1.9.2-25

try {
  const services = await peripheral.discoverServicesAsync();
} catch (e) { }
// Now everything works fine 
peripheral.discoverAllServicesAndCharacteristicsAsync().then((value: noble.ServicesAndCharacteristics) => {...
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

1 participant