Beispiel #1
0
        public async Task <IEnumerable <ProfileItem> > GetProfilesAsync(bool isLatest, TimeSpan timeoutDuration)
        {
            if (isLatest)
            {
                await NativeWifi.ScanAsync(timeoutDuration).ConfigureAwait(false);
            }

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

            return(profilePacks.Select(x => new ProfileItem(
                                           name: x.Name,
                                           interfaceGuid: x.InterfaceGuid,
                                           interfaceName: null,
                                           interfaceDescription: x.InterfaceDescription,
                                           authentication: ConvertToAuthentication(x.Authentication),
                                           encryption: ConvertToEncryption(x.Encryption),
                                           position: x.Position,
                                           isAutomatic: x.IsAutomatic,
                                           signal: x.Signal,
                                           isConnected: x.IsConnected)));
        }