Moving a function.
This commit is contained in:
1 parent
13edf16caa
commit
9fb522b3ff
1 file changed
+12
-12
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user