微信小程序蓝牙发送中文。数据怎么个处理法?

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

蓝牙小程序怎么发送中文。

inputValue为值。

var buffer = inputValue.buffer;

wx.writeBLECharacteristicValue({

      deviceId: that.data.deviceId,

      serviceId: that.data.serviceId,

      characteristicId: that.data.characteristicId,

      value: buffer,

      success: function (res) {

        console.log(res)

        console.log('writeBLECharacteristicValue success===', res.errMsg)

      },

      fail:function(res){

        console.log('写入失败')

      }

    })

这里会直接到写入失败。

0 回复
暂无回复