mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Moving a function.
This commit is contained in:
parent
13edf16caa
commit
9fb522b3ff
1 changed files with 12 additions and 12 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue