You are here

Project #015 - Bonding | Cypress Semiconductor

Project #015 - Bonding

In project #14, we looked at the Whitelist feature of the Link Layer, which enables the device to accept requests from a selected list of devices. Today we'll look at the feature of Security Manager Layer to secure and encrypt the link and then store the keys to establish the bonding betweent the two BLE enabled devices.

In this project, the CY8CKIT-042-BLE Bluetooth Low Energy Pioneer Kit acts as the GAP Peripheral and the GATT Client. For devices to get bonded, it performs the following operations:

  • Authenticates the devices
  • Encrypts the link
  • Exchange the keys
  • Stores the keys and authentication information

Once the devices are bonded, they do not have to go through the above process again upon reconnection.

You can download this PSoC Creator project here from GitHub: https://github.com/cypresssemiconductorco/PSoC-4-BLE/tree/master/100_Projects_in_100_Days/Day015_Bonding

 

Comments

e.pratt_1639216's picture

This example was very helpful for figuring out the bonding process; However, there is an issue with the pass code displayed through the UART.

The code originally has the following:

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

 The number it displays  will vary from 5-7 "decimal" digits however, and upon attempting to use the passkey to pair with the HID_Dongle it will fail most of the time. It seems that the eventParam argument is being split into two separate decimal values from a single 6-digit decimal number. I'm not sure why this is in the example code, but if you remove the upper/lower byte splitting and just display the eventParam as the argument to the printf() format statement, then it gives a 6-digit passcode that works on every try.

Here is the modified code that I had to use to get it to tell me the correct passkey value:

case CYBLE_EVT_GAP_PASSKEY_DISPLAY_REQUEST:
            printf("\r\n");
            printf("CYBLE_EVT_GAP_PASSKEY_DISPLAY_REQUEST. Passkey is: %lu.\r\n",
                *(uint32 *)eventParam);

jordanss123 jordanss123's picture

It's so great when you are sharing this awesome post there fake yeezy boost 750

 

sachinkhanna786_2753541's picture

ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.