From 0db074ae2953c710e48b605a58d1464435725c7d Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Tue, 22 May 2007 21:04:00 +0000 Subject: [PATCH] Renamed uabc to polite --- examples/rime/Makefile | 2 +- examples/rime/{test-uabc.c => test-polite.c} | 24 +++++----- examples/rime/test-uibc.c | 48 -------------------- 3 files changed, 13 insertions(+), 61 deletions(-) rename examples/rime/{test-uabc.c => test-polite.c} (61%) delete mode 100644 examples/rime/test-uibc.c diff --git a/examples/rime/Makefile b/examples/rime/Makefile index ea274c033..d86e081f5 100644 --- a/examples/rime/Makefile +++ b/examples/rime/Makefile @@ -2,7 +2,7 @@ CONTIKI = ../.. ifndef TARGET TARGET=netsim endif -all: test-abc test-meshroute test-treeroute test-trickle test-uabc \ +all: test-abc test-meshroute test-treeroute test-trickle test-polite \ test-rudolph0 test-rudolph1 test-rudolph2 test-rucb include $(CONTIKI)/Makefile.include diff --git a/examples/rime/test-uabc.c b/examples/rime/test-polite.c similarity index 61% rename from examples/rime/test-uabc.c rename to examples/rime/test-polite.c index a77c0d8df..e7bd188e3 100644 --- a/examples/rime/test-uabc.c +++ b/examples/rime/test-polite.c @@ -1,46 +1,46 @@ -#include "net/rime/uabc.h" +#include "net/rime/polite.h" #include "contiki.h" #include /*---------------------------------------------------------------------------*/ -PROCESS(test_uabc_process, ""); -AUTOSTART_PROCESSES(&test_uabc_process); +PROCESS(test_polite_process, ""); +AUTOSTART_PROCESSES(&test_polite_process); /*---------------------------------------------------------------------------*/ static void -recv(struct uabc_conn *c) +recv(struct polite_conn *c) { printf("recv '%s'\n", (char *)rimebuf_dataptr()); } static void -sent(struct uabc_conn *c) +sent(struct polite_conn *c) { printf("sent\n"); } static void -dropped(struct uabc_conn *c) +dropped(struct polite_conn *c) { printf("dropped\n"); } -static const struct uabc_callbacks callbacks = { recv, sent, dropped }; +static const struct polite_callbacks callbacks = { recv, sent, dropped }; /*---------------------------------------------------------------------------*/ -PROCESS_THREAD(test_uabc_process, ev, data) +PROCESS_THREAD(test_polite_process, ev, data) { - static struct uabc_conn c; + static struct polite_conn c; - PROCESS_EXITHANDLER(uabc_close(&c)); + PROCESS_EXITHANDLER(polite_close(&c)); PROCESS_BEGIN(); - uabc_open(&c, 128, &callbacks); + polite_open(&c, 128, &callbacks); while(1) { static struct etimer et; etimer_set(&et, CLOCK_SECOND * 4); PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et)); rimebuf_copyfrom("Hej", 4); - uabc_send(&c, CLOCK_SECOND * 4); + polite_send(&c, CLOCK_SECOND * 4, 4); } diff --git a/examples/rime/test-uibc.c b/examples/rime/test-uibc.c deleted file mode 100644 index d21e14012..000000000 --- a/examples/rime/test-uibc.c +++ /dev/null @@ -1,48 +0,0 @@ - -#include "net/rime/uibc.h" -#include "contiki.h" -/*---------------------------------------------------------------------------*/ -PROCESS(test_uibc_process, ""); -AUTOSTART_PROCESSES(&test_uibc_process); -/*---------------------------------------------------------------------------*/ -static void -recv(struct uibc_conn *c, rimeaddr_t *from) -{ - printf("recv '%s' from %d.%d\n", rimebuf_dataptr(), - from->u8[0], from->u8[1]); -} -static void -sent(struct uibc_conn *c) -{ - printf("sent\n"); -} -static void -dropped(struct uibc_conn *c) -{ - printf("dropped\n"); -} -static const struct uibc_callbacks callbacks = { recv, sent, dropped }; -/*---------------------------------------------------------------------------*/ -PROCESS_THREAD(test_uibc_process, ev, data) -{ - static struct uibc_conn c; - - PROCESS_EXITHANDLER(uibc_close(&c)); - - PROCESS_BEGIN(); - - uibc_open(&c, 128, &callbacks); - - while(1) { - static struct etimer et; - etimer_set(&et, CLOCK_SECOND * 4); - PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et)); - rimebuf_copyfrom("Hej", 4); - uibc_send(&c, CLOCK_SECOND * 4); - - - } - - PROCESS_END(); -} -/*---------------------------------------------------------------------------*/