Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640
Hy,
as described before I want to realize the follwoing scenario:
During production, a random code is printed on a BLE device. Whoever owns the device and can see the printed code shall be able to connect, everyone else must not connect to the device.
What is the right way of realizing this?
In my code I tried all variants of this:
// Setup the GAP Bond Manager
{
uint8_t pairMode = GAPBOND_PAIRING_MODE_INITIATE;
uint8_t pairWait = 100;
uint8_t mitm = TRUE;
uint8_t ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY;
// uint8_t bonding = TRUE;
// uint8_t scMode = GAPBOND_SECURE_CONNECTION_ONLY;
// uint8_t replaceBonds = FALSE;
uint8_t OOBEnabled = FALSE;
GAPBondMgr_SetParameter(GAPBOND_PAIRING_MODE, sizeof(uint8_t), &pairMode);
GAPBondMgr_SetParameter(GAPBOND_INITIATE_WAIT, sizeof(uint8_t), &pairWait);
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);
// GAPBondMgr_SetParameter(GAPBOND_SECURE_CONNECTION, sizeof(uint8_t), &scMode);
// GAPBondMgr_SetParameter(GAPBOND_LRU_BOND_REPLACEMENT, sizeof(uint8_t), &replaceBonds);
GAPBondMgr_SetParameter(GAPBOND_LOCAL_OOB_SC_ENABLED, sizeof(uint8_t), &OOBEnabled);
Still, whatever combination I try, I am always able to connect for example with the generic android app "nRF connect". Sometimes it shows "can not communicate with device, still I can connect and read and write characteristics.
What is the correct way of realizing this and what do I need to put in my code?
Best regards
Harald