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

SDK15 nRF52810 need to delete bonded data when try to connect with previos bonded device.

Hi!

SDK15, nRF52810, S110 (peripherial)

I have bonded pair with central device. Now I erase all data in this central device.The periph device has bonded data. I restarted both devices and set central to bonding mode. Now I want in the periph first erase data than bond again.

It is possible to do with next:

    bool bonding = button_is_pressed();
    ...
    if(bonding && pm_peer_count())
    {
        err_code = pm_peers_delete();
        APP_ERROR_CHECK(err_code);
        nrf_delay_ms(500);
        sd_nvic_SystemReset();
    }

All works fine.

Now I want to change logic to next:

If on the periph device pressed button, I ready to bond. But before bond, need to erase bond data.

And at this case we have problem- If periph has stored bonded data before, I get case 

case PM_EVT_BONDED_PEER_CONNECTED:

If there delete bonded data, project fall.

I mean, If I try to bond with any new central device- I get case

case BLE_GAP_EVT_CONNECTED:

where possible delete bonded info.

But in the case to bond with previos bond device, which data was stored, I get directly event  

case PM_EVT_BONDED_PEER_CONNECTED:

where I can't to delete this.

Is it possible to decide it?

Parents
  • Hi!

    Did you make any progress on this?

    SDK15, nRF52810, S110 (peripherial)

    I see you wrote Softdevice s110, but I assume you mean s112?

    However, when you have the bond information stored on your peripheral you get the PM_EVT_BONDED_PEER_CONNECTED event when connecting to the bonded central?

    But when you erase the bond information on your peripheral your "project fall" when trying to connect to the bonded central?
    Could you elaborate what you mean by "project fall"?

    When connecting your peripheral to a new central device, you get the BLE_GAP_EVT_CONNECTED event?

    If the statements above is correct, this seems to be expected behaviour.
    If you want to delete the bond information, you will need to erase the bond information in both the peripheral and the central in order to reconnect.

    You can read more about the PM_EVT_BONDED_PEER_CONNECTED event.
    "A connected peer has been identified as one with which we have a bond. When performing bonding with a peer for the first time, this event will not be sent until a new connection is established with the peer. When we are central, this event is always sent when the Peer Manager receives the BLE_GAP_EVT_CONNECTED event. When we are peripheral, this event might in rare cases arrive later. "

    Best regards,
    Joakim

  • Hi!

    Thanks for answer.

    Yes, s112 means.

    Yes, when I have connect with central on a periph side, I have PM_EVT_BONDED_PEER_CONNECTED case. Even on the central side bonding was deleted. 

    Yes, project is fall. Means, I have error. I don't remember which error exactly. Now it is doesn't matter. This means that when try to erase bonds on the peripherial in the PM_EVT_BONDED_PEER_CONNECTED, project doesn't works. Ofcourse, possible to erase this bond before any connetions. 

    Yes, when connecting your peripheral to a new central device, I get the BLE_GAP_EVT_CONNECTED event. And in this event possible to delete bonds.

    I decided this problems via write to power register flag and reboot. When programs started, read this flag and erase bonds if it need.

Reply
  • Hi!

    Thanks for answer.

    Yes, s112 means.

    Yes, when I have connect with central on a periph side, I have PM_EVT_BONDED_PEER_CONNECTED case. Even on the central side bonding was deleted. 

    Yes, project is fall. Means, I have error. I don't remember which error exactly. Now it is doesn't matter. This means that when try to erase bonds on the peripherial in the PM_EVT_BONDED_PEER_CONNECTED, project doesn't works. Ofcourse, possible to erase this bond before any connetions. 

    Yes, when connecting your peripheral to a new central device, I get the BLE_GAP_EVT_CONNECTED event. And in this event possible to delete bonds.

    I decided this problems via write to power register flag and reboot. When programs started, read this flag and erase bonds if it need.

Children
No Data
Related