private void InitializeSimulator(SafeComAuthenticationMode authMode, NetworkCredential userCredential, string deviceIP, string deviceMacAddress, string safecomServer) { _safeComSimulator = null; VerifyLogFolder(); _safeComSimulator = new Simulation(LogPath + "\\" + userCredential.UserName + "_.log"); bool result = _safeComSimulator.SetupSession(GetAuthenticationMethod(authMode), userCredential.UserName, userCredential.Password, userCredential.Domain, deviceMacAddress, safecomServer, 7500, deviceIP, false, true); if (!result) { throw new SafeComSessionException("Failed to initialize the SafeCom simulation engine."); } }
private int GetAuthenticationMethod(SafeComAuthenticationMode pluginAuthMode) { switch (pluginAuthMode) { case SafeComAuthenticationMode.NameAndPin: return(Simulation.SC_LOGIN_NAME_AND_PIN); case SafeComAuthenticationMode.CardAndPin: return(Simulation.SC_LOGIN_CARD_AND_PIN); case SafeComAuthenticationMode.WindowsCredentials: return(Simulation.SC_LOGIN_WINDOWS); default: return(Simulation.SC_LOGIN_NAME_AND_PWD); } }
public SafeComSimulationController(NetworkCredential credential, SafeComAuthenticationMode authMode, string deviceIP, string deviceMacAddress, string safecomServer) { InitializeSimulator(authMode, credential, deviceIP, deviceMacAddress, safecomServer); }