mirror of
https://github.com/nodemcu/nodemcu-firmware.git
synced 2025-01-16 20:52:57 +08:00
Merge pull request #209 from nodemcu/dev
wifi.ap.setip() can set ip address now, fixed #199.
This commit is contained in:
commit
3b80bc443d
@ -256,8 +256,19 @@ static int wifi_setip( lua_State* L, uint8_t mode )
|
||||
ip = parse_key(L, "gateway");
|
||||
if(ip!=0)
|
||||
pTempIp.gw.addr = ip;
|
||||
wifi_station_dhcpc_stop();
|
||||
lua_pushboolean(L,wifi_set_ip_info(mode, &pTempIp));
|
||||
|
||||
if(STATION_IF == mode)
|
||||
{
|
||||
wifi_station_dhcpc_stop();
|
||||
lua_pushboolean(L,wifi_set_ip_info(mode, &pTempIp));
|
||||
}
|
||||
else
|
||||
{
|
||||
wifi_softap_dhcps_stop();
|
||||
lua_pushboolean(L,wifi_set_ip_info(mode, &pTempIp));
|
||||
wifi_softap_dhcps_start();
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user