Hello,
I configured simple_central and simple_peripheral projects to use passcode (BLE5-Stack).
Central device's config:
// Set Bond Manager parameters { uint8_t pairMode = GAPBOND_PAIRING_MODE_INITIATE; uint8_t mitm = TRUE; uint8_t ioCap = GAPBOND_IO_CAP_KEYBOARD_ONLY; uint8_t bonding = TRUE; GAPBondMgr_SetParameter(GAPBOND_PAIRING_MODE, sizeof(uint8_t), &pairMode); GAPBondMgr_SetParameter(GAPBOND_MITM_PROTECTION, sizeof(uint8_t), &mitm); GAPBondMgr_SetParameter(GAPBOND_IO_CAPABILITIES, sizeof(uint8_t), &ioCap); GAPBondMgr_SetParameter(GAPBOND_BONDING_ENABLED, sizeof(uint8_t), &bonding); }
Perihperal device's config:
{ uint8_t pairMode = GAPBOND_PAIRING_MODE_WAIT_FOR_REQ; uint8_t mitm = TRUE; uint8_t ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY; uint8_t bonding = TRUE; GAPBondMgr_SetParameter(GAPBOND_PAIRING_MODE, sizeof(uint8_t), &pairMode); GAPBondMgr_SetParameter(GAPBOND_MITM_PROTECTION, sizeof(uint8_t), &mitm); GAPBondMgr_SetParameter(GAPBOND_IO_CAPABILITIES, sizeof(uint8_t), &ioCap); GAPBondMgr_SetParameter(GAPBOND_BONDING_ENABLED, sizeof(uint8_t), &bonding); }
Both devices have smilar passcode process function:
static void SimpleXXX_processPasscode(scPasscodeData_t *pPasscodeData) { // Display passcode to user if (pPasscodeData->uiOutputs != 0) { Display_printf(dispHandle, SC_ROW_CUR_CONN, 0, "Displaying passcode: %d", B_APP_DEFAULT_PASSCODE); } if (pPasscodeData->uiInputs != 0) { Display_printf(dispHandle, SC_ROW_CUR_CONN, 0, "Entering passcode: %d", B_APP_DEFAULT_PASSCODE); } // Send passcode response GAPBondMgr_PasscodeRsp(pPasscodeData->connHandle, SUCCESS, B_APP_DEFAULT_PASSCODE); }
When it comes to the pairing, the Initiator displays: "Displaying passcode: 123456", and Responder displays "Entering passcode: 123456", however it takes around 18 seconds before both devices receive GAPBOND_PAIRING_STATE_COMPLETE event. Status of the event is success.
What is the reason of having such time delay between entering the passcode and receiving GAPBOND_PAIRING_STATE_COMPLETE event? Can I do something to make it shorter?
Br,
Krzysztof