lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Noob DHCP question


From: Chris Ponder
Subject: Re: [lwip-users] Noob DHCP question
Date: Thu, 22 Mar 2012 15:55:28 +0000

Brilliant, thanks Simon
Chris

-----Original Message-----

Kieran Mansley wrote:
> On 15 Mar 2012, at 15:37, Chris Ponder wrote:
>
>> At the application level I want to know when I have an address, if there is 
>> an error getting an address, if the network lead is disconnected / 
>> re-connected so that I can restart the Ethernet or set a static address as I 
>> see fit.
> I'm not sure what the supported way of doing this is, but I'm sure that other 
> people do similar things to this.  Can anyone help Chris with some 
> suggestions here please?

- "when I have an address": you can register a callback with
netif_set_status_callback() that gets called when the netif is set up or down. 
Since DHCP sets it to 'up' after getting an address, is this what you want?
- "the network lead is disconnected": you can register a callback with 
netif_set_link_callback(), but for this callback to work, your netif driver 
needs to notify lwIP of link state changes by calling
netif_set_link_up() / netif_set_link_down().
- "if there is an error getting an address": I'm not sure how to do
that: DHCP just keeps on trying. Maybe you can just use a timeout and do 
something if you didn't get an address X seconds after the link went from 
'down' to 'up'?

Simon

_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users
********************************************************

The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. If you are not the addressee, any disclosure, reproduction,
copying, distribution, or other dissemination or use of this communication is
strictly prohibited. If you have received this transmission in
error please notify the sender immediately and then delete this e-mail.
E-mail transmission cannot be guaranteed to be secure or error free as
information could be intercepted, corrupted lost, destroyed, arrive late or
incomplete, or contain viruses.
The sender therefore does not accept liability for any errors or omissions
in the contents of this message which arise as a result of e-mail
transmission. If verification is required please request a hard copy
version.

********************************************************




reply via email to

[Prev in Thread] Current Thread [Next in Thread]