index.js
function(filter,cb) {
      if (!filter) {
        filter = {};
      } else if (typeof filter == "function") {
        cb = filter;
        filter = {};
      } else if (typeof filter == "string") {
        filter = {device_type:filter}; // Backwards compatibility
      }
      var opts = {
        url: uri + 'devices',
        method: 'GET',
        qs: qs,
        json: true
      };
      request(opts,function(e,r,b) {
        if (e) cb(e)
        else if (b.result===1) cb(null, utils.filter(filter,b.data))
        else cb({statusCode:b.id||200,error:b.error})
      });
    }
function(filter,cb) {
      if (!filter) {
        filter = {};
      } else if (typeof filter == "function") {
        cb = filter;
        filter = {};
      } else if (typeof filter == "string") {
        filter = {device_type:filter}; // Backwards compatibility
      }
      var opts = {
        url: uri + 'devices',
        method: 'GET',
        qs: qs,
        json: true
      };
      request(opts,function(e,r,b) {
        if (e) cb(e)
        else if (b.result===1) cb(null, utils.filter(filter,b.data))
        else cb({statusCode:b.id||200,error:b.error})
      });
    }
function ( filter , cb ) { if ( ! filter ) { filter = { } ; } else if ( typeof filter == "function" ) { cb = filter ; filter = { } ; } else if ( typeof filter == "string" ) { filter = { device_type : filter } ; // Backwards compatibility } var opts = { url : uri + 'devices' , method : 'GET' , qs : qs , json : true } ; request ( opts , function ( e , r , b ) { if ( e ) cb ( e ) else if ( b . result === 1 ) cb ( null , utils . filter ( filter , b . data ) ) else cb ( { statusCode : b . id || 200 , error : b . error } ) } ) ; }
Fetches all the user's device details.
Optionally if an object is passed as the first argument,
it will filter by the parameters. If a string is provided,
it will assume it's the device type intended for filtering.

Example:
app.devices('rgbled',function(err, data) { ... })
app.devices({shortName:'On Board RGB LED'},function(err,data){ ... })
app.devices({vid:0, shortName:'On Board RGB LED'},function(err,data){ ... })

@param {String/Object} filter
@param {Function} cb
@api public
Fetches all the user s device details . Optionally if an object is passed as the first argument it will filter by the parameters . If a string is provided it will assume it s the device type intended for filtering .