From f8a0ea281fc37cb51a0ae7965eede30a647993e4 Mon Sep 17 00:00:00 2001 From: Evelyn Eastmond Date: Thu, 6 Jun 2019 15:54:19 -0400 Subject: [PATCH] Adding/fixing debug statements throughout. --- src/extensions/scratch3_ev3/index.js | 6 ++++-- src/io/bt.js | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/extensions/scratch3_ev3/index.js b/src/extensions/scratch3_ev3/index.js index cf979b4f..cf5053f9 100644 --- a/src/extensions/scratch3_ev3/index.js +++ b/src/extensions/scratch3_ev3/index.js @@ -599,7 +599,8 @@ class EV3 { /** * Called by the runtime when user wants to disconnect from the EV3 peripheral. */ - disconnect () { + disconnect() { + console.log('EV3 DISCONNECT CALLED'); if (this._bt) { this._bt.disconnect(); } @@ -610,7 +611,8 @@ class EV3 { /** * Reset all the state and timeout/interval ids. */ - reset () { + reset() { + console.log('EV3 RESET CALLED'); this._sensorPorts = []; this._motorPorts = []; this._sensors = { diff --git a/src/io/bt.js b/src/io/bt.js index 0a5f2e41..ed704caf 100644 --- a/src/io/bt.js +++ b/src/io/bt.js @@ -78,7 +78,9 @@ class BT extends JSONRPC { /** * Close the websocket. */ - disconnect () { + disconnect() { + console.log('BT DISCONNECT CALLED'); + if (this._connected) { this._connected = false; } @@ -149,6 +151,7 @@ class BT extends JSONRPC { */ handleDisconnectError (/* e */) { // log.error(`BT error: ${JSON.stringify(e)}`); + console.log('BT HANDLEDISCONNECTERROR CALLED'); if (!this._connected) return;