臭先生
臭先生
  • 发布:2022-08-30 17:30
  • 更新:2024-03-31 02:48
  • 阅读:304

onBluetoothDeviceFound接口能够返回扫到的蓝牙设备数据,但其中的advertisData属性为空对象

分类:uni-app

hbx 3.5.3 unapp -> hbuilder标准基座

代码:
uni.openBluetoothAdapter({
success(res) {
// console.log('openBluetoothAdapter', res);
uni.startBluetoothDevicesDiscovery({
success(res2) {
// console.log('startBluetoothDevicesDiscovery', res2);
uni.onBluetoothDeviceFound(res3 => {
// console.log('onBluetoothDeviceFound', res3.devices[0]);
})
}
})
}
})
uni.getBluetoothDevices({
success(res) {
console.log('getBluetoothDevices', res)
}
})

返回值:
[{
"deviceId": "42:44:34:00:00:10",
"name": "IB10000034",
"RSSI": -64,
"localName": "IB10000034",
"advertisServiceUUIDs": [],
"advertisData": {}
}, ...]

nRF Connect app扫描结果:

2022-08-30 17:30 负责人:无 分享
已邀请:
李复卿丶

李复卿丶

大佬找到问题了嘛?我也遇到同样的问题了

要回复问题请先登录注册