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

Getting peer id invalid after pm_conn_secure in central

Hi,

I've one central and one peripheral devices. I'm trying to make a connection between them, perform a bonding process and finally add the peripheral id in the whitelist of the central one and vice versa. I'm using the peer manager with SDK 12.3.0 and softdevice s132 v3.1.0.

I can put the peripheral in advertising mode, perform an scan with the central and make the connection. Then I launch the pm_conn_secure and the process seems to work perfectly, I receive the PM_EVT_CONN_SEC_SUCCEEDED event in the peripheral and I can get the peer_id from the central to put it on the whitelist of the peripheral.

My problem is in the other side. The central also receives the PM_EVT_CONN_SEC_SUCCEEDED event, but the peer_id inside it is always PM_PEER_ID_INVALID. And of course, if I try to put this value in the whitelist I get an exception.

I don't know where the problem is, because the bond process seems to finish successfully, the only problem is that this peer_id is not set to be read on the central side.

Any ideas?

Thank you in advance for your help.

Related