File tree Expand file tree Collapse file tree 1 file changed +18
-19
lines changed
libraries/lwIpWrapper/src Expand file tree Collapse file tree 1 file changed +18
-19
lines changed Original file line number Diff line number Diff line change @@ -385,6 +385,24 @@ void CNetIf::linkDownCallback() {
385385 * DHCP related functions
386386 * ########################################################################## */
387387
388+ void CNetIf::config (IPAddress _ip, IPAddress _gw, IPAddress _nm) {
389+ #ifdef LWIP_DHCP
390+ dhcpStop ();
391+ dhcpStart ();
392+ #endif
393+
394+ ip_addr_t ip = fromArduinoIP (_ip);
395+ ip_addr_t nm = fromArduinoIP (_gw);
396+ ip_addr_t gw = fromArduinoIP (_nm);
397+
398+ netif_set_addr (&ni, &ip, &nm, &gw);
399+
400+ if (netif_is_link_up (&ni)) {
401+ netif_set_down (&ni);
402+ netif_set_up (&ni);
403+ }
404+ }
405+
388406
389407#ifdef LWIP_DHCP
390408
@@ -961,25 +979,6 @@ err_t CWifiSoftAp::output(struct netif* _ni, struct pbuf* p) {
961979 return errval;
962980}
963981
964- /* -------------------------------------------------------------------------- */
965- void CNetIf::config (IPAddress _ip, IPAddress _gw, IPAddress _nm)
966- {
967- dhcpStop ();
968- dhcpStart ();
969-
970- ip_addr_t ip = fromArduinoIP (_ip);
971- ip_addr_t nm = fromArduinoIP (_gw);
972- ip_addr_t gw = fromArduinoIP (_nm);
973-
974- netif_set_addr (&ni, &ip, &nm, &gw);
975-
976- if (netif_is_link_up (&ni)) {
977- netif_set_down (&ni);
978- netif_set_up (&ni);
979- }
980- }
981-
982-
983982void CWifiSoftAp::task () {
984983 // calling the base class task, in order to make thigs work
985984 CNetIf::task ();
You can’t perform that action at this time.
0 commit comments