mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-25 17:09:50 -05:00
Add disconnect and getPeripheralIsConnected to EV3 extension
This commit is contained in:
parent
6f5ff31eb3
commit
387f03b08c
1 changed files with 12 additions and 0 deletions
|
@ -125,6 +125,18 @@ class EV3 {
|
||||||
this._bt.connectDevice(id);
|
this._bt.connectDevice(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
disconnectSession () {
|
||||||
|
this._bt.disconnectSession();
|
||||||
|
}
|
||||||
|
|
||||||
|
getPeripheralIsConnected () {
|
||||||
|
let connected = false;
|
||||||
|
if (this._bt) {
|
||||||
|
connected = this._bt.getPeripheralIsConnected();
|
||||||
|
}
|
||||||
|
return connected;
|
||||||
|
}
|
||||||
|
|
||||||
get distance () {
|
get distance () {
|
||||||
if (!this.connected) return;
|
if (!this.connected) return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue