mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 23:12:24 -05:00
update name of variable
This commit is contained in:
parent
5696b76d9a
commit
b5decacee2
1 changed files with 5 additions and 5 deletions
|
@ -15,8 +15,8 @@ const BLEUUID = {
|
||||||
* Adapter class
|
* Adapter class
|
||||||
*/
|
*/
|
||||||
class ScratchLinkDeviceAdapter {
|
class ScratchLinkDeviceAdapter {
|
||||||
constructor (scratchLinkNativeDevice) {
|
constructor (scratchLinkSocket) {
|
||||||
this.scratchLinkNativeDevice = scratchLinkNativeDevice;
|
this.scratchLinkSocket = scratchLinkSocket;
|
||||||
|
|
||||||
this._onResponse = this._onResponse.bind(this);
|
this._onResponse = this._onResponse.bind(this);
|
||||||
this._deviceOnResponse = null;
|
this._deviceOnResponse = null;
|
||||||
|
@ -29,13 +29,13 @@ class ScratchLinkDeviceAdapter {
|
||||||
writeCommand (commandBuffer) {
|
writeCommand (commandBuffer) {
|
||||||
const data = Base64Util.uint8ArrayToBase64(commandBuffer);
|
const data = Base64Util.uint8ArrayToBase64(commandBuffer);
|
||||||
|
|
||||||
return this.scratchLinkNativeDevice
|
return this.scratchLinkSocket
|
||||||
.write(BLEUUID.service, BLEUUID.commandChar, data, 'base64', true);
|
.write(BLEUUID.service, BLEUUID.commandChar, data, 'base64', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
setup ({onResponse}) {
|
setup ({onResponse}) {
|
||||||
this._deviceOnResponse = onResponse;
|
this._deviceOnResponse = onResponse;
|
||||||
return this.scratchLinkNativeDevice
|
return this.scratchLinkSocket
|
||||||
.startNotifications(BLEUUID.service, BLEUUID.responseChar, this._onResponse);
|
.startNotifications(BLEUUID.service, BLEUUID.responseChar, this._onResponse);
|
||||||
|
|
||||||
// TODO:
|
// TODO:
|
||||||
|
@ -49,7 +49,7 @@ class ScratchLinkDeviceAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
close () {
|
close () {
|
||||||
return this.scratchLinkNativeDevice.disconnect();
|
return this.scratchLinkSocket.disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue