/* Event handler for events from the ID Manager module.  */
static void im_evt_handler(im_evt_t const *p_im_evt)
/* Event handler for events from the ID Manager module.  */
static void im_evt_handler(im_evt_t const *p_im_evt)
{
    pm_evt_t pm_evt;
    ret_code_t err_code;
    switch (p_im_evt->evt_id)
    {
        case IM_EVT_DUPLICATE_ID:
            err_code = pm_peer_delete(p_im_evt->params.duplicate_id.peer_id_2);
            UNUSED_VARIABLE(err_code);
            break;
        case IM_EVT_BONDED_PEER_CONNECTED:
            ble_conn_state_user_flag_set(p_im_evt->conn_handle, m_pm.bonding_flag_id, true);
            memset(&pm_evt, 0, sizeof(pm_evt_t));
            pm_evt.conn_handle = p_im_evt->conn_handle;
            pm_evt.peer_id = im_peer_id_get_by_conn_handle(p_im_evt->conn_handle);
            pm_evt.evt_id = PM_EVT_BONDED_PEER_CONNECTED;
            evt_send(&pm_evt);
            break;
    }
}