html52.com
我爱小程序-开发者交流社区

蓝牙写数据后模块收不到数据但是返回的是写入成功

问题模块
API和组件

 模块写数据代码如下  使用的是苹果手机,返回写入成功但是蓝牙模块没有收到任何数据,蓝牙模块发送过来的数据可以接收到,有没有人知道是什么问题?

var that = this;
        var hex = 'aaaaaaaaa'
        var typedArray = new Uint8Array(hex.match(/[\da-f]{2}/gi).map(function (h) {
            return parseInt(h, 16)
        }))
        var value = typedArray.buffer
      console.log("写入数据:",that.buf2hex(value));
        wx.writeBLECharacteristicValue({
          deviceId: deviceId,
          serviceId: serviceId,
          characteristicId: characteristicId,
          value: value,
          success: function(res){
            // success
            console.log("写数据成功:",res)
          },
          fail: function(res) {
             console.log("写数据失败:",res)
            // fail
          },
          complete: function(res) {
            // complete
          }
        })
   }

网友回复

范范范先森:

占楼,请问楼主解决没有


追梦的人(IT大叔一枚):

这个问题我也纠结中,主要是栗子太少了.非官方也就一个,还不确定是否可行,而官方的又过于简单..

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付