Commit 3b80bc44 authored by Vowstar's avatar Vowstar
Browse files

Merge pull request #209 from nodemcu/dev

wifi.ap.setip() can set ip address now, fixed #199.
parents bc6d975f 059a5eeb
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment