Add userDidPickPeripheral to bt

This commit is contained in:
DD Liu 2020-11-24 16:49:54 -05:00
parent f19fd83563
commit 87cb4a7ef0

View file

@ -128,9 +128,17 @@ class BT extends JSONRPC {
window.clearTimeout(this._discoverTimeoutID); window.clearTimeout(this._discoverTimeoutID);
} }
break; 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': case 'userDidNotPickPeripheral':
// this._availablePeripherals[params.peripheralId] = params;
this._runtime.emit( this._runtime.emit(
this._runtime.constructor.PERIPHERAL_SCAN_TIMEOUT this._runtime.constructor.PERIPHERAL_SCAN_TIMEOUT
); );