This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

peer_manager pairing problem

Hi,

Here's I want to do:
Use static passkey to connect with central and peripheral.
I'm useing peer_manager to doing this.
1. I've setup passkey in peripheral with function sd_ble_opt_set
2. on central,ble_evt_handler, when I got event BLE_GAP_EVT_CONNECTED, I use sd_ble_gap_authenticate
to start auth.
3. then I will get event BLE_GAP_EVT_AUTH_KEY_REQUEST in ble_evt_handler
so I use sd_ble_gap_auth_key_reply to reply the static passkey.

I don't know what's next step. after this it seems linked but not use passkey!
because on central I send passkey as "123456",in peripheral I set passkey as "125534"
it's not a matched key, it should be not connect.

I want to know is there any step wrong? or something I have not done?

Here's my setup in peer_manager_init

central:
sec_param.bond = 0
sec_param.mitm = 1
sec_param.lesc = 0
sec_param.keypress = 0
sec_param.io_caps = BLE_GAP_IO_CAPS_KEYBOARD_ONLY
sec_param.oob = 0
sec_param.min_key_size = 7
sec_param.max_key_size = 16

peripheral:
sec_param.bond = 1
sec_param.mitm = 1
sec_param.lesc = 0
sec_param.keypress = 0
sec_param.io_caps = BLE_GAP_IO_CAPS_DISPLAY_ONLY
sec_param.oob = 0
sec_param.min_key_size = 7
sec_param.max_key_size = 16

If there's any peremiter need please tell me.
Thanks.

Related