-->
Page 1 of 1

List APs available

PostPosted: Sun Dec 28, 2014 7:34 pm
by Pigs Fly
Into a table/array along with AP mode (adhoc/AP) and encryption.

Re: List APs available

PostPosted: Sun Dec 28, 2014 9:33 pm
by Pigs Fly
Disregard, I see this has been done, more or less. Would have been nice to have the (v) info presented in an easier to access format, but it will do fine as-is. Thanks.

Code: Select all    -- print ap list
    function listap(t)
      for k,v in pairs(t) do
        print(k.." : "..v)
      end
    end
    wifi.sta.getap(listap)



Results in:

ssid : auth-type, rssi, mac, channel


Re: List APs available

PostPosted: Fri Mar 27, 2015 2:07 pm
by sjfaustino
I know it's digging a bit after all this time, but it might help someone:

Code: Select all -- print ap list
    function listap(t)
      for ssid,v in pairs(t) do
        enc, rssi, bssid, chan = string.match(v, "(%d),(-?%d+),(%x%x:%x%x:%x%x:%x%x:%x%x:%x%x),(%d+)")
        print(ssid,enc,rssi,bssid,chan)
      end
    end
    wifi.sta.getap(listap)