cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ 4

YuAr_1521891
New Contributor II

Hello,

I'm looking for some guidance in how the authentication process through passkey works.

I have found some examples showing the peripheral side, like this one: PSoC4-MCU-BLE-Connectivity-Designs/BLE_Continuous_Glucose_Monitoring_Sensor at master · cypresssemic...

My application covers both peripheral and central devices. I'd like to know what the central device central should do regarding authentication events and functions.

Actually what I'm trying to accomplish is to make my peripheral devices connect only to my centrals, and vice versa. Both of them do not have a keyboard or display, so I'm planning to use a part of their BLE MAC address as passkey.

Is it possible to do so using just PSoC's BLE native functions? Is there any example around regarding authentication showing both sides (peripheral and central)?

Cheers,

Yuri

0 Likes
1 Solution
VenkataD_41
Moderator
Moderator

Hi Yuri,

Please find the attached Central and peripheral project pair. If you have two Cypress development kits program your projects on those two kits. Please follow the instructions that will be displayed on the UART terminals. All types of authentication modes are implemented in the project. The Central and Peripheral pair select the appropriate authentication mode based on the corresponding setting of central/peripheral project.

For theory, you can go through the following application note.

AN99209- PSoC 4 BLE and PRoC BLE: Bluetooth LE 4.2 Features

Thanks

Ganesh

View solution in original post

4 Replies
VenkataD_41
Moderator
Moderator

Hi Yuri,

Please find the attached Central and peripheral project pair. If you have two Cypress development kits program your projects on those two kits. Please follow the instructions that will be displayed on the UART terminals. All types of authentication modes are implemented in the project. The Central and Peripheral pair select the appropriate authentication mode based on the corresponding setting of central/peripheral project.

For theory, you can go through the following application note.

AN99209- PSoC 4 BLE and PRoC BLE: Bluetooth LE 4.2 Features

Thanks

Ganesh

View solution in original post

YuAr_1521891
New Contributor II

Hi Ganesh,

Thank you very much for your reply.

That is exactly the kind of example I was looking for, with both peripheral and central covering various types of pairing.

Cheers,

Yuri

0 Likes
YuAr_1521891
New Contributor II

I have some questions, though:

1) In your application peripheral's side, in the event CYBLE_EVT_GAP_AUTH_REQ, there is a call to the function CyBle_GappAuthReqReply. However the API returned CYBLE_ERROR_INVALID_OPERATION. I've found in another thread that the function doesn't need to be called because it is already called in the auto generated source files. Why is it being called in the CYBLE_EVT_GAP_AUTH_REQ event anyway?

2) Also in the peripheral source code, in the CYBLE_EVT_GAP_DEVICE_CONNECTED the connection parameters are checked, and if they don't match the function CyBle_L2capLeConnectionParamUpdateRequest() is called. When would be this necessary? I guess that's when the central and peripheral are generic devices so they need to work using the same parameters. Is that right? What problems can be cause if I don't check the connection parameters?

Thank you.

Cheers,

Yuri

0 Likes
VenkataD_41
Moderator
Moderator

Hi,

1. I've found in another thread that the function doesn't need to be called because it is already called in the auto generated source files. Why is it being called in the CYBLE_EVT_GAP_AUTH_REQ event anyway?

--> Yes. There is no need to call the AuthReqReply() again. You can remove that. It is just added following best practices.

2. The CyBle_L2capLeConnectionParamUpdateRequest() API call in the CONNECTED event is not required for every project.

    In this particular project it is added for a different purpose (for creating a separate L2CAP channel).

Thanks

Ganesh

0 Likes