You are here

Paring/Bonding problem with CySmart App on Android | Cypress Semiconductor

Paring/Bonding problem with CySmart App on Android

Summary: 5 Replies, Latest post by chaplin.u_1533771 on 14 Apr 2016 01:52 AM PDT
Verified Answers: 1
Last post
Log in to post new comments.
giorgio.marinangeli_1521296's picture
2 posts

I want connect my BLE peripheral device with an Android app using pairing/bonding features.

As start point I used Day_015_Bonding example from Cypress 100_Projects_in_100_Days examples.

As Android App I used CySmart App running on my Asus NEXUS Tablet with Android 5.1 installed.
The connection is never done.

My tablet rejects the connection and It doesn't show me any PassKey Form to enable the connection and complete the pairing/bondin procedure.

I tried to use a different Android APP like nRF Master Control Panel and the connection doesn't work with this app too.

In the serial log console, connected with my CYBLE 0220001 device, no passkey is showed.
The paring/bonding procedure doesn't work.

This is the serial console output:

BLE_Bonding Device ON
Starting to advertise
Advertisement is enabled
Device  Connected
Starting Discovery
Discovery complete.
Device Disconnected
Restarting Advertisement..
Advertisement is enabled

If I use CySmart Software V.1.1 running on my Windows 7 PC with cypress BLE dongle,
I can discover my BLE peripheral,
When i press connect button, CySmart software requires the PassKey.
My BLE peripheral generates the PassKey ( I can read Its on serial console ).
And the pairing/bonding connection works well.

Please help me, 
I need to connect my peripheral with an android app in secure mode using a paring PassKey.



operationred1991_1569406's picture
51 posts

Change the settings to Unauthenticated pairing with encryption

giorgio.marinangeli_1521296's picture
2 posts

Unauthenticated pairing with encryption doesn't work for me.

After long work, I found the way to connect my Tablet to my BLE periferal device with paring but now the 
the tablet shows the passKey for paring and the BLE sends the required passKey to Tablet with CyBle_GapAuthPassKeyReply API.

I changed the GAP Security I/O capabilities to  Keyboard and Display.

In the attachment file ZIP you can find a modified version of Day_015_Bonding example where I changed the code and the BLE configuration to reach this goal.

With this version I am able to pairing my BLE device in this way:
From Settings-> Bluetooth tablet menu I can choose my BLE device and when I select the device, the tablet shows the passKey .
Now enter the passKey in to the serial console and the pairing/bonding process will go on.

The  StackEvent on my BLE device receive this event series:

Advertisement is enabled
CYBLE_EVT_GAP_AUTH_REQ: security=0x2, bonding=0x1, ekeySize=0x10, err=0x0



This operation Mode is not what I want.

I want show the passKey on my BLE peripheral device and enter the passKey in my tablet.

How can I reach this goal?

I think the first step is to set the GAP Security I/O capabilities to Display, but what else?


cjoachim_1597296's picture
73 posts

Hi Giorgio! I have also looked through the bonding example project in the 100 project/day and been wondering if the code for handling the CYBLE_EVT_GAP_AUTH_REQ event is wrong. The API documentation says that CyBle_GappAuthReqReply should be called, but that example does not call it. (I have not tried to run the example on a device).


I see your code calls CyBle_GappAuthReqReply. You use the global variable cyBle_authInfo as argument. Could this variable's member authErr :: CYBLE_GAP_AUTH_FAILED_REASON_T be different from CYBLE_GAP_AUTH_ERROR_NONE ? Maybe CyBle_GappAuthReqReply should be called by a local variable created just for the call, or the one from casting the void* given to the event handler function. I don't know. It would be nice to clarify this :)

cjoachim_1597296's picture
73 posts

Recently, I was surprized that the Cypress generated function CyBle_EventHandler() is the actual event handler, and this just calls our custom handler, set by CyBle_Start( &my_handler ), at end. And I see in the source code that the CyBle_EventHandler calls CyBle_GappAuthReqReply(), I thought our custom event handler overrided the Cypress one. I have not seen any documentation that CyBle_EventHandler is always called, and I've been developing on PSoC4BLE for months. I have to contact support about that!

chaplin.u_1533771's picture
77 posts

Any news about issue ?

Log in to post new comments.