Dear all,
I have a problem with bound process. I use cc2540 and iphone s5.
I setup the GAP bond manager of this way:
{
uint8 pairMode = GAPBOND_PAIRING_MODE_WAIT_FOR_REQ;
uint8 mitm = TRUE;
uint8 ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY;
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 );
}
The first time, the behavior is right, I connect with my iphone and it shows the pass code, I enter it and I can read the atributes of the service (characteristic with athentication to read or write). But the next one, when I try read them, the phone show "reading" and it never can read. To read them, I have to forget the device in settings bluetooth options in the iphone, and now the situation is the same than the first time, if I try to connect it, show the passcode and I can read the characteristis of the service.
I set up the authentication in characteristic value:
{
{ ATT_BT_UUID_SIZE, GeoBageProfileOnOffUUID },
GATT_PERMIT_AUTHEN_READ | GATT_PERMIT_AUTHEN_WRITE,
0,
&GeoBageProfileOnOff
},
I need help to solve this problem, because i don't know what can I do. If I define pair made as GAPBOND_PAIRING_MODE_INITIATE the device always request passcode, and I want to do that once.
Thanks to help me.
Ruben.