Hi All,
I'm using a sdk11 and i have started using the glucose profile example to use a peer_Manager.
I have modified it to have a just work behavior. It works correctly but i have same point that is not very clear for me.
static void pm_evt_handler(pm_evt_t const * p_evt)
{
ret_code_t err_code;
switch(p_evt->evt_id)
{
case PM_EVT_BONDED_PEER_CONNECTED:
{
NRF_LOG_PRINTF_DEBUG("Connected to previously bonded device\r\n");
// Start Security Request timer.
err_code = app_timer_start(m_sec_req_timer_id, SECURITY_REQUEST_DELAY, NULL);
APP_ERROR_CHECK(err_code);
err_code = pm_peer_rank_highest(p_evt->peer_id);
if (err_code != NRF_ERROR_BUSY)
{
APP_ERROR_CHECK(err_code);
}
}break;//PM_EVT_BONDED_PEER_CONNECTED
The timer security request allows to perform the bonding. One question why we have wait SECURITY_REQUEST_DELAY before perform the bonding?
This timer it is used also in on_ble_evt when the BLE_CONNECT event occurs. Is it necessary also start the timer in ble connect. I don'y understand what is the functionality of this timer.
-Anna