// ArrayBuffer转16进度字符串示例functionab2hex(buffer){consthexArr =Array.prototype.map.call(newUint8Array(buffer),function(bit){return('00'+ bit.toString(16)).slice(-2) } )returnhexArr.join('')}wx.onBluetoothDeviceFound(function(devices){console.log('new device list has founded')console.dir(devices)console.log(ab2hex(devices[0].advertisData))})
网友评论