{"size": 662, "ext": "js", "max_stars_repo_path": "myoMqtt.js", "max_stars_repo_name": "Orientsoft/myo-mqtt", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "myoMqtt.js", "max_issues_repo_name": "Orientsoft/myo-mqtt", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "myoMqtt.js", "max_forks_repo_name": "Orientsoft/myo-mqtt", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.6428571429, "max_line_length": 68, "alphanum_fraction": 0.584592145}
var Mqtt = require('mqtt');
var mqttClient = Mqtt.connect('mqtt://voyager.orientsoft.cn:11883');

mqttClient.on('connect', function() {
  mqttClient.publish('dualshock-test', JSON.stringify({
    'payload': 'myo'
  }));

  var Myo = require('myo');
  var myMyo = Myo.create();

  myMyo.on('pose', function(poseName, edge){
    var now = new Date();
    var gesture = { 'name': poseName, 'edge':edge };
    var json = { 'name': 'macMyo', 
      'dev': 'myo',
      'time': now.getTime(),
      'type': 'gesture',
      'gesture': gesture
    };

    mqttClient.publish('myo', JSON.stringify(json));

    //myMyo.vibrate('short');
    console.log(json);
  });
});
