Day16_Authentication does not work

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

cross mob
Anonymous
Not applicable

Hi,

   

When I run the 100 Projects in 100 days example "#16 Authentication", http://www.cypress.com/blog/100-projects-100-days/project-016-authentication I have problems bonding and reconnecting on my Nexus phone with CySmart app,

   

I don't get screen to enter Passkey and I see "Bonding in progress.. Please wait" after a while the device disconnects with "Authentication process timeout".

   

Below is the terminal output:

   

Bluetooth Stack ON:
Set the I/O capabilities:
Updated the I/O capabilities:DISPLAY_ONLY
Started to advertise
Device Connected

   

CYBLE_EVT_GAP_AUTH_REQ from Master:
Unauthenticated and data signing
Bonding:yes
eKeySize: 0x10
err: 0x0
CYBLE_EVT_GAP_PASSKEY_DISPLAY_REQUEST. Passkey is: 1454889.
Please enter the passkey on peer device.
CYBLE_EVT_GAP_AUTH_FAILED: 15
Device Disconnected

   

As far I understand the Passkey should be 6 digits but I see here as 7 digits(sometimes). Is this correct(attached is the uart log file)?

   

Also how do I use static passkey entry, I did see a post regarding this but could not find much information. Some example workspace would be greatly helpful.

   

Any inputs would be of great help and appreciate the same.

   

Regards

0 Likes
1 Solution
Anonymous
Not applicable

Printf("CYBLE_EVT_GAP_PASSKEY_DISPLAY_REQUEST. Passkey is: %ld.\r\n",*(uint32*)eventParam) should work.

View solution in original post

0 Likes
2 Replies
Anonymous
Not applicable

Below code is used to display the passkey in example project

   

         printf("CYBLE_EVT_GAP_PASSKEY_DISPLAY_REQUEST. Passkey is: %d%d\r\n",
                HI16(*(uint32 *)eventParam),
                LO16(*(uint32 *)eventParam));

   

Using of macros to display high 16-bit and low 16-bit word seems to be incorrect. Better use "                printf("CYBLE_EVT_GAP_PASSKEY_DISPLAY_REQUEST. Passkey is: %ld\r\n", *(uint32 *)eventParam);" instead.

   

This is also discussed in thread http://www.cypress.com/forum/proc-ble/bonding-consistency-issues.

   

Thank you

0 Likes
Anonymous
Not applicable

Printf("CYBLE_EVT_GAP_PASSKEY_DISPLAY_REQUEST. Passkey is: %ld.\r\n",*(uint32*)eventParam) should work.

0 Likes