在ios9系统上完成正常,升级之后,advertisData转化成字符串 是相同的了(附截图)
代码如下:
else if (app.deviceInnfo.platform == 'ios') {
//真机
peripheral = res.devices[0];
var advertisData = peripheral.advertisData;
var data = wx.base64ToArrayBuffer(advertisData);
var str = buf2hex(data);
peripheral.mac_add = getMacAddress(str.toUpperCase());
peripheral.advertisDataStr = str;
array.push(res.devices[0]);
console.log(peripheral);
}
function buf2hex(buffer) {
return Array.prototype.map.call(new Uint8Array(buffer), x => ('00' + x.toString(16)).slice(-2)).join('');
}
这个数据是通过 getBluetoothDevices 还是 onBluetoothDeviceFound 拿到的呢?
6.5.12
微信版本号是什么?
在安卓和ios9上,是正常的,