Skip to content

Commit

Permalink
Rollback d8d5af6 (especially b/c it's involved in felixge/felixge#28).
Browse files Browse the repository at this point in the history
  • Loading branch information
John Schulz committed Nov 19, 2012
1 parent 0508a55 commit 7261424
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions lib/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ Client.prototype.resume = function() {
this._udpNavdatasStream
.on('error', this._maybeEmitError.bind(this))
.on('data', this._handleNavdata.bind(this));
return this;
};

Client.prototype._handleNavdata = function(navdata) {
Expand Down Expand Up @@ -135,39 +134,30 @@ Client.prototype._sendCommands = function() {

Client.prototype.disableEmergency = function() {
this._disableEmergency = true;
return this;
};

Client.prototype.takeoff = function() {
this._ref.fly = true;
return this;
return true;
};

Client.prototype.land = function() {
this._ref.fly = false;
return this;
return true;
};

Client.prototype.stop = function() {
this._pcmd = {};
return this;
return true;
};

Client.prototype.config = function(key, value) {
if (typeof key === "object") {
for (var k in key) {
if (Object.hasOwnProperty.call(key, k)) this.config(k, key[k]);
}
return this;
}

// @TODO Figure out if we can get a ACK for this, so we don't need to
// repeat it blindly like this
var self = this;
this._repeat(10, function() {
self._udpControl.config(key, value);
});
return this;
};

Client.prototype.animate = function(animation, duration) {
Expand All @@ -177,7 +167,6 @@ Client.prototype.animate = function(animation, duration) {
this._repeat(10, function() {
self._udpControl.animate(animation, duration);
});
return this;
};

Client.prototype.animateLeds = function(animation, hz, duration) {
Expand All @@ -187,7 +176,6 @@ Client.prototype.animateLeds = function(animation, hz, duration) {
this._repeat(10, function() {
self._udpControl.animateLeds(animation, hz, duration);
});
return this;
};

Client.prototype._repeat = function(times, fn) {
Expand All @@ -208,7 +196,7 @@ pcmdOptions.forEach(function(pair) {
this._pcmd[pair[0]] = speed;
delete this._pcmd[pair[1]];

return this;
return speed;
};

Client.prototype[pair[1]] = function(speed) {
Expand All @@ -217,6 +205,6 @@ pcmdOptions.forEach(function(pair) {
this._pcmd[pair[1]] = speed;
delete this._pcmd[pair[0]];

return this;
return speed;
};
});

0 comments on commit 7261424

Please sign in to comment.