forked from noble/noble
-
-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Description
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.