private static bool SetNetworkIpInfo(ControlSystemConfig.NetworkProperties config) { bool reboot = false; if (config != null) { //Check to see if IP address needs to be updated if (String.Compare(config.staticIpAddress, CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_STATIC_IPADDRESS, config.adapterId)) != 0) { reboot = CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_STATIC_IPADDRESS, config.adapterId, config.staticIpAddress); } //Check to see if Net mask address needs to be updated if (String.Compare(config.staticNetMask, CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_STATIC_IPMASK, config.adapterId)) != 0) { reboot = CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_STATIC_IPMASK, config.adapterId, config.staticNetMask); } //Check to see if Def router needs to be updated if (String.Compare(config.staticNetMask, CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_STATIC_ROUTER, config.adapterId), true) != 0) { reboot = CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_STATIC_DEFROUTER, config.adapterId, config.staticDefRouter); } } return(reboot); }
public void DomainName(string Name) { if (!CheckDomainName(Name)) { return; } CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_DOMAINNAME, AdapterId, Name); }
public void HostName(string Name) { if (!CheckHostName(Name)) { return; } CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_HOSTNAME, AdapterId, Name); }
public void StaticDefaultRouter(string Address) { if (!CheckIP(Address)) { return; } CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_STATIC_DEFROUTER, AdapterId, Address); }
public void StaticNetMask(string Address) { if (!CheckIP(Address)) { return; } CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_STATIC_IPMASK, AdapterId, Address); }
public void RemoveDNS_Server(string Address) { if (!CheckIP(Address)) { return; } CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.REMOVE_DNS_SERVER, AdapterId, Address); }
public void SecureWebPort(string Port) { if (!CheckCrestronPort(Port)) { return; } CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_SECURE_WEB_PORT, AdapterId, Port); }
private static bool SetNetworkDomainName(ControlSystemConfig.NetworkProperties config) { if (config != null) { if (String.Compare(config.domainName, CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_DOMAIN_NAME, config.adapterId), true) != 0) { return(CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_DOMAINNAME, config.adapterId, config.hostName)); } } return(false); }
private static void OverrideDnsServers(ControlSystemConfig.NetworkProperties config, string[] oldServers) { //Remove current servers foreach (string ds in oldServers) { CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.REMOVE_DNS_SERVER, config.adapterId, ds); } //Add new servers foreach (string ds in config.dnsServers) { CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.ADD_DNS_SERVER, config.adapterId, ds); } }
private static bool SetNetworkWebServer(ControlSystemConfig.NetworkProperties config) { if (config != null & config.webServer != null) { //Webserver is off, but should be set to on if ((bool)config.webServer & CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_WEBSERVER_STATUS, config.adapterId) == "OFF") { return(CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_WEBSERVER_STATE, config.adapterId, "ON")); } //Webserver is on, but should be set to off if (!(bool)config.webServer & CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_WEBSERVER_STATUS, config.adapterId) == "ON") { return(CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_WEBSERVER_STATE, config.adapterId, "OFF")); } } return(false); //We didn't change anything }
private static bool SetNetworkDhcp(ControlSystemConfig.NetworkProperties config) { if (config != null) { //DHCP is currently off, but should be set to on if (config.dhcp & CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_DHCP_STATE, config.adapterId) == "OFF") { return(CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_DHCP_STATE, config.adapterId, "ON")); } //DHCP is currently on, but should be set to off if (!config.dhcp & CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_DHCP_STATE, config.adapterId) == "ON") { return(CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_DHCP_STATE, config.adapterId, "ON")); } } return(false); //We didn't change anything }
public void SSL_Off() { CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_SSL_STATE, AdapterId, "OFF"); }
public void Webserver_Off() { CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_WEBSERVER_STATE, AdapterId, "OFF"); }
public void AddDNS_Server(string Address) { if (!CheckIP(Address)) return; CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.ADD_DNS_SERVER, AdapterId, Address); }
public void CTP_Port(string Port) { if (!CheckCrestronPort(Port)) return; CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_CTP_PORT, AdapterId, Port); }
public void DHCP_On() { CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_DHCP_STATE, AdapterId, "ON"); }
public void StaticIPAddress(string Address) { if (!CheckIP(Address)) return; CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_STATIC_IPADDRESS, AdapterId, Address); }