コード例 #1
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);
        }
コード例 #2
0
 public WirelessSecuritySettings(WirelessAuthentications mode, EnterpriseSecuritySettings enterpriseSettings)
 {
     WirelessAuthentication    = mode;
     WirelessConfigurationType = WirelessTypes.Enterprise;
     EnterpriseSecurity        = enterpriseSettings;
 }