wx.onBluetoothDeviceFound 获取的蓝牙广播包数据不完整?
// ArrayBuffer转16进度字符串示例
function ab2hex(buffer) {
var hexArr = Array.prototype.map.call(
new Uint8Array(buffer),
function(bit) {
return ('00' + bit.toString(16)).slice(-2)
}
)
return hexArr.join('');
}
wx.onBluetoothDeviceFound(function(res) {
var devices = res.devices;
console.log('new device list has founded')
console.dir(devices)
console.log(ab2hex(devices[0].advertisData))
})
//小程序蓝牙advertisData中的数据 4c000215fda50693a4e24fb1afcfc6eb076478252a3201f1c3 //小程序蓝牙serviceData中的数据 05f0c86a0001f100000000 //app获取的完整蓝牙数据 0x0201061AFF 4C000215FDA50693A4E24FB1AFCFC6EB076478252A3201F1C3 020A000E166473 05F0C86A0001F100000000 08094B303030316631 [图片] 小程序蓝牙获取的广播包缺少了大量的信息要如何获得完整的广播包信息?是接口不对吗?