47 #include "contiki-esb.h"
50 PROCESS(radio_test_process,
"Radio test");
51 AUTOSTART_PROCESSES(&radio_test_process);
57 #define PACKET_SIZE 20
63 clock_time_t interval;
69 set(
struct indicator *indicator,
int onoff) {
70 if(indicator->onoff ^ onoff) {
71 indicator->onoff = onoff;
73 leds_on(indicator->led);
75 leds_off(indicator->led);
79 etimer_set(&indicator->timer, indicator->interval);
85 static struct etimer send_timer;
87 static struct indicator recv, other, flash;
92 recv.onoff = other.onoff = flash.onoff = OFF;
95 recv.led = LEDS_YELLOW;
96 other.led = LEDS_GREEN;
105 if(ev == PROCESS_EVENT_TIMER) {
106 if(data == &send_timer) {
110 }
else if(data == &other.timer) {
113 }
else if(data == &recv.timer) {
116 }
else if(data == &flash.timer) {
125 ((
char *)
uip_appdata)[
sizeof(HEADER)] = recv.onoff;
135 || strncmp((
char *)
uip_appdata, HEADER,
sizeof(HEADER))) {
141 set(&other, ((
char *)
uip_appdata)[
sizeof(HEADER)] ? ON : OFF);