From 87cb4a7ef02cb9051d63c08f7179fd725171b9dd Mon Sep 17 00:00:00 2001 From: DD Liu Date: Tue, 24 Nov 2020 16:49:54 -0500 Subject: [PATCH] Add userDidPickPeripheral to bt --- src/io/bt.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/io/bt.js b/src/io/bt.js index 312a45170..be1ce5db3 100644 --- a/src/io/bt.js +++ b/src/io/bt.js @@ -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 );