From d9216baf2fdd2fc444bee360cdfcf0664ac20b2d Mon Sep 17 00:00:00 2001 From: Marek Serafin Date: Thu, 2 Nov 2023 17:24:53 +0100 Subject: [PATCH] fix(hci): added state event support to better handle uart and usb `isUp` changes --- lib/hci-socket/hci.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/hci-socket/hci.js b/lib/hci-socket/hci.js index aa36d8e8..e61b1447 100644 --- a/lib/hci-socket/hci.js +++ b/lib/hci-socket/hci.js @@ -151,6 +151,7 @@ Hci.STATUS_MAPPER = STATUS_MAPPER; Hci.prototype.init = function (options) { this._socket.on('data', this.onSocketData.bind(this)); this._socket.on('error', this.onSocketError.bind(this)); + this._socket.on('state', this.pollIsDevUp.bind(this)); if (this._userChannel) { this._socket.bindUser(this._deviceId, this._bindParams);