@stoprocent/bleno
Advanced tools
Comparing version
@@ -77,6 +77,7 @@ const debug = require('debug')('bindings'); | ||
init () { | ||
this.onSigIntBinded = this.onSigInt.bind(this); | ||
this._sigIntHandler = this.onSigInt.bind(this); | ||
this._exitHandler = this.onExit.bind(this); | ||
process.on('SIGINT', this.onSigIntBinded); | ||
process.on('exit', this.onExit.bind(this)); | ||
process.on('SIGINT', this._sigIntHandler); | ||
process.on('exit', this._exitHandler); | ||
@@ -106,2 +107,4 @@ this._gap.on('advertisingStart', this.onAdvertisingStart.bind(this)); | ||
stop () { | ||
process.removeListener('SIGINT', this._sigIntHandler); | ||
process.removeListener('exit', this._exitHandler); | ||
this.stopAdvertising(); | ||
@@ -213,3 +216,3 @@ this.disconnect(); | ||
if (sigIntListeners[sigIntListeners.length - 1] === this.onSigIntBinded) { | ||
if (sigIntListeners[sigIntListeners.length - 1] === this._sigIntHandler) { | ||
// we are the last listener, so exit | ||
@@ -216,0 +219,0 @@ // this will trigger onExit, and clean up |
@@ -119,3 +119,3 @@ const debug = require('debug')('hci'); | ||
stop() { | ||
stop () { | ||
this._socket.removeAllListeners(); | ||
@@ -593,2 +593,3 @@ this._socket.stop(); | ||
} | ||
if (pkts > this._handleAclsInProgress[handle_]) { | ||
@@ -595,0 +596,0 @@ // Linux kernel may send acl packets by itself, so be ready for underflow |
{ | ||
"name": "@stoprocent/bleno", | ||
"version": "0.8.2", | ||
"version": "0.8.3", | ||
"description": "A Node.js module for implementing BLE (Bluetooth Low Energy) peripherals", | ||
@@ -73,3 +73,3 @@ "main": "./index.js", | ||
"optionalDependencies": { | ||
"@stoprocent/bluetooth-hci-socket": "^1.4.2", | ||
"@stoprocent/bluetooth-hci-socket": "^1.4.5", | ||
"bplist-parser": "0.3.2", | ||
@@ -76,0 +76,0 @@ "xpc-connect": "^3.0.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
796899
0.02%4755
0.06%