#include "contiki.h"
#include <stdio.h>
#if CONTIKI_TARGET_NETSIM
#include "ether.h"
#endif
PROCESS(example_announcement_process,
"Example announcement process");
AUTOSTART_PROCESSES(&example_announcement_process);
static void
received_announcement(
struct announcement *a,
const rimeaddr_t *from,
uint16_t id, uint16_t value)
{
printf("Got announcement from %d.%d, id %d, value %d, our new value is %d\n",
from->u8[0], from->u8[1], id, value, value + 1);
#if CONTIKI_TARGET_NETSIM
{
char buf[8];
sprintf(buf, "%d", value + 1);
ether_set_text(buf);
}
#endif
}
{
128,
received_announcement);
while(1) {
}
}