cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

Anonymous
Not applicable

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

0 Likes
Reply
1 Solution
Anonymous
Not applicable

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.

View solution in original post

0 Likes
Reply
2 Replies
Anonymous
Not applicable

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.

View solution in original post

0 Likes
Reply
Anonymous
Not applicable

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?

0 Likes
Reply