command的长度超过300的时候就会出现这个问题
async writeBLECharacteristicValue({
commit,
state
}, command) {
try {
let value = str2ab(command)
const response = await new Promise((resolve, reject) => {
uni.writeBLECharacteristicValue({
deviceId: state.deviceId,
serviceId: state.serviceId,
characteristicId: state.writeCharacteristicId,
value: value,
writeType: "writeNoResponse",
success: resolve,
fail: reject
})
})
uni.showLoading({
title: "指令发送成功",
mask: true
})
commit("SET_COMMAND", command)
console.log("发送指令成功回调", response)
console.log("发送指令成功", command)
console.log("value", value)
} catch (e) {
console.log(e)
console.log("发送指令失败", command)
//TODO handle the exception
}
}
```js
l***@163.com (作者)
在线等,很急
2024-12-30 14:40