How to use the @abandonware/noble.removeListener function in @abandonware/noble

To help you get started, we’ve selected a few @abandonware/noble examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CANDY-LINE / node-red-contrib-generic-ble / src / generic-ble.js View on Github external
function startBLEScanning(RED) {
  RED.log.info(`[GenericBLE] Start BLE scanning`);
  if (!onDiscover) {
    onDiscover = onDiscoverFunc(RED);
  }
  noble.removeListener('stateChange', onStateChange);
  noble.removeListener('discover', onDiscover);
  noble.addListener('stateChange', onStateChange);
  noble.addListener('discover', onDiscover);
  if (noble.state === 'poweredOn') {
    noble.startScanning([], true);
  }
}
github CANDY-LINE / node-red-contrib-generic-ble / src / generic-ble.js View on Github external
function startBLEScanning(RED) {
  RED.log.info(`[GenericBLE] Start BLE scanning`);
  if (!onDiscover) {
    onDiscover = onDiscoverFunc(RED);
  }
  noble.removeListener('stateChange', onStateChange);
  noble.removeListener('discover', onDiscover);
  noble.addListener('stateChange', onStateChange);
  noble.addListener('discover', onDiscover);
  if (noble.state === 'poweredOn') {
    noble.startScanning([], true);
  }
}
github LedgerHQ / ledgerjs / packages / hw-transport-node-ble / src / platform.js View on Github external
return () => {
      noble.removeListener("discover", onDiscover);
      noble.stopScanning();
    };
  });
github LedgerHQ / ledgerjs / packages / hw-transport-node-ble / src / platform.js View on Github external
return () => {
    noble.removeListener("stateChanged", onAvailabilityChanged);
  };
});