2 Replies Latest reply on Mar 7, 2017 1:09 AM by davidcaraveo54_2033506

    How to indentify the handles from a findInfoResponse?

    davidcaraveo54_2033506

      Hello everyone

         

       

         

      I´m developing a BLE GATT client and GAP central,  and i want to find my handle of some services that i created using the following event to find my handle of my data characteristic

         

      CYBLE_EVT_GATTC_READ_BY_TYPE_RSP:
      readResponse = (CYBLE_GATTC_READ_BY_TYPE_RSP_PARAM_T *) eventParam;

         

      and this event to find mmy handles of data characteristic descriptor:

         

      CYBLE_EVT_GATTC_FIND_INFO_RSP:
      findInfoResponse = (CYBLE_GATTC_FIND_INFO_RSP_PARAM_T *) eventParam;

         

      I am using the 100 projects in 100 day: UART_TO_BLE_CENTRAL, it´s where I found the documentation, but I have a problem, 

         

      how do I will know on which list are my handles that i need?

         

      for example on the project of 100 day they use the following example

         

       if((0x29 == findInfoResponse->handleValueList.list[3]) && \
                                      (0x02 == findInfoResponse->handleValueList.list[2]))
                  {
                      txCharDescHandle = findInfoResponse->handleValueList.list[0];
                      txCharDescHandle |= findInfoResponse->handleValueList.list[1] << 8;
                  }

         

      How they did know that on array 3 of the list, the information of the handle was?

         

      I attached a pictures of the list of the services, I need the QuatServ

         

      Thanks

         

       

         

      David Caraveo

        • 1. Re: How to indentify the handles from a findInfoResponse?
          yssu

          Hi David,

             

          You can find the handles of custom characteristics, characteristic declarations, and descriptors in the BLE_custom.h file under Generated Source. You can use the macros of the handles defined in this file.

             

          Coming to the UART_BLE_Central example, the format of the find information response was known to the code developer. When the find information response returns 0x2902(CCCD) on byte 3 and 2, the lower two bytes(byte 1 and 0) would return the handle of the CCCD.

             

          In the above case, we are trying to determine the handle of an attribute on the server. In your case, since you are the server, you can find the handles directly in the BLE_custom.h.

             

          Hope this helps! Have a great day.

          • 2. Re: How to indentify the handles from a findInfoResponse?
            davidcaraveo54_2033506

            Hallo Yssu,

               

            I think so you missundertood me, I am working with a central not with a server. I understood how work now with your explanation, but what happend if I´ve more than one CCCD?