2016-12-25 76 views

回答

0

我希望这对你的作品....

var devices=[]; 
     ble.startScan([], 
      function(peripheral) 
      { 
       devices.push(peripheral); 
      }, 
      function(error) 
      { 
       console.log(error); 
      }); 

     setTimeout(ble.stopScan, 1500, 
      function() 
      {      
       console.log("scan stopped.) 
      }, 
      function() 
      { 
       console.log("stopScan failed"); 
      }