1 Reply Latest reply on Jan 2, 2018 10:46 PM by msur

    CY_BLE_EVT_GAP_DEVICE_CONNECTED event not generated in PSoC6 BLE


      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.

        • 1. Re: CY_BLE_EVT_GAP_DEVICE_CONNECTED event not generated in PSoC6 BLE

          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.



                  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;


                  case CY_BLE_EVT_GAP_DEVICE_CONNECTED:


                      cy_stc_ble_gap_connected_param_t *connParameters

                                                          = (cy_stc_ble_gap_connected_param_t *)eventParam;




          Let me know if this helps.



          Meenakshi Sundaram R