收藏
回答

startBLEPeripheralAdvertising为什么会发送失败?

api:startBLEPeripheralAdvertisin

设备:安卓

微信版本 8.0.10

fail:  {errMsg: "startBLEPeripheralAdvertising:fail:invalid data", errCode: 10013
    wx.openBluetoothAdapter({
      mode'peripheral',
      success: (res) => {
        wx.createBLEPeripheralServer().then(res => {
          res.server.startAdvertising({
            advertiseRequest: {
              connectable: false,
              deviceName'newDeviceName',
              serviceUuids: [
                // '711B7A37-FA9E-1B1B-9C30-423A47BA9923',
                // '4552442B-E432-83AA-313A-77CAD052B3EE',
                // 'EC7C8C78-B90B-52D5-A4E9-B4146535A4F6',
                'ED:67:3B:0B:EA:59'
              ],
              manufacturerData: [{
                manufacturerId'0xFF',
                manufacturerSpecificData: buffer
              }]
            },
            powerLevel'medium'
          }).then(res => {
            console.log('success: ', res)
            if (res.errCode == 0) {
              app.showT('发送成功''success'2000)
            }
          }, res => {
            console.log("fail: ", res)
          })
        })
      },
      fail: (res) => {}
    })
回答关注问题邀请回答
收藏

1 个回答

  • 😶
    😶
    2021-09-02

    UUID格式不对

    2021-09-02
    有用
    回复 2
    • 雷向月
      雷向月
      2021-09-02
      manufacturerData 字段ios不支持,岂不是也不支持manufacturerId和manufacturerSpecificData,那我应该把我要发送的数据写在哪
      2021-09-02
      回复
    • 雷向月
      雷向月
      2021-09-02
      serviceUuids可以为空数组来发送吗
      2021-09-02
      回复
登录 后发表内容