Hi I am using the nrf51422_XXAC device. I want to make a connection with my app alone. other apps should not be able to connect. please help me with sample code. I am new to the device
what I need is that only after opening the app I should connect to the device via Bluetooth that too to my app alone, like have a private key or so.
I have tried adding the code static ble_opt_t optS; static uint8_t passw="123456"; optS.gap_opt.passkey.p_passkey=passw; err_code =sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &optS);APP_ERROR_CHECK(err_code);and mode to "BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM" .
the problem is during paring, the device asks for a passkey. but connection inside app goes without a passkey
Not sure where the problem is, but maybe you can find the following example useful, it is from an old SDK, but in principle it should be the same: https://github.com/NordicPlayground/nRF51-ble-app-uart-static-passkey/blob/master/main.c
I have used the BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM for cccd.write. it connects with passkey. but while trying to reconnect the nrf51422 crashes