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.