小程序
小游戏
企业微信
微信支付
扫描小程序码分享
3 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
我的小程序蓝牙数据数据输出也有相同的问题,请问你的问题得到解决了吗,能不能告诉我问题出在哪儿,真的很疑惑呜呜
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
wx.onBLECharacteristicValueChange(function (res) { console.log("characteristicId:" + res.characteristicId) console.log("serviceId:" + res.serviceId)+ console.log("deviceId" + res.deviceId) console.log("Length:" + res.value.byteLength) console.log("hexvalue:" +ab2hex(res.value)) that.setData({ info: '接收的信息:\n'+ab2hex(res.value) }) }) // ArrayBuffer转10进度字符串 function ab2hex(buffer) { var hexArr = Array.prototype.map.call( new Uint8Array(buffer), function (bit) { return ('00' + bit.toString(10)).slice(-2) } ) return hexArr.join(','); }
我们的小程序使用这个接口,没发现数据重复。应该是你们自身代码问题吧。可以贴出来看看
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
我的小程序蓝牙数据数据输出也有相同的问题,请问你的问题得到解决了吗,能不能告诉我问题出在哪儿,真的很疑惑呜呜
wx.onBLECharacteristicValueChange(function (res) { console.log("characteristicId:" + res.characteristicId) console.log("serviceId:" + res.serviceId)+ console.log("deviceId" + res.deviceId) console.log("Length:" + res.value.byteLength) console.log("hexvalue:" +ab2hex(res.value)) that.setData({ info: '接收的信息:\n'+ab2hex(res.value) }) }) // ArrayBuffer转10进度字符串 function ab2hex(buffer) { var hexArr = Array.prototype.map.call( new Uint8Array(buffer), function (bit) { return ('00' + bit.toString(10)).slice(-2) } ) return hexArr.join(','); }
我们的小程序使用这个接口,没发现数据重复。应该是你们自身代码问题吧。可以贴出来看看