wx.onBLECharacteristicValueChange(function (characteristic) {
var creaddata = wx.arrayBufferToBase64(characteristic.value)
var v = characteristic;
console.log(‘creaddata:’ + creaddata);
console.log(`characteristic ${characteristic.characteristicId} has changed, now is ${characteristic.value}`)
})
console.log(that.data.readServicweId);
console.log(that.data.readCharacteristicsId);
wx.readBLECharacteristicValue({
// 这里的 deviceId 需要在上面的 getBluetoothDevices 或 onBluetoothDeviceFound 接口中获取
deviceId: that.data.connectedDeviceId,
// 这里的 serviceId 需要在上面的 getBLEDeviceServices 接口中获取
serviceId: that.data.readServicweId,
// 这里的 characteristicId 需要在上面的 getBLEDeviceCharacteristics 接口中获取
characteristicId: that.data.readCharacteristicsId,
success: function (res) {
console.log(‘readBLECharacteristicValue:’, res.errMsg);
}
})
characteristic.value 输出为000000000000000000,是什么情况,求解!!!
@官方