第一步:找代码
截屏2020-01-13下午2.48.09.png
https://github.com/search?l=JavaScript&p=4&q=%E8%93%9D%E7%89%99&type=Repositories
第二步:找说明
百度一下或者👇的连接
https://www.jianshu.com/p/ef4a77328b70
第三步:了解基本概念
iOS我已经做过了,这一步我就省了。自行百度。
https://github.com/coolnameismy/BabyBluetooth
截屏2020-01-13下午6.03.20.png
第四部:和嵌入式工程师 调试代码
数据类型转换:
字符串与十六进制的相互转换
https://blog.csdn.net/qmdweb/article/details/80898791
16进制字符串转byte数组相互转化
https://blog.csdn.net/qmdweb/article/details/80898791
16进制字符串转byte数组
//16str- btye
var hex = '6f4e';
var typedArray = new Uint8Array(hex.match(/[\da-f]{2}/gi).map(function (h) {
return parseInt(h, 16)
}))
console.log(typedArray)
console.log([0x6f,0x4e]);