Other Parts Discussed in Thread: CC2541
Hello,
I can't figure out the right way to implement "just works" bonding with the CC2541 keyfob and an iPhone.
From the simpleBLEPeripheral app I only made the following changes:
// Setup the GAP Bond Manager
{
uint32 passkey = 0; // passkey "000000"
uint8 pairMode = GAPBOND_PAIRING_MODE_WAIT_FOR_REQ;
uint8 mitm = FALSE;
uint8 ioCap = GAPBOND_IO_CAP_NO_INPUT_NO_OUTPUT;
uint8 bonding = TRUE;
GAPBondMgr_SetParameter( GAPBOND_DEFAULT_PASSCODE, sizeof ( uint32 ), &passkey );
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 );
}
And one of the read characteristic value is setup with GATT_PERMIT_AUTHEN_READ:
// Characteristic Value 2
{
{ ATT_BT_UUID_SIZE, simpleProfilechar2UUID },
GATT_PERMIT_READ | GATT_PERMIT_AUTHEN_READ,
0,
&simpleProfileChar2
},
With this configuration the pairing prompt pops up when trying to read char2 with every new connection, obviously I'd like the bonding to be persistent so user only has to press Pair at the first connection and all subsequent connections are encrypted.
I must be missing something, thanks for your guidance.
Olivier