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.

GAP_BOND_COMPLETE_EVENT not firing for SimpleBLECentral Device whose bond completes

Greetings all,

I am writing a central device using SimpleBLECentral as the base code. 

Here are my GAP Bond parameters:

GAPBondMgr_SetParameter( GAPBOND_PAIRING_MODE, sizeof( uint8 ), GAPBOND_PAIRING_MODE_WAIT_FOR_REQ);
GAPBondMgr_SetParameter( GAPBOND_MITM_PROTECTION, sizeof( uint8 ), FALSE);
GAPBondMgr_SetParameter( GAPBOND_IO_CAPABILITIES, sizeof( uint8 ), GAPBOND_IO_CAP_NO_INPUT_NO_OUTPUT);
GAPBondMgr_SetParameter( GAPBOND_BONDING_ENABLED, sizeof( uint8 ), TRUE );

 

The peripheral device initiates the Bonding successfully by sending a "Slave Requested Security" request and the bond completes successfully according to the peripheral device's bond manager. 

However, on the Central device, under centralEventCB() [my registered GAP event callback function], I am attempting to check for case GAP_BOND_COMPLETE_EVENT as defined in "gap.h" ('Sent when the bonding(bound) process is complete. This event is sent as an OSAL message defined as gapBondCompleteEvent_t').  No matter what I do, I cannot get this event to fire - I have breakpoints in the code under this 'case' and they are never called. 

Ultimately I need to terminate the connection after a bond is successfully formed, and I'm not seeing a way of doing this outside of timers.  Has anyone experienced this problem or have any direction?

 

 

Edit: Also need to note that I put a breakpoint in 'gapbondmgr.c' at the "GAP_BOND_COMPLETE_EVENT" case and this breakpoint is never called, either.  Is there something that needs to be done manually to complete the BOND event between a Peripheral and a Central?  I thought the GAPBondMgr would handle this automatically, and give me the GAP_BOND_COMPLETE_EVENT callback after the bond completes!

  • Hi John,

    You will get the GAPBOND_PAIRING_STATE_COMPLETE after pairing the first time, and then GAPBOND_PAIRING_STATE_BONDED event in the application layer in the GAP bond manager callback simpleBLECentralPairStateCB.

     

  • Thanks for the fast response, Zahid!

    I confirmed that the "GAPBOND_PAIRING_STATE_COMPLETE" event is firing in the PairStateCB, however I am not seeing the GAPBOND_PAIRING_STATE_BONDED event fire in PairStateCB, even after bonding is complete and confirmed from the Peripheral side. Do you know why this might be happening?

    Edit:  Nevermind!  After terminating the connection and forcing a re-connect from the Central, I see now that GAPBOND_PAIRING_STATE_COMPLETE fires after pairing, then whenever a Bond is reconnected to the device, GAPBOND_PAIRING_STATE_BONDED fires.


    Thank you for your help!