Hello community,
I've got the following situation here:
An IPhone (central) App and a CC2540 in the peripheral role.
The Bond Mgr is setup like that:
// Setup the GAP Bond Manager { uint8 pairMode = GAPBOND_PAIRING_MODE_INITIATE; uint8 mitm = TRUE; uint8 ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY; uint8 bonding = TRUE; uint8 bondFailAction = GAPBOND_FAIL_TERMINATE_ERASE_BONDS; GAPBondMgr_SetParameter( GAPBOND_PAIRING_MODE, sizeof ( uint8 ), &pairMode ); GAPBondMgr_SetParameter( GAPBOND_MITM_PROTECTION, sizeof ( uint8 ), &mitm ); GAPBondMgr_SetParameter( GAPBOND_IO_CAPABILITIES, sizeof ( uint8 ), &ioCap ); GAPBondMgr_SetParameter( GAPBOND_BONDING_ENABLED, sizeof ( uint8 ), &bonding ); GAPBondMgr_SetParameter( GAPBOND_BOND_FAIL_ACTION, sizeof ( uint8 ), &bondFailAction ); }
Now when i run my application on the CC2540 and connect to it with the IPhone I get asked for the passcode and after entering it pairing is finished successfull. When I now disconnect on the IPhone and reconnect again I first get GAPBOND_PAIRING_STATE_BONDED message in my pairStateCB function (everything fine until here) but right after that pairStateCB gets called again and I get a SMP_PAIRING_FAILED_UNSPECIFIED message. I can't see why this is happening.
What i want to do in the CB is, if in the pairing process a wrong passcode is entered, the connection should be terminated, but this behaviour interferes with my plans. I have already done a workaround for this problem but I don't like it that much and was wondering if there is another solution to my problem. Maybe the App on the IPhone is faulty (it wasn't developt by me) and sends some wrong commands or something like that?
Best regards
Karl