Skip to content

Commit

Permalink
Merge pull request #137 from pokornyib/ConnectCallbackFix
Browse files Browse the repository at this point in the history
Adapter.connect() function callback fix
  • Loading branch information
bihanssen authored Feb 12, 2018
2 parents 1a7548f + c9763e8 commit 259b31e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });

Expand Down

0 comments on commit 259b31e

Please sign in to comment.