我在windows上编写代码,用安卓手机预览,微信版本是6.5.8,但是用下面的代码获取蓝牙设备列表,但是列表是空的,我手机的安卓的版本是4.4.4,这个功能跟安卓版本没关系吧,只跟微信版本有关吧
wx.openBluetoothAdapter({
success: function (res) {
// success
console.log("-----success----------");
console.log(res);
//开始搜索
wx.startBluetoothDevicesDiscovery({
// services: [],
success: function (res) {
// success
console.log("-----startBluetoothDevicesDiscovery–success----------");
console.log(res);
},
fail: function (res) {
// fail
console.log(res);
},
complete: function (res) {
// complete
console.log(res);
wx.onBluetoothDeviceFound(function(devices) {
console.log(‘new device list has founded 2’)
console.dir(devices)
})
}
})
},
fail: function (res) {
console.log("-----fail----------");
// fail
console.log(res);
},
complete: function (res) {
// complete
console.log("-----complete----------");
console.log(res);
}
})