Other Parts Discussed in Thread: CC2650
Hello,
I'm trying to modify the "simple_peripheral_cc2650em_app" example to use secure connections using numeric comparison. I want to connect via an iOS and Android device.
Therefore I'm configuring the GAPBondMgr like this.
uint8_t scMode = GAPBOND_SECURE_CONNECTION_ONLY; uint8_t pairMode = GAPBOND_PAIRING_MODE_INITIATE; uint8_t mitm = TRUE; uint8_t ioCap = GAPBOND_IO_CAP_DISPLAY_YES_NO; GAPBondMgr_SetParameter(GAPBOND_IO_CAPABILITIES, sizeof(uint8_t), &ioCap); GAPBondMgr_SetParameter(GAPBOND_PAIRING_MODE, sizeof(uint8_t), &pairMode); GAPBondMgr_SetParameter(GAPBOND_MITM_PROTECTION, sizeof(uint8_t), &mitm); GAPBondMgr_SetParameter(GAPBOND_SECURE_CONNECTION, sizeof(uint8_t), &scMode);
Unfortunately when trying to connect the iOS/Android device still shows a Passcode Entry form, which should not happen when using the combination of Secure Connection, Display+Keyboard (Smartphone) and Display+YES/NO (CC2650). Instead it should be showing the numeric comparison form.
My passcodeCB is always called with numComparison == 0
static void SimplePeripheral_passcodeCb(uint8_t *deviceAddr, uint16_t connHandle, uint8_t uiInputs, uint8_t uiOutputs, uint32_t numComparison) { gapPasskeyNeededEvent_t *pData; // Allocate space for the passcode event. if ((pData = ICall_malloc(sizeof(gapPasskeyNeededEvent_t)))) { memcpy(pData->deviceAddr, deviceAddr, B_ADDR_LEN); pData->connectionHandle = connHandle; pData->numComparison = numComparison; Display_print1(dispHandle, 1, 0, "numcomp: %d", numComparison); // Enqueue the event. SimpleBLEPeripheral_enqueueMsg(SBP_PASSWORD_NEEDED_EVT, uiOutputs, (uint8_t *)pData); } }
Am I missing something?