diff --git a/dist.sh b/dist.sh old mode 100644 new mode 100755 diff --git a/dist/ngMyo.js b/dist/ngMyo.js index 8445e97..f5fd6d5 100644 --- a/dist/ngMyo.js +++ b/dist/ngMyo.js @@ -184,7 +184,7 @@ function MyoDevice(id, version, ws, fnsByEvent) { angular.module('ngMyo', []) .constant('MyoOptions', { wsUrl: 'ws://127.0.0.1:10138/myo/', - apiVersion: 1, + apiVersion: 2, timeBeforeReconnect : 3000, autoApply : true, @@ -371,6 +371,8 @@ function MyoDevice(id, version, ws, fnsByEvent) { */ var initOptions = function(customOptions) { if(customOptions) { + instanceOptions.wsUrl = customOptions.wsUrl !== undefined ? customOptions.wsUrl : MyoOptions.wsUrl; + instanceOptions.apiVersion = customOptions.apiVersion !== undefined ? customOptions.apiVersion : MyoOptions.apiVersion; instanceOptions.autoApply = customOptions.autoApply !== undefined ? customOptions.autoApply : MyoOptions.autoApply; instanceOptions.timeBeforeReconnect = isInteger(customOptions.timeBeforeReconnect) ? customOptions.timeBeforeReconnect : MyoOptions.timeBeforeReconnect; instanceOptions.useRollPitchYaw = customOptions.useRollPitchYaw !== undefined ? customOptions.useRollPitchYaw : MyoOptions.useRollPitchYaw; @@ -396,7 +398,7 @@ function MyoDevice(id, version, ws, fnsByEvent) { throw new Error('Socket not supported by browser'); } - var ws = new $window.WebSocket(MyoOptions.wsUrl + MyoOptions.apiVersion); + var ws = new $window.WebSocket(instanceOptions.wsUrl + instanceOptions.apiVersion); ws.onopen = function() { $rootScope.$broadcast('ngMyoStarted'); @@ -428,9 +430,11 @@ function MyoDevice(id, version, ws, fnsByEvent) { unregisterDevice(data[1]); break; case 'arm_recognized' : + case 'arm_synced' : triggerArmRecognized(data[1]); break; case 'arm_lost' : + case 'arm_unsynced' : triggerArmLost(data[1]); break; default :