You can get the IP address, Netmask and Gateway from the netif you're using
for the interface: e.g. netif->ip_addr
With this, you are relying on lwIP-internal data structures! While this
surely works, it is strongly discouraged by the lwIP developers: The
internals data structures are never guaranteed to be portable accross
versions so you risk your code being valid for a specific version of
lwIP only!
I'm aware this is a problem here, though: there is no function (or
macro) netif_get_addr corresponding to your code, which is why Jonathan
suggested using nectonn_addr, which leads to the same result if you have
one netif only.
If( ( netif->flags & (NETIF_FLAG_UP | NETIF_FLAG_LINK_UP) ) !=
(NETIF_FLAG_UP | NETIF_FLAG_LINK_UP) )
Check_timer - if expired do something.
Same as above: please don't use the internal structs and its flag
definitions when the same can be done differently since you risk using
portablilty over lwIP versions:
Since 1.3.0 (which was when NETIF_FALG_LINK_UP was introduced), you can
set callback functions to be called when the netif status changes, which
event eliminates the use of a timer suggested by bill:
netif_set_status_callback.
Simon
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users