Skip to content

Commit

Permalink
Add userDidPickPeripheral to bt
Browse files Browse the repository at this point in the history
  • Loading branch information
DD Liu committed Nov 24, 2020
1 parent f19fd83 commit 87cb4a7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/io/bt.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,17 @@ class BT extends JSONRPC {
window.clearTimeout(this._discoverTimeoutID);
}
break;
//TODO why isn't 'user did pick peripheral' here?
case 'userDidPickPeripheral':
this._availablePeripherals[params.peripheralId] = params;
this._runtime.emit(
this._runtime.constructor.USER_PICKED_PERIPHERAL,
this._availablePeripherals
);
if (this._discoverTimeoutID) {
window.clearTimeout(this._discoverTimeoutID);
}
break;
case 'userDidNotPickPeripheral':
// this._availablePeripherals[params.peripheralId] = params;
this._runtime.emit(
this._runtime.constructor.PERIPHERAL_SCAN_TIMEOUT
);
Expand Down

0 comments on commit 87cb4a7

Please sign in to comment.