Add disconnect and getPeripheralIsConnected to EV3 extension

This commit is contained in:
Eric Rosenbaum 2018-06-27 15:26:57 -04:00 committed by Ray Schamp
parent 6f5ff31eb3
commit 387f03b08c

View file

@ -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;