lib/serial/globaldeviceloader.js
function(interval, callback) {
    if (lookupIntervalId) {
      return;
    }

    isRunning = true;

    if (!callback && _.isFunction(interval)) {
      callback = interval;
      interval = null;
    }

    interval = interval || 500;

    globalSerialDeviceLoader.trigger(function(err) {
      var triggering = false;
      lookupIntervalId = setInterval(function() {
        if (triggering) return;
        triggering = true;
        globalSerialDeviceLoader.trigger(function() {
          triggering = false;
        });
      }, interval);

      if (err && !err.name) {
        err = new Error(err);
      }
      if (callback) { callback(err); }
    });
  }
function(interval, callback) {
    if (lookupIntervalId) {
      return;
    }

    isRunning = true;

    if (!callback && _.isFunction(interval)) {
      callback = interval;
      interval = null;
    }

    interval = interval || 500;

    globalSerialDeviceLoader.trigger(function(err) {
      var triggering = false;
      lookupIntervalId = setInterval(function() {
        if (triggering) return;
        triggering = true;
        globalSerialDeviceLoader.trigger(function() {
          triggering = false;
        });
      }, interval);

      if (err && !err.name) {
        err = new Error(err);
      }
      if (callback) { callback(err); }
    });
  }
function ( interval , callback ) { if ( lookupIntervalId ) { return ; } isRunning = true ; if ( ! callback && _ . isFunction ( interval ) ) { callback = interval ; interval = null ; } interval = interval || 500 ; globalSerialDeviceLoader . trigger ( function ( err ) { var triggering = false ; lookupIntervalId = setInterval ( function ( ) { if ( triggering ) return ; triggering = true ; globalSerialDeviceLoader . trigger ( function ( ) { triggering = false ; } ) ; } , interval ) ; if ( err && ! err . name ) { err = new Error ( err ) ; } if ( callback ) { callback ( err ) ; } } ) ; }
Starts to lookup.
@param  {Number}   interval The interval milliseconds. [optional]
@param  {Function} callback The function, that will be called when trigger has started. [optional]
`function(err){}`
Starts to lookup .