蓝牙读取数据,监听返回000000000000000000什么情况

发布于 7 年前作者 gang7914473 次浏览最后编辑 7 年前来自 ask

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 回复
fang04
fang041 楼6 年前

蓝牙通讯

nafu
nafu2 楼6 年前

楼主情况解决了没?

taoyu
taoyu4 楼5 年前

wechatide://minicode/0AAN1WmI6dYg