怎么把input获取到的值转成16进制发送给蓝牙设备
function transData(data){
var typedArray = new Uint8Array(data.match(/[\da-f]{2}/gi).map(function (h) {
return parseInt(h, 16)
}))
var buf = typedArray.buffer
return buf
}
var data = “你的input值”
transData(data)