update name of variable

This commit is contained in:
Valerie Young 2019-01-07 18:20:45 -05:00
parent 5696b76d9a
commit b5decacee2

View file

@ -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();
} }
} }