Exemplo n.º 1
0
        public bool ConfigureWirelessStation(string ssid, WirelessModes wirelessMode, WirelessStaModes mode, WirelessBands band, WirelessAuthentications auth, string passphrase, int keyIndex)
        {
            NavigateToWireless();

            // Wireless mode
            _controlPanel.PressWait(GetControlId("WIRELESS STATION", "li"), "#hpid-settings-app-menu-panel .hp-listitem-text:contains(WIRELESS MODE)");


            List <string> controls = _controlPanel.GetIds("li", OmniIdCollectionType.Self).ToList();

            // Wireless Mode
            _controlPanel.PressWait(GetControlId("WIRELESS MODE", controls: controls), "#0");
            _controlPanel.Press($"#{(int)wirelessMode}");
            _controlPanel.PressWait("#hpid-ok-setting-button", GetControlId("MODE", controls: controls));

            // Mode
            _controlPanel.PressWait(GetControlId("MODE", controls: controls), "#0");
            _controlPanel.Press($"#{(int)mode}");
            _controlPanel.PressWait("#hpid-ok-setting-button", GetControlId("SSID", controls: controls));

            // Enter ssid
            _controlPanel.PressWait(GetControlId("SSID", controls: controls), "#hpid-dynamic-setting-panel .hp-dynamic-text-box:contains()");

            _controlPanel.PressWait($"#hpid-dynamic-setting-panel .hp-dynamic-text-box", "#hpid-keyboard");
            _controlPanel.TypeOnVirtualKeyboard(ssid);
            _controlPanel.PressWait("#hpid-keyboard-key-done", "#hpid-ok-setting-button");
            _controlPanel.PressWait("#hpid-ok-setting-button", GetControlId("AUTHENTICATION", controls: controls));

            // Authentication
            _controlPanel.PressWait(GetControlId("AUTHENTICATION", controls: controls), "#0");
            _controlPanel.Press($"#{(int)auth}");
            _controlPanel.PressWait("#hpid-ok-setting-button", GetControlId("AUTHENTICATION", controls: controls));

            NavigateHome();
            return(true);
        }
Exemplo n.º 2
0
 public bool ConfigureWirelessStation(string ssid, WirelessModes wirelessMode, WirelessStaModes mode, WirelessBands band, WirelessAuthentications auth, string passphrase, int keyIndex)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 3
0
        private bool ConfigureEnterpriseWireless(WirelessSettings wirelessSettings, WirelessAuthentications authMode, EnterpriseSecuritySettings securitySettings, ProductType productType = ProductType.None)
        {
            if (authMode == WirelessAuthentications.Wep && productType != ProductType.MultipleInterface)
            {
                TraceFactory.Logger.Info("Enterprise WEP is supported only for VEP-MI");
                return(false);
            }

            if (_adapter.Settings.ProductType == PrinterFamilies.VEP && wirelessSettings.WirelessMode == WirelessModes.Bgn)
            {
                TraceFactory.Logger.Info("WEP security doesnot not suppor on BGN mode on VEP.");
                return(false);
            }

            string securityMode = (authMode == WirelessAuthentications.Wpa) ? "WPA" : "WEP";

            CoreUtility.Retry.UntilTrue(() => _adapter.IsElementPresent("WirelessSecurity_{0}".FormatWith(securityMode)), 20, TimeSpan.FromSeconds(5));
            _adapter.Check("WirelessSecurity_{0}".FormatWith(securityMode));
            _adapter.Check("WirelessSecurity_{0}Enterprise".FormatWith(securityMode));

            _adapter.Uncheck("Wireless_{0}EAPTLS".FormatWith(securityMode));
            _adapter.Uncheck("Wireless_{0}EAPTLS".FormatWith(securityMode));
            _adapter.Uncheck("Wireless_{0}LEAP".FormatWith(securityMode));

            if (securitySettings.EnterpriseConfiguration.AuthenticationProtocol.HasFlag(AuthenticationMode.EAPTLS))
            {
                _adapter.Check("Wireless_{0}EAPTLS".FormatWith(securityMode));
            }

            if (securitySettings.EnterpriseConfiguration.AuthenticationProtocol.HasFlag(AuthenticationMode.PEAP))
            {
                _adapter.Check("Wireless_{0}PEAP".FormatWith(securityMode));
            }

            if (securitySettings.EnterpriseConfiguration.AuthenticationProtocol.HasFlag(AuthenticationMode.LEAP))
            {
                _adapter.Check("Wireless_{0}LEAP".FormatWith(securityMode));
            }

            _adapter.SetText("Wireless_{0}Username".FormatWith(securityMode), securitySettings.EnterpriseConfiguration.UserName);
            _adapter.SetText("Wireless_{0}Password".FormatWith(securityMode), securitySettings.EnterpriseConfiguration.Password);
            _adapter.SetText("Wireless_{0}ConfirmPassword".FormatWith(securityMode), securitySettings.EnterpriseConfiguration.Password);

            if (_adapter.IsElementPresent("Wireless_{0}ReAuthenticate"))
            {
                if (securitySettings.EnterpriseConfiguration.ReAuthenticate)
                {
                    _adapter.Check("Wireless_{0}ReAuthenticate".FormatWith(securityMode));
                }
                else
                {
                    _adapter.Uncheck("Wireless_{0}ReAuthenticate".FormatWith(securityMode));
                }
            }

            if (_adapter.Settings.ProductType == PrinterFamilies.TPS || _adapter.Settings.ProductType == PrinterFamilies.InkJet)
            {
                _adapter.SelectByValue("Wireless_WPAEncryptionStrength", CtcUtility.GetEnumvalue(Enum <EncryptionStrengths> .Value(securitySettings.EnterpriseConfiguration.EncryptionStrength), _adapter.Settings.ProductType));
            }

            try
            {
                _adapter.Click("Wireless_Apply");
            }
            finally
            { }

            return(true);
        }
Exemplo n.º 4
0
 public bool ConfigureWirelessStation(string ssid, WirelessModes wirelessMode, WirelessStaModes mode, WirelessBands band, WirelessAuthentications auth, string passphrase, int keyIndex)
 {
     NavigateToWireless();
     return(false);
 }
Exemplo n.º 5
0
 public WirelessSecuritySettings(WirelessAuthentications mode, EnterpriseSecuritySettings enterpriseSettings)
 {
     WirelessAuthentication    = mode;
     WirelessConfigurationType = WirelessTypes.Enterprise;
     EnterpriseSecurity        = enterpriseSettings;
 }