/* Function for administrative actions to be taken when a security process has been attempted.  */
static void sec_proc_start(uint16_t conn_handle, pm_peer_id_t peer_id, bool success, bool pairing, bool new_peer_created)
/* Function for administrative actions to be taken when a security process has been attempted.  */
static void sec_proc_start(uint16_t conn_handle, pm_peer_id_t peer_id, bool success, bool pairing, bool new_peer_created)
{
    ble_conn_state_user_flag_set(conn_handle, m_smd.flag_id_sec_proc, success);
    if (success)
    {
        ble_conn_state_user_flag_set(conn_handle, m_smd.flag_id_sec_proc_pairing, pairing);
        ble_conn_state_user_flag_set(conn_handle, m_smd.flag_id_sec_proc_new_peer, new_peer_created);
        if(new_peer_created)
        {
            im_new_peer_id(conn_handle, peer_id);
        }
    }
    else
    {
        if(new_peer_created)
        {
            ret_code_t err_code = im_peer_free(peer_id);
            UNUSED_VARIABLE(err_code);
        }
    }
}