I am trying to add a static passkey to my peripheral and protect from MITM. I tried the example nRF51-ble-app-uart-static-passkey but it doesn't seem to work correctly.
I am using:
- PCA10001 board
- S110 v7.3.0
- nRF51 SDK 6.1
- nRF Master Control Panel
First, bonding the device still works without a passkey. I have set sec_param.io_caps = BLE_GAP_IO_CAPS_DISPLAY_ONLY
and sec_param.mitm = 1
. Looks like it is still using the Just Works, instead of the passkey authentication? What am I missing? Shouldn't I now have to enter the static passkey I set in my peripheral on the phone when I try to bond?
Second, I don't get any data on the characteristics. Only when I use BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM
I can send and receive data. As long as I use BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM
I don't get anything, neither read nor write. I suppose this is because the bonding is still using the unauthenticated method instead of the authenticated?