title: How can i Fetch USB Device Bus-Type GUID properties through node?
body: <p>I am trying to check if USB Debugging is turned on or off through NPM/Node. As soon as an android phone is connected to my system and USB Debugging is turned off, then i need to show a prompt to user to enable usb debugging on his phone. </p>
  
  <p>According to my research, every device (Scanner/Phones/USB) connected to my system has a unique GUID which helps me to distinguish which device is connected. Further, i'm not able to fetch the usb debugging details. 
  Please help!</p>
  
  <p><a href="https://i.stack.imgur.com/Al97x.png" rel="nofollow noreferrer">I want this property which is in this link</a></p>
  
  <p>Code which i have written so far is on the basis of <strong>iSerialNumber</strong> but i want to distinguish it on the basis of <strong>BUS-TYPE GUID</strong>.</p>
  
  <pre><code>var usb = require('usb');
  
  usb.on('attach', function(device) 
  {
      var devices = usb.getDeviceList();
      var check = devices[0].deviceDescriptor;
      if(check.iSerialNumber == '3')
      {
          console.log("Please enable USB Debugging");
      }
      else
      {
          console.log("Connect an Android device");
      }
  });
  </code></pre>
  
  <p><strong>Here is the latest code which i have tried, but it works only for Samsung devices:-</strong></p>
  
  <pre><code>var usbDetect = require('usb-detection');
  var Promise = require('bluebird');
  var adb = require('adbkit');
  var client = adb.createClient();
  
  usbDetect.on('add', function(dev) {
      setTimeout(checkAndyDevice, 1500);
   }); 
  
  var checkAndyDevice = function(){
   client.listDevices()
        .then(function(devices) {
          return Promise.map(devices, function() {
            return devices;
          })
        })
        .then(function(id) {
          if((JSON.stringify(id)) == '[]')
          {
              console.log("Please enable Usb Debugging option from your Android device");
          }
        })
        .catch(function(err) {
          console.error('Something went wrong:', err.stack)
        });
   };
  </code></pre>