Skip to content

Commit 9275dbf

Browse files
authored
WiFiGeneric: remove deprecated tcpip_adapter calls (#7577)
replaced old tcp function call with ESP-NETIF API
1 parent 165d624 commit 9275dbf

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Diff for: libraries/WiFi/src/WiFiGeneric.cpp

+8-6
Original file line numberDiff line numberDiff line change
@@ -188,18 +188,20 @@ esp_err_t set_esp_interface_ip(esp_interface_t interface, IPAddress local_ip=IPA
188188
lease.start_ip.addr = _byte_swap32(lease.start_ip.addr);
189189
lease.end_ip.addr = _byte_swap32(lease.end_ip.addr);
190190
log_v("DHCP Server Range: %s to %s", IPAddress(lease.start_ip.addr).toString().c_str(), IPAddress(lease.end_ip.addr).toString().c_str());
191-
err = tcpip_adapter_dhcps_option(
192-
(tcpip_adapter_dhcp_option_mode_t)TCPIP_ADAPTER_OP_SET,
193-
(tcpip_adapter_dhcp_option_id_t)ESP_NETIF_SUBNET_MASK,
191+
err = esp_netif_dhcps_option(
192+
esp_netif,
193+
ESP_NETIF_OP_SET,
194+
ESP_NETIF_SUBNET_MASK,
194195
(void*)&info.netmask.addr, sizeof(info.netmask.addr)
195196
);
196197
if(err){
197198
log_e("DHCPS Set Netmask Failed! 0x%04x", err);
198199
return err;
199200
}
200-
err = tcpip_adapter_dhcps_option(
201-
(tcpip_adapter_dhcp_option_mode_t)TCPIP_ADAPTER_OP_SET,
202-
(tcpip_adapter_dhcp_option_id_t)REQUESTED_IP_ADDRESS,
201+
err = esp_netif_dhcps_option(
202+
esp_netif,
203+
ESP_NETIF_OP_SET,
204+
ESP_NETIF_REQUESTED_IP_ADDRESS,
203205
(void*)&lease, sizeof(dhcps_lease_t)
204206
);
205207
if(err){

0 commit comments

Comments
 (0)