Skip to content

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

Description

@Numax-cz

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) => {...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions