uni.onBLEConnectionStateChange CALLBACK.value是会自动分包吗?每个包为20个大小?为什么会出现不触发或者丢包的现象
uni.onBLECharacteristicValueChange(res => {
let resHex = ab2hex(res.value)
let result = hexCharCodeToStr(resHex)
console.log('消息:', resHex)
emit('newMsg', String(result))
})
const hexArr = Array.prototype.map.call(
new Uint8Array(buffer),
function (bit) {
return '00'+bit.toString(16)).slice(-2)
}
)
return hexArr.join('')
}
0 个回复