Пример #1
0
        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);
        }
Пример #2
0
 public void DomainName(string Name)
 {
     if (!CheckDomainName(Name))
     {
         return;
     }
     CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_DOMAINNAME, AdapterId, Name);
 }
Пример #3
0
 public void HostName(string Name)
 {
     if (!CheckHostName(Name))
     {
         return;
     }
     CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_HOSTNAME, AdapterId, Name);
 }
Пример #4
0
 public void StaticDefaultRouter(string Address)
 {
     if (!CheckIP(Address))
     {
         return;
     }
     CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_STATIC_DEFROUTER, AdapterId, Address);
 }
Пример #5
0
 public void StaticNetMask(string Address)
 {
     if (!CheckIP(Address))
     {
         return;
     }
     CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_STATIC_IPMASK, AdapterId, Address);
 }
Пример #6
0
 public void RemoveDNS_Server(string Address)
 {
     if (!CheckIP(Address))
     {
         return;
     }
     CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.REMOVE_DNS_SERVER, AdapterId, Address);
 }
Пример #7
0
 public void SecureWebPort(string Port)
 {
     if (!CheckCrestronPort(Port))
     {
         return;
     }
     CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_SECURE_WEB_PORT, AdapterId, Port);
 }
Пример #8
0
        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);
        }
Пример #9
0
        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);
            }
        }
Пример #10
0
        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
        }
Пример #11
0
        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
        }
Пример #12
0
 public void SSL_Off()
 {
     CrestronEthernetHelper.SetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_SET.SET_SSL_STATE, AdapterId, "OFF");
 }
Пример #13
0
 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);
 }
Пример #16
0
 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);
 }