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

peer manager delete peer by custom id

hi I am using peer manager to pair and bond android phone to nrf52840. I want to give custom peer id to this phone during bonding process, then if i lost this phone i will be able to delete bonding information just for this phone by sending a command from another phone, and the command will containt the peer id for the missing phone. I dont know if its possible or not because i couldn't find anything in the SDK14.1 to do that.

So the question is can i delete bond data for just the missing phone ? i mean if several phones are bonded to nrf52840 but i want to delete bond data just for the one i lost!

  • I don't quite understand. Where would this peer ID come from? The phone? Will it be hardcoded in the peripheral application? Could you elaborate a bit?

    You can delete a single bond with pm_peer_delete().

  • Yes, I was thinking about hardcoding a list of peer ID in the peripheral application for example 1 to 5, then i will bond 5 phones to the peripheral. If i lost for example phone that have peer ID 3 in the peripheral , then i will delete bond data from another phone(which is bonded to the peripheral and can write command to the peripheral characteristic ) by teling the peripheral delete bon data for peer id 3. I do not know how to give this hardcoded peer id during the bond process in the peripheral (nrf52840) application!

  • So which phone will get which ID? How would you know that it is the phone with peer ID 3 that is lost?

    I don't think it is possible to give hardcoded peer ID during the bond process without modifying the library. I think however it would be simpler to map the Peer ID used in Peer Manager to the hardcoded Peer IDs, if you get what i mean.

  • I will store all phones with thier peer id some where, then it will be easy to know which one i am going to delete. mapping is a very good option, or i can save the peer ID with the phone UUID in the flash and then i can get peer ID by phone UUID. THis way i will avoid using hardcoded peer ID.

  • Is this answered? Or is there anything that is still unclear?

1 2