Is there a pairing state under CYBLE_EVENT_T enum?

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

cross mob
EyGe_3183606
Level 4
Level 4
25 replies posted 10 sign-ins 10 replies posted

Hello,

I have an MCU CYBLE-224110 (BLE 4.1).

The profile role is GATT server.

The GAP role is peripheral.

Here are out security settings (in PSOC Creator): 

EyGe_3183606_0-1627905478703.png

I wanted to know what are the CYBLE_EVENT_T events to identify bonding and pairing separately. 

To my understanding, the process is first: connection --> pairing --> bonding

I need to be in a situation where I can identify the pairing stage before bonding occurs and do some logic. 

For connection I use: CYBLE_EVT_GAP_DEVICE_CONNECTED

For Bonding I use either: CYBLE_EVT_PENDING_FLASH_WRITE or CYBLE_EVT_GAP_AUTH_COMPLETE 

What can I use for the Pairing stage?

 

Thanks,

Eyal

0 Likes
1 Solution
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

Once the pairing is initiated, CYBLE_EVT_GAP_SMP_NEGOTIATED_AUTH_INFO SMP negotiated auth info event is raised as soon as SMP has completed pairing properties (feature exchange) negotiation. The event parameter is CYBLE_GAP_AUTH_INFO_T. CYBLE_GAP_AUTH_INFO_T will have the negotiated parameter, the pairing should either pass with these negotiated parameters or may fail.

During pairing process, CYBLE_EVT_GAP_AUTH_REQ event is received by Peripheral and Central devices. When it is received by Peripheral, peripheral needs to Call CyBle_GappAuthReqReply() to reply to authentication request from Central. When this event is received by Central, that means the slave has requested Central to initiate authentication procedure. Central needs to call CyBle_GappAuthReq() to initiate authentication procedure.

For more information on pairing process, please refer to the 'section 6.1 Update to Pairing Process' in AN99209 datasheet.

Also, please refer to the Day016_Authentication and Day015_Bonding code examples from the GitHub.

Thanks,
P Yugandhar.

View solution in original post

0 Likes
1 Reply
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

Once the pairing is initiated, CYBLE_EVT_GAP_SMP_NEGOTIATED_AUTH_INFO SMP negotiated auth info event is raised as soon as SMP has completed pairing properties (feature exchange) negotiation. The event parameter is CYBLE_GAP_AUTH_INFO_T. CYBLE_GAP_AUTH_INFO_T will have the negotiated parameter, the pairing should either pass with these negotiated parameters or may fail.

During pairing process, CYBLE_EVT_GAP_AUTH_REQ event is received by Peripheral and Central devices. When it is received by Peripheral, peripheral needs to Call CyBle_GappAuthReqReply() to reply to authentication request from Central. When this event is received by Central, that means the slave has requested Central to initiate authentication procedure. Central needs to call CyBle_GappAuthReq() to initiate authentication procedure.

For more information on pairing process, please refer to the 'section 6.1 Update to Pairing Process' in AN99209 datasheet.

Also, please refer to the Day016_Authentication and Day015_Bonding code examples from the GitHub.

Thanks,
P Yugandhar.

0 Likes