Update example-collect.c

- bugfix: more frequent transmissions than expected (every 30 seconds)
- indentation: replace tabs with spaces
This commit is contained in:
Yasuyuki Tanaka 2016-12-13 15:32:21 +01:00
parent 5d19196e54
commit 8b3f29325d

View file

@ -88,15 +88,12 @@ PROCESS_THREAD(example_collect_process, ev, data)
while(1) {
/* Send a packet every 30 seconds. */
if(etimer_expired(&periodic)) {
etimer_set(&periodic, CLOCK_SECOND * 30);
etimer_set(&et, random_rand() % (CLOCK_SECOND * 30));
}
PROCESS_WAIT_EVENT();
PROCESS_WAIT_UNTIL(etimer_expired(&et));
if(etimer_expired(&et)) {
{
static linkaddr_t oldparent;
const linkaddr_t *parent;
@ -118,6 +115,7 @@ PROCESS_THREAD(example_collect_process, ev, data)
}
}
PROCESS_WAIT_UNTIL(etimer_expired(&periodic));
}
PROCESS_END();