This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LAUNCHXL-CC2640R2: Sample code for bonding in central role

Part Number: LAUNCHXL-CC2640R2

I'm developing a remote control application between two 2640R2 devices where we own both ends. I've built a simple prototype on two LAUNCHXL boards, using the simple_central and simple_peripheral examples, and now have to add bonding. It looks like the glucose sensor app from the additional example pack might be a good starting point for the peripheral, but I dont see any examples for the central side. Is there anything available?

Our intention is to use passkey entry, if that matters.

  • Hi Robert,

    Which SDK and version of BLE are you using? Simple Central is the best example for the central device. I would recommend looking through our SimpleLink Academy and BLE Stack User's Guide (BLE4.2 or BLE5) for more information on central devices and bonding. Both Simple Peripheral and Simple Central already include bonding and the BLE5 versions already include passkey entry.

  • CC2640R2 SDK 2.20.00.49
    Example Pack 1.50.00.62
    CCS 7.4.0.00015
    Academy 2.20.03.05

    Ive been looking through SimpleLink Academy and the BLE UG for a while and its not clear yet how to turn this functionality on. simple_peripheral does not appear to be capable of bonding to BLE Scanner.

    Are the code bases "simple_peripheral" and "SimpleBLEPeripheral" interchangeable? While exploring TI resources I regularly run into links that refer to missing code, references to the git server where code is not present, and so on.
  • Hi Robert,

    Are you using BLE4.2 or BLE5? When you say functionality, are you just talking about adding a passcode? All of this is handled using the GAPBond Manager. The out of box version of simple peripheral is capable of bonding to BLE Scanner. Is it not connecting for you or what is happening when you try to bond it?

    SimpleBLEPeripheral and simple_peripheral refer to the same project so they are interchangeable. Thank you for your feedback. We are constantly working on updating/fixing our online resources. If there are any specific links that are broken, please let us know so we can fix them in future releases.
  • Possibly this is the wrong answer but I intended to use 4.2 and AFAIK I'm using 4.2. If there is some magic semi-undocumented compiler switch to set the stack to BLE5 mode, I'm not aware of it and cant find any reference to such a thing.

    BLE Scanner always connects just fine, but says "Connected / Not Bonded" both to my modified examples and the stock off the shelf version. There's no documentation, Google is no help, is there some esoteric sequence to make this bond? I can pair with the standard BT interface. Both my Android phones are Pixels, so newish models running Android 9, which BLE Scanner is not compatible with. I have some Amazon Fires but they cant access the Play Store. So Im using an older Nexus 9 running Android 7.1.1, could that be an issue?

    While we're at it, since Bluetooth Sig discontinued Developer Studio and disabled downloads is there any way to get this? Or another resource that replaces it? TI docs point to this dead link all over the place.
  • Any suggestions yet? "simple_central" does not appear to be able to initiate bonding with the existing user interface, and the sniffer doesnt show any OTA activity to suggest it's doing anything but a basic connection. I didnt see anything in the Academy about modifying this example to perform bonding.
  • Hi Robert,

    To use BLE5, you would have imported the projected under examples/rtos/CC2640R2_LAUNCHXL/ble5stack so if you didn't import a project from that folder then you are using BLE 4.2.

    Are you setting up any of the GAP Bond MGR parameters in your code (i.e. bonding, pairing mode, secure connection mode, mitm, IO capabilities, passcode)? These are set using calls to GAPBondMgr_SetParameter(). Can you tell me what these parameters are set to in your code? Did you include the code mentioned in GAP Bond Mgr Example with Bonding Enabled  in your application?

    For Developer Studio, most of those links should be fixed in our Q3 Simplelink Academy and SDK release.