Re: [lwip-users] DHCP callback was removed - Correct way to obtain new address?

2014-09-03 Thread Sergio R. Caprile
According to the wiki, the correct way to initialize a DHCP interface is
to call dhcp_start() and not netif_set_up(). So, summarizing:
you can poll for netif.dhcp-state == DHCP_BOUND
you can define LWIP_NETIF_STATUS_CALLBACK,  and call
void netif_set_status_callback(struct netif *netif,
netif_status_callback_fn status_callback);
your 'status_callback' function will be called when the interface comes
up after the DHCP state machine reached the DHCP_BOUND state and
netif_set_up() has been called by the dhcp code.


___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users


Re: [lwip-users] DHCP callback was removed - Correct way to obtain new address?

2014-08-29 Thread Paul Webber
Chris,
I am using the TCP RAW. After starting DHCP I wait for the IP by using: 
While(main_netif.dchp-state != DHCP_BOUND). After the state changes to 
DHCP_BOUND the ip is in the pcb (main_netif.ip_addr). You can periodically 
check to see if the ip changes. I also include in the while statement a timer 
in case there is a DHCP problem.
Paul

From: lwip-users-bounces+pwebber=heat-timer@nongnu.org 
[mailto:lwip-users-bounces+pwebber=heat-timer@nongnu.org] On Behalf Of 
Chris Maier
Sent: Friday, August 29, 2014 10:33 AM
To: lwip-users@nongnu.org
Subject: [lwip-users] DHCP callback was removed - Correct way to obtain new 
address?

Hi all,

I am just porting my application from version 1.3.2 to the latest 1.4.2. and I 
was wondering why my application does not get called back from the stack when 
the DHCP

As I found out the callback was removed. My application has to know the address 
for displaying purposes, so do I have to poll for a new address?

What is the proper way to obtain a new address?

Regards

Chris


DÜRR DENTAL AG
Höpfigheimer Strasse 17
74321 Bietigheim-Bissingen Deutschland / Germany
Tel. + 49 (0) 7142 / 705-0
Fax + 49 (0) 7142 / 705-500
http://www.duerrdental.com
Join us on Facebook 
www.facebook.com/DuerrDentalAGhttp://www.facebook.com/DuerrDentalAG

Firmensitz / Registered Office: Höpfigheimer Str. 17, 74321 
Bietigheim-Bissingen Handelsregister / Register of Commerce: Amtsgericht 
Stuttgart HRB 727006

Vorstand / Executive Board: Martin Dürrstein (Vorsitzender / CEO), Axel Schramm 
Vorsitzender des Aufsichtsrates / Chairman of the Supervisory Board: Joachim Loh
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] DHCP callback was removed - Correct way to obtain new address?

2014-08-29 Thread Sergio R. Caprile
When I did it, I basically polled for
netif.dhcp-state == DHCP_BOUND
and read
ipaddr = netif.ip_addr;
netmask = netif.netmask;
gw = netif.gw;

but now I realize the dhcp code calls netif_set_up() when it reaches
that state, which also calls NETIF_STATUS_CALLBACK if
LWIP_NETIF_STATUS_CALLBACK is defined.

Now, I've been calling netif_set_up() before dhcp_start() cause I though
the ifc needed to be somehow up before UDP/IP would be sent through
it... looks like I was wrong and that was not necessary, or worse, not
correct.


___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users