-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathlist_ap.lua
39 lines (34 loc) · 1.23 KB
/
list_ap.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
------------------------------------------
--- Author: Pradeep Singh
--- Date: 2nd April 2016
--- Version: 1.0
--- NodeMCU Firmware: nodemcu_float_0.9.6-dev_20150704.bin
--- Description: This is sample code to list all available WiFi Networks
------------------------------------------
-----------------------------------------------
--- Set Variables ---
-----------------------------------------------
--- AP Search Params ---
ap_list_cfg={}
--- Enter SSID, use nil to list all SSIDs ---
ap_list_cfg.ssid=nil
--- Enter BSSID, use nil to list all SSIDs ---
ap_list_cfg.bssid=nil
--- Enter Channel ID, use 0 to list all channels ---
ap_list_cfg.channel=0
--- Use 0 to skip hidden networks, use 1 to list them ---
ap_list_cfg.show_hidden=1
--- AP Table Format ---
--- 1 for Output table format - (BSSID : SSID, RSSI, AUTHMODE, CHANNEL)
--- 0 for Output table format - (SSID : AUTHMODE, RSSI, BSSID, CHANNEL)
ap_list_table_format = 1
-----------------------------------------------
--- Print Output ---
function print_AP_List(ap_table)
for p,q in pairs(ap_table) do
print(p.." : "..q)
end
end
--- Call Get AP Method ---
wifi.sta.getap(ap_list_cfg,ap_list_table_format, print_AP_List)
-----------------------------------------------