public async Task <IEnumerable <ProfileItem> > GetProfilesAsync(bool isLatest, TimeSpan timeout)
        {
            if (isLatest)
            {
                await NativeWifi.ScanNetworksAsync(timeout).ConfigureAwait(false);
            }

            var profilePacks = await Task.Run(() => NativeWifi.EnumerateProfiles()).ConfigureAwait(false);

            return(profilePacks.Select(x => new NativeWifiProfileItem(
                                           name: x.Name,
                                           interfaceId: x.Interface.Id,
                                           interfaceDescription: x.Interface.Description,
                                           profileType: x.ProfileType,
                                           document: x.Document,
                                           position: x.Position,
                                           signal: x.SignalQuality,
                                           isConnected: x.IsConnected)));
        }
示例#2
0
        public async Task <IEnumerable <ProfileItem> > GetProfilesAsync(bool isLatest, TimeSpan timeout)
        {
            if (isLatest)
            {
                await NativeWifi.ScanNetworksAsync(timeout).ConfigureAwait(false);
            }

            var profilePacks = await Task.Run(() => NativeWifi.EnumerateProfiles()).ConfigureAwait(false);

            return(profilePacks.Select(x => new ProfileItem(
                                           name: x.Name,
                                           interfaceId: x.Interface.Id,
                                           interfaceName: null,
                                           interfaceDescription: x.Interface.Description,
                                           authentication: ConvertToAuthentication(x.Authentication),
                                           encryption: ConvertToEncryption(x.Encryption),
                                           position: x.Position,
                                           isAutomatic: x.IsAutomatic,
                                           signal: x.SignalQuality,
                                           isConnected: x.IsConnected)));
        }
 public Task ScanNetworks()
 {
     return(NativeWifi.ScanNetworksAsync(TimeSpan.FromMilliseconds(3000)));
 }
示例#4
0
 /// <summary>
 /// Refreshes available wireless LANs.
 /// </summary>
 public static Task RefreshAsync()
 {
     return(NativeWifi.ScanNetworksAsync(timeout: TimeSpan.FromSeconds(10)));
 }
示例#5
0
 /// <summary>
 /// Refreshes available wireless LANs.
 /// </summary>
 public static async Task RefreshAsync()
 {
     await NativeWifi.ScanNetworksAsync(timeout : TimeSpan.FromSeconds(10));
 }