On Sun, 2010-11-28 at 16:31 -0500, shogun wrote: > In the most simple terms, my question is if I use the RAW API, do I > need two > tasks for the lwip stack as described in section "12.2 Implementation > of the > API" of the document "Design and Implementation of the lwIP. TCP/IP > Stack". > It's not clear to me what goes in what context with and without a > RTOS.
The golden rule is that only one thread should be active in lwIP. The way this is normally achieved with an OS is to have a thread that is dedicated to lwIP - this is often referred to as the tcpip thread. The driver will pass received packets to the tcpip thread by queueing them and setting a flag for example. The application must do something similar. The netconn API is one example of how to do this and might be the easiest way for you, but you can also do it with the raw API. You just have to make sure you get into the context of the tcpip thread to do any lwIP actions. E.g. by using the tcpip_callback() function. Kieran _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
