lib/drone.js
function land(options, callback) {
  if (typeof options === 'function') {
    callback = options;
    options = {};
  }
  this.logger('RollingSpider#land');
  if (this.status.flying) {
    this.writeTo(
      'fa0b',
      new Buffer([0x02, ++this.steps.fa0b & 0xFF, 0x02, 0x00, 0x03, 0x00])
    );

    this.on('flyingStatusChange', function(newStatus) {
      if (newStatus === 0) {
        this.status.flying = false;
        if (typeof callback === 'function') {
          callback();
        }
      }
    });

  } else {
    this.logger('Calling RollingSpider#land when it\'s not in the air isn\'t going to do anything');
    if (callback) {
      callback();
    }
  }
}
function land(options, callback) {
  if (typeof options === 'function') {
    callback = options;
    options = {};
  }
  this.logger('RollingSpider#land');
  if (this.status.flying) {
    this.writeTo(
      'fa0b',
      new Buffer([0x02, ++this.steps.fa0b & 0xFF, 0x02, 0x00, 0x03, 0x00])
    );

    this.on('flyingStatusChange', function(newStatus) {
      if (newStatus === 0) {
        this.status.flying = false;
        if (typeof callback === 'function') {
          callback();
        }
      }
    });

  } else {
    this.logger('Calling RollingSpider#land when it\'s not in the air isn\'t going to do anything');
    if (callback) {
      callback();
    }
  }
}
function land ( options , callback ) { if ( typeof options === 'function' ) { callback = options ; options = { } ; } this . logger ( 'RollingSpider#land' ) ; if ( this . status . flying ) { this . writeTo ( 'fa0b' , new Buffer ( [ 0x02 , ++ this . steps . fa0b & 0xFF , 0x02 , 0x00 , 0x03 , 0x00 ] ) ) ; this . on ( 'flyingStatusChange' , function ( newStatus ) { if ( newStatus === 0 ) { this . status . flying = false ; if ( typeof callback === 'function' ) { callback ( ) ; } } } ) ; } else { this . logger ( 'Calling RollingSpider#land when it\'s not in the air isn\'t going to do anything' ) ; if ( callback ) { callback ( ) ; } } }
Instructs the drone to land if it's in the air.
Instructs the drone to land if it s in the air .