ble.scan([],5,function(device){postMessage(device.name)},function(error){});
答案 0 :(得分: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");
}