lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] get dynamic ip on lwip-1.4.0.rc1


From: PHAM ANH THIEN
Subject: Re: [lwip-users] get dynamic ip on lwip-1.4.0.rc1
Date: Mon, 25 Oct 2010 21:54:01 +0700

Dear Simon,

Thanks for your quickly reply.

I could not find a well sample dhcp source code on lwip-1.4.0.rc1 and contribute folder, could you please to point me where it is?

Thank you very much,
Thien

On Mon, Oct 25, 2010 at 5:19 PM, Simon Goldschmidt <address@hidden> wrote:
You are completely violating lwIP threading: when using tcpip_input and the tcpip_thread, timers are called for you from that thread already. Also, dhcp_start() may *not* be called from any other thread than the tcpip_thread (as any other functions not explicitly allow). Please do read the little documentation we have and/or have a look at the examples.

Simon


PHAM ANH THIEN <address@hidden>:
> Dear all,
>
> Has Anyone test get dynamic ip on lwip-1.4.0.rc1? I try to do it with this
> code:
>
>     {
>         /* Configure dynamic IP */
>         vhPrintf("Configure dynamic IP...\n");
>         netif_add(pEMAC_if, NULL, NULL, NULL, NULL, ethernetif_init,
> tcpip_input);
>         /* make it the default interface */
>         netif_set_default(pEMAC_if);
>         dhcp_start(pEMAC_if);
>
>         while (pEMAC_if->ip_addr.addr==0) {
>             PSA_Services_WaitMs(DHCP_FINE_TIMER_MSECS);
>             dhcp_fine_tmr();
>             mscnt += DHCP_FINE_TIMER_MSECS;
>             if (mscnt >= DHCP_COARSE_TIMER_SECS*1000) {
>                 dhcp_coarse_tmr();
>                 mscnt = 0;
>             }
>         }
>
>         vhPrintf("\nDone with DHCP");
>         vhPrintf("\nAccquired IP = %d.%d.%d.%d\n",
>                                 0xff & (pEMAC_if->ip_addr.addr),
>                                 0xff & (pEMAC_if->ip_addr.addr >>8),
>                                 0xff & (pEMAC_if->ip_addr.addr >> 16),
>
>                                  0xff & (pEMAC_if->ip_addr.addr >>24)
>                                 );
>     }
>
> but it could not work, the attached file is log message i got, it hang at
> there! I notice that the same above code i used i can get dynamic ip with
> lwip version 1.3.1.rc1.
>
> Thanks in advance!
> Thien

--
GMX DSL Doppel-Flat ab 19,99 &euro;/mtl.! Jetzt auch mit
gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl

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


reply via email to

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