mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Don't send null pin.
This commit is contained in:
parent
b6913b7828
commit
ae791b3f26
1 changed files with 5 additions and 1 deletions
|
@ -61,7 +61,11 @@ class BT extends JSONRPCWebSocket {
|
|||
* @param {string} pin - an optional pin for pairing
|
||||
*/
|
||||
connectPeripheral (id, pin = null) {
|
||||
this.sendRemoteRequest('connect', {peripheralId: id, pin: pin})
|
||||
const params = {peripheralId: id};
|
||||
if (pin) {
|
||||
params.pin = pin;
|
||||
}
|
||||
this.sendRemoteRequest('connect', params)
|
||||
.then(() => {
|
||||
this._connected = true;
|
||||
this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTED);
|
||||
|
|
Loading…
Reference in a new issue