Hi
I wrote a program on CC2540 with pairing and bonding. My devicy work as a slave. Program based on SimpleBLEPeripherial. I wrote functions to GAP Bond Manager Callbacs (passcode and pairstate). They work ok. My device advertise, pair and create bond with my phone with Android. I have connection bonded after write proper key on Android earlier displayed od device LCD.
1. My first issue is that when I reconnect or power reset the connection device doesn't connect automatically again. I think that I doesn't support some functionality. I don't know what I should enable further and what I'm doing wrong?
2. What is the alghorithm to automatically connect device from prevoius saved bond?
3. Is device always work as a slave is capable to automatic reconnect form saved bond?
4. In what function or functionality or callback in code device enter after start the program with saved bond? Where is the point of checking saved bond after start?
Please help.
This is my configuration:
uint32 passkey = 0;
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 );
In passkey function in Bond Manager Callback I change my key with generator the same as in SimpleBLECentral. Program enter the GAPBOND_PAIRINGSTATE_BONDED.
5. My second issue concern problem that I can read my characteristics by BLE other device without bonding only connected. My characteristics are in some kind of public mode. I don't know why there are visible without bonding and don't know how I can get the not visible without pairing and bonding.