From 9fb522b3ffcf6479ef64a76b8ef9cf742017220f Mon Sep 17 00:00:00 2001 From: Evelyn Eastmond Date: Tue, 14 Aug 2018 13:45:55 -0400 Subject: [PATCH] Moving a function. --- src/extensions/scratch3_wedo2/index.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/extensions/scratch3_wedo2/index.js b/src/extensions/scratch3_wedo2/index.js index e6050f9b2..1d7b6e7ad 100644 --- a/src/extensions/scratch3_wedo2/index.js +++ b/src/extensions/scratch3_wedo2/index.js @@ -512,6 +512,18 @@ class WeDo2 { }); } + /** + * Write a message to the device BLE session. + * @param {number} uuid - the UUID of the characteristic to write to + * @param {Uint8Array} message - the message to write. + * @return {Promise} - a promise result of the write operation + * @private + */ + _send (uuid, message) { + if (!this.getPeripheralIsConnected()) return; + return this._ble.write(UUID.IO_SERVICE, uuid, message, 'base64'); + } + /** * Process the sensor data from the incoming BLE characteristic. * @param {object} base64 - the incoming BLE data. @@ -556,18 +568,6 @@ class WeDo2 { } } - /** - * Write a message to the device BLE session. - * @param {number} uuid - the UUID of the characteristic to write to - * @param {Uint8Array} message - the message to write. - * @return {Promise} - a promise result of the write operation - * @private - */ - _send (uuid, message) { - if (!this.getPeripheralIsConnected()) return; - return this._ble.write(UUID.IO_SERVICE, uuid, message, 'base64'); - } - /** * Clear the sensor or motor present at port 1 or 2. * @param {number} connectID - the port to clear.