lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Start DHCP from application thread not tcpip thread


From: Fred39
Subject: Re: [lwip-users] Start DHCP from application thread not tcpip thread
Date: Wed, 13 Jun 2012 07:10:47 -0700 (PDT)


Pomeroy, Marty wrote:
> 
> Yes, you can and should do that.  I use this in my interrupt code:
>    err_t tmp = tcpip_callback_with_block( s_HandlePhyInterrupt, NULL,
> 0);
> 
> Then s_HandlePhyInterrupt() is called from the tcpip thread.
> 

I call tcpip_callback(dhcp_start(netif_default),0); from my application
thread.

I forgot to activate the timers so now i do that too.
sys_timeout(500, (sys_timeout_handler) lwip_dhcp_fine_tmr, NULL);
sys_timeout(60000, (sys_timeout_handler) lwip_dhcp_coarse_tmr, NULL);

but i still only see a dhcp discover over wireshark.

By setting the forgotten timers dhcp_start(netif_default) now works (i get
an IP address), which starts in my application thread. But i guess this isnt
save. 

Would it be save when i lock my scheduler during dhcp_start and unlock it
after? This also works i tried it but i want to use the tcpip_callback.

So why isnt the tcpip_callback not working? Any suggestions?
-- 
View this message in context: 
http://old.nabble.com/Start-DHCP-from-application-thread-not-tcpip-thread-tp34004026p34005942.html
Sent from the lwip-users mailing list archive at Nabble.com.




reply via email to

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