wait until rime finishes forwarding to send

This commit is contained in:
zhitao 2009-03-10 14:36:48 +00:00
parent f304941ab4
commit 77c8524aa5

View file

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: example-collect.c,v 1.6 2009/02/17 08:44:44 fros4943 Exp $ * $Id: example-collect.c,v 1.7 2009/03/10 14:36:48 zhitao Exp $
*/ */
/** /**
@ -84,6 +84,9 @@ PROCESS_THREAD(example_collect_process, ev, data)
PROCESS_WAIT_EVENT(); PROCESS_WAIT_EVENT();
if(etimer_expired(&et)) { if(etimer_expired(&et)) {
while(tc.forwarding) {
PROCESS_PAUSE();
}
printf("Sending\n"); printf("Sending\n");
rimebuf_clear(); rimebuf_clear();
rimebuf_set_datalen(sprintf(rimebuf_dataptr(), rimebuf_set_datalen(sprintf(rimebuf_dataptr(),