title: Using nl80211.h to scan access points
body: <p>I'm trying to use nl80211.h for scanning access points for a simple WLAN manager. I can't find any example code and only documentation I can find is <a href="http://wireless.kernel.org/en/developers/Documentation/nl80211/kerneldoc" rel="noreferrer">kerneldoc</a>. I have been trying to study from iw and wpa_supplicant source but it's rather complex.</p>
  
  <p>This is only documentation I can find:</p>
  
  <blockquote>
    <p>NL80211_CMD_GET_SCAN get scan results</p>
    
    <p>NL80211_CMD_TRIGGER_SCAN trigger a new scan with the given parameters
    NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
    probe requests at CCK rate or not.</p>
  </blockquote>
  
  <p>How can I scan access points with nl80211? I think I need to use <code>enum nl80211_commands {NL80211_CMD_GET_SCAN NL80211_CMD_TRIGGER_SCAN}</code>. How can I use them?</p>