- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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