Skip to content

Commit 12fb850

Browse files
author
Brandyn A. White
committed
Fixed bluetooth
Signed-off-by: Brandyn A. White <bwhite@dappervision.com>
1 parent f059527 commit 12fb850

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

WearScript/src/main/assets/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ function WearScript() {
902902
}
903903
this.bluetoothList = function (callback) {
904904
callback = this._funcfix(callback);
905-
WSRAW.bluetoothList(his._funcwrap(function (x) {callback(JSON.parse(x))}));
905+
WSRAW.bluetoothList(this._funcwrap(function (x) {callback(JSON.parse(x))}));
906906
}
907907
this.bluetoothRead = function (address, callback) {
908908
callback = this._funcfix(callback);

WearScript/src/main/assets/init.js.min

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ this.subscribe=function(a,e){e=this._funcfix(e);WSRAW.subscribe(a,this._funcwrap
2020
function(a){WSRAW.log(a)};this.displayWebView=function(){WSRAW.displayWebView()};this.displayWarpView=function(a){a?WSRAW.displayWarpView(JSON.stringify(a)):WSRAW.displayWarpView()};this.warpDraw=function(a,e,g,k,n,r){WSRAW.warpDraw(a,e,g,k,n,r)};this.warpGlassToPreviewH=function(a){a=this._funcfix(a);WSRAW.warpGlassToPreviewH(this._funcwrap(function(e){a(JSON.parse(e))}))};this.warpSetOverlay=function(a){WSRAW.warpSetOverlay(a)};this.warpPreviewSampleGlass=function(a){a=a?this._funcwrap(this._funcfix(a)):
2121
"";WSRAW.warpPreviewSampleGlass(a)};this.displayCardTree=function(){WSRAW.displayCardTree()};this.cardTree=function(a){WSRAW.cardTree(JSON.stringify(a.cards))};this.cameraOn=function(a,e,g,k){e||(e=0);g||(maxwidth=0);k?(k=this._funcfix(k),WSRAW.cameraOn(a,e,g,!1,this._funcwrap(k))):WSRAW.cameraOn(a,e,g,!1)};this.cameraPhoto=function(a){a?(a=this._funcfix(a),WSRAW.cameraPhoto(this._funcwrap(a))):WSRAW.cameraPhoto()};this.cameraPhotoData=function(a){a?(a=this._funcfix(a),WSRAW.cameraPhotoData(this._funcwrap(a))):
2222
WSRAW.cameraPhoto()};this.cameraVideo=function(a){a?(a=this._funcfix(a),WSRAW.cameraVideo(this._funcwrap(a))):WSRAW.cameraVideo()};this.cameraOff=function(){WSRAW.cameraOff()};this.activityCreate=function(){WSRAW.activityCreate()};this.activityDestroy=function(){WSRAW.activityDestroy()};this.wifiOn=function(a){a=this._funcfix(a);WSRAW.wifiOn(this._funcwrap(a))};this.wifiOff=function(){WSRAW.wifiOff()};this.wifiScan=function(){WSRAW.wifiScan()};this.serverConnect=function(a,e){e=this._funcfix(e);WSRAW.serverConnect(a,
23-
this._funcwrap(e))};this.wake=function(){WSRAW.wake()};this.sound=function(a){WSRAW.sound(a)};this.gestureCallback=function(a,e){e=this._funcfix(e);WSRAW.gestureCallback(a,this._funcwrap(e))};this.speechRecognize=function(a,e){e=this._funcfix(e);WSRAW.speechRecognize(a,this._funcwrap(function(a){e(atob(a))}))};this.liveCardCreate=function(a,e){WSRAW.liveCardCreate(a,e)};this.liveCardDestroy=function(){WSRAW.liveCardDestroy()};this.bluetoothList=function(a){a=this._funcfix(a);WSRAW.bluetoothList(his._funcwrap(function(e){a(JSON.parse(e))}))};
23+
this._funcwrap(e))};this.wake=function(){WSRAW.wake()};this.sound=function(a){WSRAW.sound(a)};this.gestureCallback=function(a,e){e=this._funcfix(e);WSRAW.gestureCallback(a,this._funcwrap(e))};this.speechRecognize=function(a,e){e=this._funcfix(e);WSRAW.speechRecognize(a,this._funcwrap(function(a){e(atob(a))}))};this.liveCardCreate=function(a,e){WSRAW.liveCardCreate(a,e)};this.liveCardDestroy=function(){WSRAW.liveCardDestroy()};this.bluetoothList=function(a){a=this._funcfix(a);WSRAW.bluetoothList(this._funcwrap(function(e){a(JSON.parse(e))}))};
2424
this.bluetoothRead=function(a,e){e=this._funcfix(e);WSRAW.bluetoothRead(a,this._funcwrap(e))};this.bluetoothWrite=function(a,e){WSRAW.bluetoothWrite(a,e)}}WS=new WearScript;

WearScript/src/main/java/com/dappervision/wearscript/managers/BluetoothManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ protected void setupCallback(CallbackRegistration e) {
9292
devices.add(deviceJS);
9393
}
9494
}
95-
makeCall(LIST, devices.toJSONString());
95+
String devicesJS = devices.toJSONString();
96+
Log.d(TAG, devicesJS);
97+
makeCall(LIST, "'" + devicesJS + "'");
9698
unregisterCallback(LIST);
9799
} else if (e.getEvent().startsWith(READ)) {
98100
String address = e.getEvent().substring(READ.length());

0 commit comments

Comments
 (0)