ESP8266 SDK 支持WiFi模块设置静态ip地址

hellosunvi

ESP8266 SDK 支持WiFi模块设置静态ip地址

Postby hellosunvi » Wed Dec 11, 2019 10:36 am

现在想实现一个功能,wifi模块是处在station模式,ip地址通过dhcp从路由器分配,
当终端客户需要手工设置ip地址时,需要停止dhcp,跟踪到源代码tcpip_adapter_lwip.c,
tcpip_adapter_dhcps_stop函数,
esp_err_t tcpip_adapter_dhcps_stop(tcpip_adapter_if_t tcpip_if)
{
/* only support ap now */
if (tcpip_if != TCPIP_ADAPTER_IF_AP || tcpip_if >= TCPIP_ADAPTER_IF_MAX) {
ESP_LOGD(TAG, "dhcp server invalid if=%d", tcpip_if);
return ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS;
}
.......
}
源代码判断如果wifi模块不是ap模式的话,就不支持stop dhcp,不知道,这个是什么原因?
因为很多无线网卡都支持静态ip地址设置,还是我的理解有错误?

Her Mary
Posts: 537
Joined: Mon Oct 27, 2014 11:09 am

Re: ESP8266 SDK 支持WiFi模块设置静态ip地址

Postby Her Mary » Thu Dec 26, 2019 4:56 pm

dhcps 是指 DHCP server 吧,试试 DHCP client 呢

Who is online

Users browsing this forum: No registered users and 180 guests