收藏
回答

wx.writeBLECharacteristicValue


系统返回10008,麻烦帮吗解答下,谢谢

回答关注问题邀请回答
收藏

6 个回答

  • Tummy
    Tummy
    2017-11-21


    确认是不是对正确的特征值进行了操作。

    2017-11-21
    有用
    回复
  • Tummy
    Tummy
    2017-11-09

    10008是系统错误哈,一般返回10008是因为该特征值的属性不支持write,

    或者是频繁调用操作特征值的接口如:

    建议加延时操作。

    2017-11-09
    有用
    回复
  • Tummy
    Tummy
    2017-11-09

    你好,我来跟进一下这个问题哈,方便复现一下问题,提供相应的微信号,并在任意聊天框输入//uplog上传日志?

    2017-11-09
    有用
    回复
  • sunny · 阳光
    sunny · 阳光
    2017-11-17

    调用wx.writeBLECharacteristicValue(OBJECT)

    返回是10007,不知道什么原因

    2017-11-17
    有用
    回复
  • sunny · 阳光
    sunny · 阳光
    2017-11-17

    是因为这个原因吗,请问,该怎么解决呢

    2017-11-17
    有用
    回复
  • sunny · 阳光
    sunny · 阳光
    2017-11-08

     // 向蓝牙设备发送一个0x00的16进制数据

                                  let buffer = new ArrayBuffer(16)

                                  let dataView = new DataView(buffer)

                                  dataView.setUint8(0, 0x06)

                                  dataView.setUint8(0, 0x01)

                                  dataView.setUint8(0, 0x01)

                                  dataView.setUint8(0, 0x01)

                                  dataView.setUint8(0, 0x00)

                                  dataView.setUint8(0, 0x00)

                                  dataView.setUint8(0, 0x00)

                                  dataView.setUint8(0, 0x00)

                                  dataView.setUint8(0, 0x00)

                                  dataView.setUint8(0, 0x00)

                                  dataView.setUint8(0, 0x00)

                                  dataView.setUint8(0, 0x00)

                                  dataView.setUint8(0, 0x00)

                                  dataView.setUint8(0, 0x00)

                                  dataView.setUint8(0, 0x00)

                                  dataView.setUint8(0, 0x00)

                                  wx.writeBLECharacteristicValue({

                                    // 这里的 deviceId 需要在上面的 getBluetoothDevices 或 onBluetoothDeviceFound 接口中获取

                                    deviceId: 'EB:BB:11:14:CA:CA',

                                    // 这里的 serviceId 需要在上面的 getBLEDeviceServices 接口中获取

                                    serviceId: '0000fee7-0000-1000-8000-00805f9b34fb',

                                    // 这里的 characteristicId 需要在上面的 getBLEDeviceCharacteristics 接口中获取

                                    characteristicId: '000036f5-0000-1000-8000-00805f9b34fb',

                                    // 这里的value是ArrayBuffer类型

                                    value: buffer,

                                    success: function (res) {

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

                                    },

                                    fail:function(res){

                                      console.log('失败'+res)

                                      console.log(res)

                                    }

                                  })


    2017-11-08
    有用
    回复
登录 后发表内容