Understanding BLE 4.2 Data Length, Security, Privacy Example Project

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

cross mob
Anonymous
Not applicable

I've been going over this project and am having a tough time figuring out the order when it comes to Authenticating/Bonding/Pairing versus connecting to a bonded peer.  It jumps back and forth through main.c, so I can't really get a clear understanding of the StackEvent order.

   

I'm coding both central and peripheral roles on 2 separate devices.  I understand that when 2 unbonded devices go through the authentication procedure, the CYBLE_EVT_GAP_AUTH_COMPLETE event is returned, but what is returned when the devices are bonded and a connection is made?

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi,

   

First the device will connect, that time the event CYBLE_EVT_GAP_DEVICE_CONNECTED

   

When the device paired successfully and authentication completed, it will trigger event CYBLE_EVT_GAP_AUTH_COMPLETE

   

After Bonding, no events will get triggered. But you can confirm whether bonding was successfull by checking the API result of CyBle_StoreBondingData API.

   

I am attaching a basic bonding example  project. Please go through it for reference.

   

Thanks & Regards,

   

Anjana

View solution in original post

0 Likes
4 Replies
lock attach
Attachments are accessible only for community members.
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi,

   

First the device will connect, that time the event CYBLE_EVT_GAP_DEVICE_CONNECTED

   

When the device paired successfully and authentication completed, it will trigger event CYBLE_EVT_GAP_AUTH_COMPLETE

   

After Bonding, no events will get triggered. But you can confirm whether bonding was successfull by checking the API result of CyBle_StoreBondingData API.

   

I am attaching a basic bonding example  project. Please go through it for reference.

   

Thanks & Regards,

   

Anjana

0 Likes
Anonymous
Not applicable

Thank you.  So, just to be certain, after CYBLE_EVT_GAP_AUTH_COMPLETE, devices are connected until disconnect is issued.  Then (provided bonded device is stored) what event would be triggered on reconnect?  Specifically if the the 4.2 device was advertising directly to the central device.  I know there's a scan event that triggers on the central side when direct advertising is used, which then the central can call a connection, but after connection?

0 Likes
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi

   

After connection always CYBLE_EVT_GAP_DEVICE_CONNECTED event will get trigger (Even it is a reconnect after disconnection).

   

And if the device passed authentication process successfully , the event CYBLE_EVT_GAP_AUTH_COMPLETE will get triggered (if not disconnected).

   

Thanks,
Anjana

Anonymous
Not applicable

Hi,

I downloaded the project and tried to build but it was missing the BLE portion.

I have CY8CKIT-042-BLE and PSoC Creator 4.1

How can I build?

Also, which file can I see the pairing/bonding/passkey setup?

Thanks,

Asha

0 Likes