Skip to content

Cannot monitor Bluetooth status changes #33

@pxgo

Description

@pxgo

Thanks to the author for his efforts, my electron app can operate Bluetooth.

During the test, I found that when the system Bluetooth was turned off and the following program was run, the Bluetooth status obtained was unsupported. When the system Bluetooth was turned on again, noble.on('stateChange') would not be triggered. The test code is as follows:

const noble = require("@stoprocent/noble");

noble.on("stateChange", (state) => {
  console.log(`stateChange: ${state}`);
});

setInterval(() => {
  console.log(`timer: ${noble.state}`);
}, 2000);

I don't know if this is a bug. I have only tested it on the Windows 11 platform and don't know if other platforms have the same problem.

As of now, when users encounter the above scenario, they have to turn on the system Bluetooth first and then restart the electron app, which is troublesome.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions