[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] DHCP callback was removed - Correct way to obtain new a
From: |
Sergio R. Caprile |
Subject: |
Re: [lwip-users] DHCP callback was removed - Correct way to obtain new address? |
Date: |
Wed, 03 Sep 2014 11:05:40 -0300 |
User-agent: |
Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
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.