Skip to content

getDevices() does not resolve device names when called with allowAllDevices: true #331

@chdh

Description

@chdh

When I call bluetooth.getDevices() with options.allowAllDevices: true, the device names are not retrieved:

Found device: Unknown or Unsupported Device (7f:6c:f3:b7:88:e9)
Found device: Unknown or Unsupported Device (7a:25:30:8c:e2:71)
Found device: Unknown or Unsupported Device (56:eb:35:12:42:40)
Found device: Unknown or Unsupported Device (cb:51:ab:53:8d:fa)
Found device: Unknown or Unsupported Device (d2:00:05:0c:f2:1c)

When I setallowAllDevices to false, getDevices() does not return any devices because the allowedDevices set is empty in bluetooth.ts. The only place where allowedDevices is filled is in the promise completion routine of requestDevice().
(This explains #242)

But when I first call requestDevice({acceptAllDevices: true}) before calling bluetooth.getDevices() with options.allowAllDevices: true, the name of the device that was previously returned by requestDevice() is retrieved in the list returned by bluetooth.getDevices().

testCase.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions