diff --git a/examples/rime/example-abc.c b/examples/rime/example-abc.c index 19da07006..50a582ed8 100644 --- a/examples/rime/example-abc.c +++ b/examples/rime/example-abc.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: example-abc.c,v 1.5 2009/03/12 21:58:21 adamdunkels Exp $ + * $Id: example-abc.c,v 1.6 2009/06/09 09:27:03 fros4943 Exp $ */ /** @@ -40,6 +40,7 @@ #include "contiki.h" #include "net/rime.h" +#include "random.h" #include "dev/button-sensor.h" @@ -68,10 +69,11 @@ PROCESS_THREAD(example_abc_process, ev, data) abc_open(&abc, 128, &abc_call); - etimer_set(&et, 2 * CLOCK_SECOND); - while(1) { + /* Delay 2-4 seconds */ + etimer_set(&et, CLOCK_SECOND * 2 + random_rand() % (CLOCK_SECOND * 2)); + PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et)); packetbuf_copyfrom("Hello", 6);