lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] Question of uip Stack


From: Adam Dunkels
Subject: [lwip-users] Re: [lwip] Question of uip Stack
Date: Wed, 08 Jan 2003 23:56:51 -0000

Hi!

On Tuesday 11 June 2002 16.39, you wrote:
> What happens when there is a data in the uip_buf buffer originating from
> the application and at the same time a package arrives of the Ethernet? 
> which should also be placed in the uip_buf buffer.
>
> What does the program in a situation as these?

It should not overwrite the contents of the uip_buf until the frame has been 
sent by the driver. The main loop should look something like this:

for(ever;;) {
   check_for_incoming_packet();
   if(incoming_packet()) {
      process_packet();
      if(there_is_a_packet_to_be_sent()) {
         send_outgoing_packet();
      }
   }
}

So if you are using interrupts, you might set a flag by the interrupt handler 
that is read by the check_for_incoming_packet() function. The actual packet 
could then either be kept in the buffer memory of the Ethernet controller or 
be read into a secondary buffer that is copied into the uip_buf when the 
outgoing packet it sent.

/adam
-- 
Adam Dunkels <address@hidden>
http://www.sics.se/~adam
[This message was sent through the lwip discussion list.]




reply via email to

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