/// <summary> /// Constructor /// </summary> public AvailableNetworkGroupPack( InterfaceInfo interfaceInfo, NetworkIdentifier ssid, BssType bssType, int signalQuality, bool isSecurityEnabled, string profileName, AuthenticationAlgorithm authenticationAlgorithm, CipherAlgorithm cipherAlgorithm, IEnumerable <BssNetworkPack> bssNetworks) : base( interfaceInfo: interfaceInfo, ssid: ssid, bssType: bssType, signalQuality: signalQuality, isSecurityEnabled: isSecurityEnabled, profileName: profileName, authenticationAlgorithm: authenticationAlgorithm, cipherAlgorithm: cipherAlgorithm) { this.BssNetworks = Array.AsReadOnly(bssNetworks?.OrderByDescending(x => x.LinkQuality).ToArray() ?? new BssNetworkPack[0]); if (!this.BssNetworks.Any()) { return; } var highestLinkQualityNetwork = this.BssNetworks.First(); LinkQuality = highestLinkQualityNetwork.LinkQuality; Frequency = highestLinkQualityNetwork.Frequency; Band = highestLinkQualityNetwork.Band; Channel = highestLinkQualityNetwork.Channel; }
public static bool TryConvert(DOT11_AUTH_ALGORITHM source, out AuthenticationAlgorithm authenticationAlgorithm) { switch (source) { case DOT11_AUTH_ALGORITHM.DOT11_AUTH_ALGO_80211_OPEN: authenticationAlgorithm = AuthenticationAlgorithm.Open; return(true); case DOT11_AUTH_ALGORITHM.DOT11_AUTH_ALGO_80211_SHARED_KEY: authenticationAlgorithm = AuthenticationAlgorithm.Shared; return(true); case DOT11_AUTH_ALGORITHM.DOT11_AUTH_ALGO_WPA: authenticationAlgorithm = AuthenticationAlgorithm.WPA; return(true); case DOT11_AUTH_ALGORITHM.DOT11_AUTH_ALGO_WPA_PSK: authenticationAlgorithm = AuthenticationAlgorithm.WPA_PSK; return(true); case DOT11_AUTH_ALGORITHM.DOT11_AUTH_ALGO_WPA_NONE: authenticationAlgorithm = AuthenticationAlgorithm.WPA_NONE; return(true); case DOT11_AUTH_ALGORITHM.DOT11_AUTH_ALGO_RSNA: authenticationAlgorithm = AuthenticationAlgorithm.RSNA; return(true); case DOT11_AUTH_ALGORITHM.DOT11_AUTH_ALGO_RSNA_PSK: authenticationAlgorithm = AuthenticationAlgorithm.RSNA_PSK; return(true); case DOT11_AUTH_ALGORITHM.DOT11_AUTH_ALGO_WPA3: authenticationAlgorithm = AuthenticationAlgorithm.WPA3; return(true); case DOT11_AUTH_ALGORITHM.DOT11_AUTH_ALGO_WPA3_SAE: authenticationAlgorithm = AuthenticationAlgorithm.WPA3_SAE; return(true); case DOT11_AUTH_ALGORITHM.DOT11_AUTH_ALGO_OWE: authenticationAlgorithm = AuthenticationAlgorithm.OWE; return(true); case DOT11_AUTH_ALGORITHM.DOT11_AUTH_ALGO_IHV_START: authenticationAlgorithm = AuthenticationAlgorithm.IHV_START; return(true); case DOT11_AUTH_ALGORITHM.DOT11_AUTH_ALGO_IHV_END: authenticationAlgorithm = AuthenticationAlgorithm.IHV_END; return(true); } authenticationAlgorithm = default; return(false); }
/// <summary> /// Constructor /// </summary> public AvailableNetworkPack( InterfaceInfo interfaceInfo, NetworkIdentifier ssid, BssType bssType, int signalQuality, bool isSecurityEnabled, string profileName, AuthenticationAlgorithm authenticationAlgorithm, CipherAlgorithm cipherAlgorithm) { this.Interface = interfaceInfo; this.Ssid = ssid; this.BssType = bssType; this.SignalQuality = signalQuality; this.IsSecurityEnabled = isSecurityEnabled; this.ProfileName = profileName; this.AuthenticationAlgorithm = authenticationAlgorithm; this.CipherAlgorithm = cipherAlgorithm; }