比如我需要向蓝牙设备发送已经解析好的16进制文本:07d100000014000513881b72(实际数据为2001,0,20,5,5000,7026)
我通过方法:val = 16进制文本07d100000014000513881b72
writeValue(val) {
let that = this;
let buffer = new ArrayBuffer(val.length);
let dataView = new DataView(buffer);
dataView.setUint8(0, 0);
console.log("进入了发送程序");
uni.writeBLECharacteristicValue({
deviceId: "123450b4e7c4"
serviceId: "0000FFE0-0000-1000-8000-00805F9B34FB",
characteristicId: "0000FFE1-0000-1000-8000-00805F9B34FB",
value: buffer,
writeType: "write",
success: function (res) {
console.log("buffer", buffer);
},
fail: function (res) {
},
});
},
此方法进行发送,但是调试工具接收到的全部是00空字符(详看附件)
请问我是哪一步有问题吗,导致发送出去的字符接收错误了