Other Parts Discussed in Thread: CC2541, BLE-STACK
Hello everybody, I'm try to use cc2541 with passcode and playing with this code
// Setup the GAP Bond Manager
{
uint32 passkey = 0x01020304; // passkey "000000"
uint8 pairMode = GAPBOND_PAIRING_MODE_INITIATE;//GAPBOND_PAIRING_MODE_WAIT_FOR_REQ
uint8 mitm = TRUE;
uint8 ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY;
uint8 bonding = TRUE;
uint8 key_size = 4;
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 );
GAPBondMgr_SetParameter( GAPBOND_KEYSIZE, sizeof( uint8), &key_size );
}
The best result - "TI Device Monitor" (android version) - ask me a code, but other app such as LightBlue (iPhone) and my own app (iPhone) can connect and read/write data without authorization.
Once time I catch a passcode request in LigthBlue and connect using code 01020304 and then using 0 - but after once time passing I can't repeat same request (even restart app and cc2541).
Please help me - what I do wrong?