I use the Raw API mode of lwIP with an OS, but the OS is cooperative (not
preemptive).  I run a task that processes packets running forever with one
yield to give other tasks a chance to run.  The callbacks from doing so are
handled as they come in.  By definition they are done in the same task.  I
do have other tasks that send data as needed but since my RTOS is
cooperative it never occurs during a time that would be bad or corrupt data
within lwIP.

I think the Raw API would be fairly easy to use with a preemptive RTOS using
a Mutex around all calls to lwIP. You would need some mechanism to not spin
forever processing packets - maybe a delay of some time to let other tasks
run.  Calls in other tasks to tcp_write and so on need to be mutexed as a
group.

Bill
 
>I was working on this over the weekend but could not test it at home
without
>the right equipment so I wanted to understand it as much as I could.  I
used
>the tcpip_callback to indicate to main (in my case without an OS yet) and
>did all the processing of the data in main. As part of the main loop, it is
>looking for packet received from the callback to process. I think this will
>carry forward when I add the OS and there is no need to go with a different
>API when I add an OS.  As far as I can tell, it is working fine and thank
>you again for your advice!
>
>DB



_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to