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.

CC2541 bonding

Hello

I want to implement this thing http://e2e.ti.com/support/wireless_connectivity/f/538/t/158892.aspx

"With this update, it may be possible for you to implement functionality in the bond manager for the peripheral to behave in a way similar to a whitelist. Upon connection with a central device, you would need to resolve the peer device's address, and then if it does not match the device that you want to connect to, you would simply terminate the connection."

I need to receive message somehow that passcode was incorrect, in this situation I can terminate link. How I can check correction of passcode?

Configuration of bond manager:

   /* Setup the GAP Bond Manager */
  {
    uint32_t passkey = 240814;
    uint8_t pairMode = GAPBOND_PAIRING_MODE_WAIT_FOR_REQ;
    uint8_t ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY;
    uint8_t bonding = true;
    uint8_t mitm = true;

    GAPBondMgr_SetParameter( GAPBOND_DEFAULT_PASSCODE, sizeof (uint32_t), &passkey );
    GAPBondMgr_SetParameter( GAPBOND_PAIRING_MODE, sizeof(uint8_t), &pairMode );
    GAPBondMgr_SetParameter( GAPBOND_MITM_PROTECTION, sizeof(uint8_t), &mitm );
    GAPBondMgr_SetParameter( GAPBOND_IO_CAPABILITIES, sizeof(uint8_t), &ioCap );
    GAPBondMgr_SetParameter( GAPBOND_BONDING_ENABLED, sizeof(uint8_t), &bonding );
  }

I made a callbacks also passcodeCB and pairStateCB, but it's not helping much.

Thanks

  • Hello! Did you find a solution to this? I'm also looking to achieve a method to terminate link if passcode is incorrect... 

    Regards, TMA

  • No :( I did it on application level

  • I am not sure whether this is what you are talking about.

    But in order to terminate connection on unsuccessful bonding, you can make use of GAPBOND_BOND_FAIL_ACTION.

    By default this is set to 0x02 which implies terminate connection on unsuccessful bonding.

    Also, check GapBondMgr_ProcessGAPMsg function once.  It has one GAP_PASSKEY_NEEDED_EVENT event handler.Might be a starting point to start digging more about bonding.

    Regards,

    Tejas J

  • Thanks guys!

    I'm developing for PERIPHERAL_CFG meaning GAP bond fail option will not do any good... unfortunately.

    I guess I'm stuck with trying to solv the issue on application level as suggested by Dimitri.

    Cheers!

    TMA

  • Hi,
    From your conversation above,I came to know that you have acheived terminating BLE connection if passcode mismatches.
    I want to Initiate Bonding Request from Slave.After receiving passkey from Master,if it mismatches I need to terminate the connection.Please help me to solve this.

    Thanks.
    Regards,
    Anuhya.
  • Hi Anuhya,

    Please see the example in the HidEmuKbd example project in the BLE 1.4.0 SDK for handling the case when the passcode does not match during pairing. In this project, hidDevPasscodeCB() is registered as a callback which gets invoked during pairing when the passcode is required. Eventually, GAPBondMgr_PasscodeRsp() is invoked which can terminate the connection if the passcode does not match.

    Best wishes