Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
aca2b772
Commit
aca2b772
authored
May 11, 2015
by
dnc40085
Browse files
Added description to wifi_station_listap
parent
cf54f855
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/modules/wifi.c
View file @
aca2b772
...
@@ -436,6 +436,37 @@ static int wifi_station_setauto( lua_State* L )
...
@@ -436,6 +436,37 @@ static int wifi_station_setauto( lua_State* L )
return
0
;
return
0
;
}
}
/**
* wifi.sta.listap()
* Description:
* scan and get ap list as a lua table into callback function.
* Syntax:
* wifi.sta.getap(function(table))
* wifi.sta.getap(cfg, function(table))
* Parameters:
* cfg: table that contains scan configuration
* function(table): a callback function to receive ap table when scan is done
this function receive a table, the key is the ssid,
value is other info in format: authmode,rssi,bssid,channel
* Returns:
* nil
*
* Example:
--original function left intact to preserve backward compatibility
wifi.sta.getap(function(T) for k,v in pairs(T) do print(k..":"..v) end end)
--if no scan configuration is desired cfg can be set to nil or previous example can be used
wifi.sta.getap(nil, function(T) for k,v in pairs(T) do print(k..":"..v) end end)
--scan configuration
scan_cfg={}
scan_cfg.ssid="myssid" --if set to nil, ssid is not filtered
scan_cfg.bssid="AA:AA:AA:AA:AA:AA" --if set to nil, MAC address is not filtered
scan_cfg.channel=0 --if set to nil, channel will default to 0(scans all channels), if set scan will be faster
scan_cfg.show_hidden=1 --if set to nil, show_hidden will default to 0
wifi.sta.getap(scan_cfg, function(T) for k,v in pairs(T) do print(k..":"..v) end end)
*/
static
int
wifi_station_listap
(
lua_State
*
L
)
static
int
wifi_station_listap
(
lua_State
*
L
)
{
{
if
(
wifi_get_opmode
()
==
SOFTAP_MODE
)
if
(
wifi_get_opmode
()
==
SOFTAP_MODE
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment