CY_BLE_EVT_GAP_DEVICE_CONNECTED event not generated in PSoC6 BLE

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

cross mob
lock attach
Attachments are accessible only for community members.
SuRa_2245351
Level 4
Level 4
First like received First like given

I am using CY8CKIT-062-BLE and has written small basic code for communication with CySmart android application. while implementing code I realised that  "CY_BLE_EVT_GAP_DEVICE_CONNECTED" event is not generated by PSoC6 stack. I confirmed the same by implementing project "CE212736_PSoC6BLE_FindMe01" given by cypress in same kit by enabling UART debugging. Hence I am using "CY_BLE_EVT_GATT_CONNECT_IND" event in code to check connection status as shown in project attached with this discussion.

Please confirm whether something wrong with my project code or else there some other method where "CY_BLE_EVT_GAP_DEVICE_CONNECTED" event is generated in PSoC6 BLE.

0 Likes
1 Solution
MeenakshiR_71
Employee
Employee
100 likes received 50 likes received 25 likes received

Hello rautinst_2245351​,

Please note that "CY_BLE_EVT_GAP_DEVICE_CONNECTED" event is generated only when "Link Layer privacy" is disabled. This can be done by unchecking the "Enable Link layer privacy" option in component's "Link layer Settings" tab.

Having said that, when LL privacy is enabled, instead of this event "CY_BLE_EVT_GAP_ENHANCE_CONN_COMPLETE" event is generated. The reason is both have a slightly different parameters that is passed to the handler. You can use the below code to automatically use either of the event depending on if LL privacy is enabled or not in your application.

#if(CY_BLE_LL_PRIVACY_FEATURE_ENABLED)

        case CY_BLE_EVT_GAP_ENHANCE_CONN_COMPLETE:

        {

            cy_stc_ble_gap_enhance_conn_complete_param_t *connParameters

                                                = (cy_stc_ble_gap_enhance_conn_complete_param_t *)eventParam;

    #else

        case CY_BLE_EVT_GAP_DEVICE_CONNECTED:

        {           

            cy_stc_ble_gap_connected_param_t *connParameters

                                                = (cy_stc_ble_gap_connected_param_t *)eventParam;

    #endif

Let me know if this helps.

Regards,

Meenakshi Sundaram R

View solution in original post

0 Likes
1 Reply
MeenakshiR_71
Employee
Employee
100 likes received 50 likes received 25 likes received

Hello rautinst_2245351​,

Please note that "CY_BLE_EVT_GAP_DEVICE_CONNECTED" event is generated only when "Link Layer privacy" is disabled. This can be done by unchecking the "Enable Link layer privacy" option in component's "Link layer Settings" tab.

Having said that, when LL privacy is enabled, instead of this event "CY_BLE_EVT_GAP_ENHANCE_CONN_COMPLETE" event is generated. The reason is both have a slightly different parameters that is passed to the handler. You can use the below code to automatically use either of the event depending on if LL privacy is enabled or not in your application.

#if(CY_BLE_LL_PRIVACY_FEATURE_ENABLED)

        case CY_BLE_EVT_GAP_ENHANCE_CONN_COMPLETE:

        {

            cy_stc_ble_gap_enhance_conn_complete_param_t *connParameters

                                                = (cy_stc_ble_gap_enhance_conn_complete_param_t *)eventParam;

    #else

        case CY_BLE_EVT_GAP_DEVICE_CONNECTED:

        {           

            cy_stc_ble_gap_connected_param_t *connParameters

                                                = (cy_stc_ble_gap_connected_param_t *)eventParam;

    #endif

Let me know if this helps.

Regards,

Meenakshi Sundaram R

0 Likes