This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

关于主机获取从机属性表的问题

请问一下,我利用GATT_DiscAllCharDescs函数获取到了从机属性表里的所有句柄和UUID,但是我现在不知道主机如何可以分辨出哪些属于特征值1,哪些属于特征值2的?请问这个如何做到,我收到的数据手动都对过了,是对的。

上面这个是收到数据的部分截图(因为一次只能5个,这是第2次的)

pMsg->msg.findInfoRsp.info.btPair 数据路径

  • 每个特征值的UUID不同,可以据此区别

  • Viki Shi 你好,

    我的意思是主机如何判断 发现的这些UUID哪些是属于特征值1的,哪些是属于特征值4的,比如特征值1里面包涵了3个UUID,特征值4里面有4个UUID。。

    // Characteristic 1 Declaration 
        {
          { ATT_BT_UUID_SIZE, characterUUID },//0X2803
          GATT_PERMIT_READ,
          0,
          &simpleProfileChar1Props
        },
          // Characteristic Value 1 
          {
            { ATT_BT_UUID_SIZE, simpleProfilechar1UUID },//0XFFF1
            GATT_PERMIT_READ | GATT_PERMIT_WRITE,
            0,
            &simpleProfileChar1
          },
          // Characteristic 1 User Description 
          {
            { ATT_BT_UUID_SIZE, charUserDescUUID },//0X2901
            GATT_PERMIT_READ,
            0,
            simpleProfileChar1UserDesp
          },
    // Characteristic 4 Declaration
        {
          { ATT_BT_UUID_SIZE, characterUUID },
          GATT_PERMIT_READ,
          0,
          &simpleProfileChar4Props
        },
          // Characteristic Value 4
          {
            { ATT_BT_UUID_SIZE, simpleProfilechar4UUID },
            0,
            0,
            &simpleProfileChar4
          },
          // Characteristic 4 configuration
          {
            { ATT_BT_UUID_SIZE, clientCharCfgUUID },
            GATT_PERMIT_READ | GATT_PERMIT_WRITE,
            0,
            (uint8 *)simpleProfileChar4Config
          },
         
          // Characteristic 4 User Description
          {
            { ATT_BT_UUID_SIZE, charUserDescUUID },
            GATT_PERMIT_READ,
            0,
            simpleProfileChar4UserDesp
          },
    就像LightBiue软件一样,把服务中的特征值区分开,
    如特征值1的名称、读写特性、UUID(特征值4的话还包括通知)