Skip to content

Commit

Permalink
Dist with firmware 1.0.3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
jsomsanith committed Nov 22, 2014
1 parent 53c14c5 commit da24f94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Empty file modified dist.sh
100644 → 100755
Empty file.
8 changes: 6 additions & 2 deletions dist/ngMyo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand All @@ -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');
Expand Down Expand Up @@ -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 :
Expand Down

0 comments on commit da24f94

Please sign in to comment.