Exemplo n.º 1
0
        public async Task ForceUpdate(IWifiInterface @interface, CancellationToken token = default)
        {
            var selectedInterface =
                _wlanClient.Interfaces.Single(wlanInterface => GetInterfaceId(wlanInterface) == @interface.Name);

            await selectedInterface.Scan(token);
        }
Exemplo n.º 2
0
        public async Task <string> GetConnected(IWifiInterface @interface, CancellationToken token = default)
        {
            var selectedInterface =
                _wlanClient.Interfaces.Single(wlanInterface => GetInterfaceId(wlanInterface) == @interface.Name);

            await Task.FromResult <object?>(null);

            return(NetworkInfo.BssidToMac(selectedInterface.CurrentConnection.wlanAssociationAttributes.dot11Bssid));
        }
Exemplo n.º 3
0
        public async IAsyncEnumerable <INetworkInfo> ReadNetworks(IWifiInterface @interface,
                                                                  [EnumeratorCancellation] CancellationToken token = default)
        {
            var selectedInterface =
                _wlanClient.Interfaces.Single(wlanInterface => GetInterfaceId(wlanInterface) == @interface.Name);

            await Task.FromResult <object?>(null);

            var networkBssList = selectedInterface.GetNetworkBssList();

            foreach (var entry in networkBssList)
            {
                token.ThrowIfCancellationRequested();
                yield return(new NetworkInfo(entry));
            }
        }