Skip to content

Commit

Permalink
Fixed bluetooth
Browse files Browse the repository at this point in the history
Signed-off-by: Brandyn A. White <[email protected]>
  • Loading branch information
Brandyn A. White committed Mar 23, 2014
1 parent f059527 commit 12fb850
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion WearScript/src/main/assets/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ function WearScript() {
}
this.bluetoothList = function (callback) {
callback = this._funcfix(callback);
WSRAW.bluetoothList(his._funcwrap(function (x) {callback(JSON.parse(x))}));
WSRAW.bluetoothList(this._funcwrap(function (x) {callback(JSON.parse(x))}));
}
this.bluetoothRead = function (address, callback) {
callback = this._funcfix(callback);
Expand Down
2 changes: 1 addition & 1 deletion WearScript/src/main/assets/init.js.min
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ this.subscribe=function(a,e){e=this._funcfix(e);WSRAW.subscribe(a,this._funcwrap
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)):
"";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))):
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,
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))}))};
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))}))};
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;
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ protected void setupCallback(CallbackRegistration e) {
devices.add(deviceJS);
}
}
makeCall(LIST, devices.toJSONString());
String devicesJS = devices.toJSONString();
Log.d(TAG, devicesJS);
makeCall(LIST, "'" + devicesJS + "'");
unregisterCallback(LIST);
} else if (e.getEvent().startsWith(READ)) {
String address = e.getEvent().substring(READ.length());
Expand Down

0 comments on commit 12fb850

Please sign in to comment.