2016-12-25 114 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"); 
      }