To the kind attention of Nordic support team,
I was reading in peer_manager library that when a ble connection is established, using the connection handler as a parameter should be possible to retrieve the index in the peer database
where those connections infos are stored (pm_peer_id_get). I suppose we can manually save that 'last valid connection index'.
After that, when we want to advertise again (and make a decision about the type of advertising) we could call pm_peer_count to see if there are valid peers. In that case we could retrieve that saved 'last valid connection index' and use it as a parameter to call pm_peer_data_bonding_load.
In case latest valid ble connection has got a long term key (LTK) saved, it makes sense to try a directed advertising, I think (could you please confirm?).
What it is not clear to me, if we have to manually save that last valid connection index.
Probably there is a peer_manager routine that is doing that, so that I can retrieve bonding infos of latest used connection by only calling a suitable library routine.
Also in case of directed advertising, we should be sure that it times out, or at least that we can advertise for other host to scan, in case the directed adv. host is missing.
When doing directed advertising yesterday I noticed that over about 20 tries, the internal prototype experienced a couple of resets. I don't know if it is a software issue or an energetic one (could you briefly argument something about that please).
So my question: is there a peer manager library routine so to retrieve latest used bonding infos related to latest connection? Should I save 'manually' that index I was talking about?
Thank you very much for your precious help
Best regards