Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

PSoC™ 6 Forum Discussions

JaWa_4152831
Level 3
Level 3
10 replies posted 10 questions asked 5 replies posted

from CySmart mobile app I connect to my device (CYBLE-416045-02) and navigate to the notification service and click the start Notify button and notifications are not enabled on the device

DEBUG_BLE("write_req_param->handleValPair.attrHandle = %d",\

                write_req_param->handleValPair.attrHandle);

            DEBUG_BLE(" -> Should be = CUSTOM_SERV0_CHAR0_DESC0_HANDLE (%d)"\

                "\r\n-> Should be = CUSTOM_SERV0_CHAR0_HANDLE(%d)\r\n",\

                CUSTOM_SERV0_CHAR0_DESC0_HANDLE, CUSTOM_SERV0_CHAR0_HANDLE);

                 

          

if(write_req_param->handleValPair.attrHandle == (CUSTOM_SERV0_CHAR0_DESC0_HANDLE))

{

....ENABLE NOTIFICATION CODE....

}

write_req_param->handleValPair.attrHandle = 29

CUSTOM_SERV0_CHAR0_DESC0_HANDLE = 28

CUSTOM_SERV0_CHAR0_HANDLE = 27

the CUSTOM_SERV0_CHAR0_DESC0_HANDLE is 28 and the write_req_param->handleValPair.attrHandle is 29 so I added + 1 to the above check

DEBUG_BLE("write_req_param->handleValPair.attrHandle = %d",\

                write_req_param->handleValPair.attrHandle);

            DEBUG_BLE(" -> Should be = CUSTOM_SERV0_CHAR0_DESC0_HANDLE (%d)"\

                "\r\n-> Should be = CUSTOM_SERV0_CHAR0_HANDLE(%d)\r\n",\

                CUSTOM_SERV0_CHAR0_DESC0_HANDLE, CUSTOM_SERV0_CHAR0_HANDLE);

                 

          

if(write_req_param->handleValPair.attrHandle == (CUSTOM_SERV0_CHAR0_DESC0_HANDLE + 1)) !!!!! add 1 to CUSTOM_SERV0_CHAR0_DESC0_HANDLE

{

....ENABLE NOTIFICATION CODE....

}

by doing this I was able to get notifications on my device working.

I am sure this is not the proper way to do this but noting else that works what is the proper way to get this working?

Questions Why is notifications not enabling on my device (CYBLE-416045-02)?

0 Likes
1 Solution

The CCCD handle maybe not visible from TopDesign GUI. You can find it in data array cy_ble_gattDB() generated in BLE_config.c -

pastedImage_0.png

View solution in original post

0 Likes
3 Replies
ShipingW_81
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 replies posted

To enable the notification on GATT Server, the GATT Client needs to write proper value to the CCCD of target Characteristic on GATT Server.

CUSTOM_SERV0_CHAR0_DESC0_HANDLE might not be the correct one. Can you double-check the handle value of target CCCD on your custom design?

For general flow to enable Notification for a custom Characteristic on GATT Server, the attached project might be a good example.

0 Likes

what is the handle value of target CCCD is it in the BLE 5 GUI component from TopDesign.sch?

0 Likes

The CCCD handle maybe not visible from TopDesign GUI. You can find it in data array cy_ble_gattDB() generated in BLE_config.c -

pastedImage_0.png

0 Likes