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");
|
ip = parse_key(L, "gateway");
|
||||||
if(ip!=0)
|
if(ip!=0)
|
||||||
pTempIp.gw.addr = ip;
|
pTempIp.gw.addr = ip;
|
||||||
|
|
||||||
|
if(STATION_IF == mode)
|
||||||
|
{
|
||||||
wifi_station_dhcpc_stop();
|
wifi_station_dhcpc_stop();
|
||||||
lua_pushboolean(L,wifi_set_ip_info(mode, &pTempIp));
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue