蓝牙读取数据,监听返回000000000000000000什么情况
发布于 5 年前 作者 gang79 14253 次浏览 来自 问答

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,是什么情况,求解!!!

@官方

4 回复

蓝牙通讯

楼主情况解决了没?

wechatide://minicode/0AAN1WmI6dYg

回到顶部