wx.getBLEDeviceCharacteristics({
deviceId,
serviceId,
success: (res) => {
console.log('getBLEDeviceCharacteristics success', res.characteristics)
for (let i = 0; i < res.characteristics.length; i++) {
let item = res.characteristics[i]
if (item.properties.read) {
wx.readBLECharacteristicValue({
deviceId,
serviceId,
characteristicId: item.uuid,
})
}
if (item.properties.write) {
this.canWrite = true
this._deviceId = deviceId
this._serviceId = serviceId
this._characteristicId = item.uuid
//this.writeBLECharacteristicValue()
}
给this对象内该属性赋值,可以随便定义(关键字除外)
就一个变量名啊