Hi TI,
It's strange that sometimes my Android phone got a GATT error 15 that is " Insufficient encryption for a given operation", then phone comes out the pin code menu which need user enter passcode again. I dont know if its the android forgetting the paired or the device forgeting paired.
I configure the characteristic as GATT_PERMIT_ENCRYPT_READ|GATT_PERMIT_ENCRYPT_WRITE.
The below is the CC254x src code which configure the pairMode and MITM.
{
uint16 BondTimeOut = 10000;
//uint8 KeyDisc = GAPBOND_KEYDIST_SENCKEY;
uint8 FailAction = GAPBOND_FAIL_NO_ACTION;
uint32 passkey = 0; // passkey "000000"
uint8 pairMode = GAPBOND_PAIRING_MODE_INITIATE;//GAPBOND_PAIRING_MODE_WAIT_FOR_REQ; // GAPBOND_PAIRING_MODE_INITIATE
uint8 mitm = TRUE;
//GAPBOND_IO_CAP_KEYBOARD_ONLY, then the phone display passcode,the server should enter the passcode.
//
uint8 ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY;
uint8 bonding = TRUE;
uint8 autoSync = 0;
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_INITIATE_WAIT, sizeof(uint16), &BondTimeOut);
//GAPBondMgr_SetParameter(GAPBOND_KEY_DIST_LIST, sizeof(uint16), &KeyDisc);
GAPBondMgr_SetParameter(GAPBOND_BOND_FAIL_ACTION, sizeof(uint16), &FailAction);
if(systemStatus.serverControledFlag & CMD_CONTROL_BIT_AUTO_ADD_BONDED_INTO_WHITHE_LIST)
autoSync = 1;
GAPBondMgr_SetParameter( GAPBOND_AUTO_SYNC_WL, sizeof ( uint8 ), &autoSync );
}
Could you help me? I have no idea about it not.
Thanks in advance!