From c9763e85b4b65074cbebaa236bbaf6ca5314a5fb Mon Sep 17 00:00:00 2001 From: balazs Date: Wed, 7 Feb 2018 10:57:22 +0100 Subject: [PATCH] Adapter.connect function callback fixed (now it calls callback, in case of connect is timed out) --- api/adapter.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/adapter.js b/api/adapter.js index 40dc7f53..06801fc0 100644 --- a/api/adapter.js +++ b/api/adapter.js @@ -1095,6 +1095,9 @@ class Adapter extends EventEmitter { break; case this._bleDriver.BLE_GAP_TIMEOUT_SRC_CONN: const deviceAddress = this._gapOperationsMap.connecting.deviceAddress; + const errorObject = _makeError('Connect timed out.', deviceAddress); + const connectingCallback = this._gapOperationsMap.connecting.callback; + if (connectingCallback) connectingCallback(errorObject); delete this._gapOperationsMap.connecting; this._changeState({ connecting: false });