let closekey = 53da3c5908296b48abfb64bee4bb94ee
const characteristicId =00009004-0000-1000-8000-00805F9B34FB
const buffer = new ArrayBuffer(closekey)
console.log('命令值',buffer);
console.log('deviceId',this.deviceId);
console.log('serviceId', this.serviceId)
uni.writeBLECharacteristicValue({
deviceId:this.deviceId,
serviceId: this.serviceId,
characteristicId,
value: buffer,
success: async (res) => {
console.log('写入指令发送成功', res)
},
fail: (e) => {
console.log('writeBLECharacteristicValue,错误码:'+ JSON.stringify(e));
console.log('当前deviceId', this.deviceId)
console.log('当前serviceid', this.serviceId)
console.log('当前characteristicId', characteristicId)
}
})
1 个回复
蓝天0730 (作者)
有没有大佬解答一下呀,是deviceId格式不对吗