#include "contiki.h"
#include "lib/random.h"
#include "dev/leds.h"
#include "dev/button-sensor.h"
#include <stdio.h>
static struct collect_conn tc;
PROCESS(example_collect_process,
"Test collect process");
AUTOSTART_PROCESSES(&example_collect_process);
static void
recv(const rimeaddr_t *originator, uint8_t seqno, uint8_t hops)
{
printf("Sink got message from %d.%d, seqno %d, hops %d: len %d '%s'\n",
originator->u8[0], originator->u8[1],
seqno, hops,
}
static const struct collect_callbacks callbacks = { recv };
{
static struct etimer periodic;
collect_open(&tc, 130, COLLECT_ROUTER, &callbacks);
printf("I am sink\n");
collect_set_sink(&tc, 1);
}
while(1) {
}
static rimeaddr_t oldparent;
const rimeaddr_t *parent;
printf("Sending\n");
"%s", "Hello") + 1);
collect_send(&tc, 15);
parent = collect_parent(&tc);
printf("#L %d 0\n", oldparent.u8[0]);
}
printf("#L %d 1\n", parent->u8[0]);
}
}
}
}
}