mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 15:02:52 -05:00
Add userDidPickPeripheral to bt
This commit is contained in:
parent
f19fd83563
commit
87cb4a7ef0
1 changed files with 10 additions and 2 deletions
12
src/io/bt.js
12
src/io/bt.js
|
@ -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
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue