请问这个里面怎么填入地址?我已经获取了蓝牙匹配列表
//获取已配对蓝牙列表
function bluetooth_list(){
var main = plus.android.runtimeMainActivity();
var Context = plus.android.importClass("android.content.Context");
var BluetoothAdapter = plus.android.importClass("android.bluetooth.BluetoothAdapter");
var BAdapter = BluetoothAdapter.getDefaultAdapter();
var lists = BAdapter.getBondedDevices();
plus.android.importClass(lists);
var resultDiv = document.getElementById('bluetooth_list');
var iterator = lists.iterator();
plus.android.importClass(iterator);
while (iterator.hasNext()) {
var d = iterator.next();
plus.android.importClass(d);
console.log(d.getAddress());
}
}
通过这个方法控制台已经输出了两个地址
00:11:22:33:44:55 at erweimapic.html:174
9C:B2:B2:37:D9:38 at erweimapic.html:174
0 个回复