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

maximum centrals in ancs

Hi I am trying to overcome the problem that I have confronted, I have no buttons to delete bonds. So instead of deleteing this is what I did.

I modified the bondmanager code as follows

static uint32_t on_auth_status_from_new_central(ble_gap_evt_auth_status_t * p_auth_status) { uint32_t err_code;

if (m_centrals_in_db_count >= BLE_BONDMNGR_MAX_BONDED_CENTRALS)
{
                     m_centrals_in_db_count = 0x00;
		 //return NRF_ERROR_NO_MEM;
}

...................... Instead of a return I reset the count to zero. I don't see any problem as of now. Is this work around problematic?

Parents
  • In general we recommend avoiding changing the SDK files, so I'd rather use the error returned to the application to call the masters_delete() function from there.

    The change you've done here is a little scary, since there will be a disagreement between the in-RAM state and the flash-state of the bond manager, and if you get a power reset or similar after this, you may see strange behavior.

    Also, in an actual application it may create undesired behavior to just delete all bonds if you bond with a new device, but this will be very dependent on how your application is to behave, so I can't say anything for sure about that.

Reply
  • In general we recommend avoiding changing the SDK files, so I'd rather use the error returned to the application to call the masters_delete() function from there.

    The change you've done here is a little scary, since there will be a disagreement between the in-RAM state and the flash-state of the bond manager, and if you get a power reset or similar after this, you may see strange behavior.

    Also, in an actual application it may create undesired behavior to just delete all bonds if you bond with a new device, but this will be very dependent on how your application is to behave, so I can't say anything for sure about that.

Children
No Data
Related