Skip to content

Commit 93d429b

Browse files
committed
fix: reset on closing usb and uart to disconnect on exit
1 parent 7effa7f commit 93d429b

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

lib/uart.js

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class BluetoothHciSocket extends EventEmitter {
2222
this._serialDevice = null;
2323
this._queue = null;
2424
this._parser = null;
25+
process.on('exit', () => this.reset());
2526
}
2627

2728
setFilter (filter) {

lib/usb.js

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ function BluetoothHciSocket () {
3535

3636
this._hciEventEndpointBuffer = Buffer.alloc(0);
3737
this._aclDataInEndpointBuffer = Buffer.alloc(0);
38+
39+
process.on('exit', () => this.reset());
3840
}
3941

4042
util.inherits(BluetoothHciSocket, events.EventEmitter);

0 commit comments

Comments
 (0)