Hi, there
I want to remove the bond in current time service example, because the bond process make me less convenient when I debug. so I changed the code in peer_manager_init
sec_param.bond = 0;
sec_param.mitm = SEC_PARAM_MITM;
sec_param.lesc = SEC_PARAM_LESC;
sec_param.keypress = SEC_PARAM_KEYPRESS;
sec_param.io_caps = SEC_PARAM_IO_CAPABILITIES;
sec_param.oob = SEC_PARAM_OOB;
sec_param.min_key_size = SEC_PARAM_MIN_KEY_SIZE;
sec_param.max_key_size = SEC_PARAM_MAX_KEY_SIZE;
sec_param.kdist_own.enc = 0;
sec_param.kdist_own.id = 0;
sec_param.kdist_peer.enc = 0;
sec_param.kdist_peer.id = 0;
and comment the peer_manager part in advertising_start
static void advertising_start(bool erase_bonds)
{
if (erase_bonds == true)
{
delete_bonds();
// Advertising is started by PM_EVT_PEERS_DELETE_SUCCEEDED event.
}
else
{
ret_code_t ret;
// memset(m_whitelist_peers, PM_PEER_ID_INVALID, sizeof(m_whitelist_peers));
// m_whitelist_peer_cnt = (sizeof(m_whitelist_peers) / sizeof(pm_peer_id_t));
// peer_list_get(m_whitelist_peers, &m_whitelist_peer_cnt);
// ret = pm_whitelist_set(m_whitelist_peers, m_whitelist_peer_cnt);
// APP_ERROR_CHECK(ret);
// // Setup the device identies list.
// // Some SoftDevices do not support this feature.
// ret = pm_device_identities_list_set(m_whitelist_peers, m_whitelist_peer_cnt);
// if (ret != NRF_ERROR_NOT_SUPPORTED)
// {
// APP_ERROR_CHECK(ret);
// }
ret = ble_advertising_start(&m_advertising, BLE_ADV_EVT_SLOW);
APP_ERROR_CHECK(ret);
}
}
it can advertise, connect and discover service in nRF connect on my phone, but my phone attempt to pairing and bonding , but failed and then the MCU stopped. so how to stop the phone's attempts to pairing and make the cts service work ?
how to remove the bonding procedure completely?