lwip-users
[Top][All Lists]
Advanced

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

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


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

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

Attachment: get
Description: Binary data


reply via email to

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