mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Handle user did not pick peripheral
This commit is contained in:
parent
04b6963788
commit
f19fd83563
2 changed files with 19 additions and 0 deletions
|
@ -190,6 +190,15 @@ class BLE extends JSONRPC {
|
|||
window.clearTimeout(this._discoverTimeoutID);
|
||||
}
|
||||
break;
|
||||
case 'userDidNotPickPeripheral':
|
||||
// this._availablePeripherals[params.peripheralId] = params;
|
||||
this._runtime.emit(
|
||||
this._runtime.constructor.PERIPHERAL_SCAN_TIMEOUT
|
||||
);
|
||||
if (this._discoverTimeoutID) {
|
||||
window.clearTimeout(this._discoverTimeoutID);
|
||||
}
|
||||
break;
|
||||
case 'characteristicDidChange':
|
||||
if (this._characteristicDidChangeCallback) {
|
||||
this._characteristicDidChangeCallback(params.message);
|
||||
|
|
10
src/io/bt.js
10
src/io/bt.js
|
@ -128,6 +128,16 @@ class BT extends JSONRPC {
|
|||
window.clearTimeout(this._discoverTimeoutID);
|
||||
}
|
||||
break;
|
||||
//TODO why isn't 'user did pick peripheral' here?
|
||||
case 'userDidNotPickPeripheral':
|
||||
// this._availablePeripherals[params.peripheralId] = params;
|
||||
this._runtime.emit(
|
||||
this._runtime.constructor.PERIPHERAL_SCAN_TIMEOUT
|
||||
);
|
||||
if (this._discoverTimeoutID) {
|
||||
window.clearTimeout(this._discoverTimeoutID);
|
||||
}
|
||||
break;
|
||||
case 'didReceiveMessage':
|
||||
this._messageCallback(params); // TODO: refine?
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue