When the phone and controller bonding gets out of sync we are having issues. By out of
sync I mean that either the controller (customer board with a nRF52840) or the phone
no longer has the bond information. For example if a phone and a controller are bonded
and the controller is “Unpaired” in the phone bluetooth settings we have issues reestablishing the connection. In this case we have a crude workout around where we
send a ble command through a SEC_OPEN ble characteristic where the controller on
receipt of the command enters the function below
void delete_bonds(void)
{
ret_code_t err_code;
NRF_LOG_INFO("Erase bonds!");
err_code = pm_peers_delete();
APP_ERROR_CHECK(err_code);
}
When successful the connect between the phone and controller can be re-established
with issue.
However in the case where bonding has been made between the controller and the
phone and the bond broken as described above that phone will not be able to reestablish a connection to the controller. So another phone needs to be used in order to
send the delete_bonds() command.