writeBLECharacteristicValue() {
// 向蓝牙设备发送一个0x00的16进制数据
function stringToCmdBuffer(inputstr) {
return new Uint8Array(inputstr.match(/[\da-f]{2}/gi).map(function (h) {
return parseInt(h, 16)
})).buffer
}
wx.writeBLECharacteristicValue({
deviceId: this._deviceId,
serviceId: this._serviceId,
characteristicId: this._characteristicId,
value: stringToCmdBuffer('565656').slice(0, 20),
success: (res) => {
console.log('success');
},
complete: (res) => {
console.log('complete', res);
}
})
},
请问这个问题解决了吗?