title: How do i reset the system cache of WLAN info?
body: <p>I am trying to write a WLAN fingerprinting program using NativeWifi in C#. To do this i run a loop to get the wlan information many times and then later use matlab to average / analyze the data.</p>
  
  <p>The problem is that i get all the same values, even as i move about the house, when the program is running. From the internet i've seen that there is a cache that stores the data of available networks. I was wondering if there is a system call which resets this cache.</p>
  
  <p>I have also seen this using the cmd call</p>
  
  <blockquote>
    <p>netsh wlan show networks mode=bssid</p>
  </blockquote>
  
  <p>this gives me the same values until i open the available wifi networks in my OS and if i run it again after, it will give different values.</p>
  
  <p>edit: This system will be for my use only, so i would be comfortable starting over on a linux platform if there is a known library that can handle this for me. I don't even know what to google to even get the information, though. Anything related to "network cache" takes me to help threads of unrelated topics...</p>
  
  <p>I will provide the relevant part of my code below:</p>
  
  <pre><code>        public void get_info_instance(StreamWriter file)
          {
                  try
                  {
                      foreach (WlanClient.WlanInterface wlanIface in client.Interfaces)
                      {
  
                          Wlan.WlanBssEntry[] wlanBssEntries = wlanIface.GetNetworkBssList();
  
                          foreach (Wlan.WlanBssEntry network in wlanBssEntries)
                          {
                              int rss = network.rssi;
                              byte[] macAddr = network.dot11Bssid;
                              string tMac = "";
                              for (int i = 0; i &lt; macAddr.Length; i++)
                              {
                                  tMac += macAddr[i].ToString("x2").PadLeft(2, '0').ToUpper();
                              }
  
  
                              file.WriteLine("Found network: " + System.Text.ASCIIEncoding.ASCII.GetString(network.dot11Ssid.SSID).ToString());
                              file.WriteLine("Signal: " + network.linkQuality + "%");
                              file.WriteLine("BSS Type: " + network.dot11BssType + ".");
                              file.WriteLine("RSSID: " + rss.ToString());
                              file.WriteLine("BSSID: " + tMac);
                              file.WriteLine(" ");
                          }
                      }
                  }
  
                  catch (Exception ex)
                  {
                      MessageBox.Show(ex.Message);
                  } 
          }
  </code></pre>