mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-11 10:39:56 -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);
|
||||
}
|
||||
|
||||
disconnectSession () {
|
||||
this._bt.disconnectSession();
|
||||
}
|
||||
|
||||
getPeripheralIsConnected () {
|
||||
let connected = false;
|
||||
if (this._bt) {
|
||||
connected = this._bt.getPeripheralIsConnected();
|
||||
}
|
||||
return connected;
|
||||
}
|
||||
|
||||
get distance () {
|
||||
if (!this.connected) return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue