diff --git a/platform/cooja/dev/radio-arch.c b/platform/cooja/dev/radio-arch.c index 15076192e..720fb41a6 100644 --- a/platform/cooja/dev/radio-arch.c +++ b/platform/cooja/dev/radio-arch.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: radio-arch.c,v 1.7 2006/10/09 14:13:04 fros4943 Exp $ + * $Id: radio-arch.c,v 1.8 2006/10/09 14:42:25 fros4943 Exp $ */ #include "dev/radio-arch.h" @@ -105,7 +105,11 @@ doInterfaceActionsBeforeTick(void) // Hand over new packet to uIP uip_len = simInSize; memcpy(&uip_buf[UIP_LLH_LEN], &simInDataBuffer[0], simInSize); - tcpip_input(); + + if (simNoYield) + simDoTcpipInput = 1; + else + tcpip_input(); simInSize = 0; } diff --git a/platform/cooja/lib/simEnvChange.c b/platform/cooja/lib/simEnvChange.c index 259b01d1f..1b38a6d84 100644 --- a/platform/cooja/lib/simEnvChange.c +++ b/platform/cooja/lib/simEnvChange.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: simEnvChange.c,v 1.5 2006/10/09 14:13:42 fros4943 Exp $ + * $Id: simEnvChange.c,v 1.6 2006/10/09 14:42:38 fros4943 Exp $ */ #include @@ -39,6 +39,7 @@ extern const struct simInterface *simInterfaces[]; char simDontFallAsleep = 0; char simNoYield = 0; +char simDoTcpipInput = 0; int simProcessRunValue; int simEtimerPending; diff --git a/platform/cooja/lib/simEnvChange.h b/platform/cooja/lib/simEnvChange.h index 91c0cfb48..ea743cdae 100644 --- a/platform/cooja/lib/simEnvChange.h +++ b/platform/cooja/lib/simEnvChange.h @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: simEnvChange.h,v 1.5 2006/10/09 14:13:42 fros4943 Exp $ + * $Id: simEnvChange.h,v 1.6 2006/10/09 14:42:38 fros4943 Exp $ */ #ifndef __SIMENVCHANGE_H__ @@ -46,6 +46,7 @@ extern int simNextExpirationTime; // Variable that when set to != 0, stops the mote from falling asleep next tick extern char simDontFallAsleep; extern char simNoYield; +extern char simDoTcpipInput; // Definition for registering an interface #define SIM_INTERFACE(name, doActionsBeforeTick, doActionsAfterTick) \ diff --git a/tools/cooja/config/code_main_template b/tools/cooja/config/code_main_template index 122deabf3..abf35893a 100644 --- a/tools/cooja/config/code_main_template +++ b/tools/cooja/config/code_main_template @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: code_main_template,v 1.9 2006/10/09 14:14:18 fros4943 Exp $ + * $Id: code_main_template,v 1.10 2006/10/09 14:42:55 fros4943 Exp $ */ /** @@ -116,6 +116,11 @@ start_process_run_loop(void *data) /* Always pretend we have processes left while inside process_run() */ simProcessRunValue = 1; + if (simDoTcpipInput) { + simDoTcpipInput = 0; + tcpip_input(); + } + simProcessRunValue = process_run(); // Check if we must stay awake