收藏
回答

wx.readBLECharacteristicValue怎么接收多个特征值ID,怎么解决?

 这样写读出来的数据会被覆盖掉,怎么解决,求助!

if (res.characteristics[i].properties.read{

                console.log("readServicweId:", myUUID);

                console.log("readCharacteristicsId:", res.characteristics[i].uuid);

                that.setData({


                    characteristics:[

                        ...that.data.readCharacteristics,

                        {

                            readServicweId: myUUID,

                            readCharacteristicsId: "CEB5555A-55E1-5555-55F5-EA0736155555",

                        }

                    ]


                })

              }


              if (res.characteristics[i].properties.write{

                console.log("writeServicweId:", myUUID);

                console.log("writeCharacteristicsId:", res.characteristics[i].uuid);

                that.setData({

                  writeServicweId: myUUID,

                  //writeCharacteristicsId: res.characteristics[i].uuid,

                  writeCharacteristicsId: "BEB5555A-55E1-5555-55F5-EA0736155555",//手动设置writeCharacteristicsId为这个UUID,为了方便写死在这里

                })

              }


回答关注问题邀请回答
收藏
登录 后发表内容