From 387f03b08c0b1647c42ace912173d0599dd17777 Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Wed, 27 Jun 2018 15:26:57 -0400 Subject: [PATCH] Add disconnect and getPeripheralIsConnected to EV3 extension --- src/extensions/scratch3_ev3/index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/extensions/scratch3_ev3/index.js b/src/extensions/scratch3_ev3/index.js index d62979a70..1b56759cb 100644 --- a/src/extensions/scratch3_ev3/index.js +++ b/src/extensions/scratch3_ev3/index.js @@ -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;