We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 072b3cb commit ce8e05cCopy full SHA for ce8e05c
src/noble/lib/bluez/bindings.js
@@ -682,6 +682,17 @@ class BluezBindings extends EventEmitter {
682
debug(`Powered=>${changedProps.Powered.value}`);
683
if (!changedProps.Powered.value) {
684
this.emit('stateChange', 'poweredOff');
685
+ setTimeout(async () => {
686
+ debug(`Trying to turn on the adapter...`);
687
+ const powerOn = new dbus.Variant('b', true);
688
+ try {
689
+ await this.hciProps.Set(interfaceName, 'Powered', powerOn);
690
+ } catch (err) {
691
+ debug(
692
+ `Error while turning on the adapter. err.message:${err.message}, type:${err.type}`
693
+ );
694
+ }
695
+ }, 5 * 1000);
696
}
697
698
// Skip to show other props
0 commit comments