Renamed the rimebuf module to packetbuf to signal that the module is used outside of a pure Rime context (e.g., the sicslowpan code uses it).

This commit is contained in:
adamdunkels 2009-03-12 21:58:20 +00:00
parent 932fc9f748
commit 65eb5fd4e8
90 changed files with 690 additions and 687 deletions

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: example-abc.c,v 1.4 2009/02/07 22:38:01 adamdunkels Exp $
* $Id: example-abc.c,v 1.5 2009/03/12 21:58:21 adamdunkels Exp $
*/
/**
@ -53,7 +53,7 @@ AUTOSTART_PROCESSES(&example_abc_process);
static void
abc_recv(struct abc_conn *c)
{
printf("abc message received '%s'\n", (char *)rimebuf_dataptr());
printf("abc message received '%s'\n", (char *)packetbuf_dataptr());
}
static const struct abc_callbacks abc_call = {abc_recv};
static struct abc_conn abc;
@ -74,7 +74,7 @@ PROCESS_THREAD(example_abc_process, ev, data)
PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et));
rimebuf_copyfrom("Hello", 6);
packetbuf_copyfrom("Hello", 6);
abc_send(&abc);
printf("abc message sent\n");

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: example-collect.c,v 1.7 2009/03/10 14:36:48 zhitao Exp $
* $Id: example-collect.c,v 1.8 2009/03/12 21:58:21 adamdunkels Exp $
*/
/**
@ -60,8 +60,8 @@ 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,
rimebuf_datalen(),
(char *)rimebuf_dataptr());
packetbuf_datalen(),
(char *)packetbuf_dataptr());
}
/*---------------------------------------------------------------------------*/
@ -88,8 +88,8 @@ PROCESS_THREAD(example_collect_process, ev, data)
PROCESS_PAUSE();
}
printf("Sending\n");
rimebuf_clear();
rimebuf_set_datalen(sprintf(rimebuf_dataptr(),
packetbuf_clear();
packetbuf_set_datalen(sprintf(packetbuf_dataptr(),
"%s", "Hello") + 1);
collect_send(&tc, 4);
}

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: example-mesh.c,v 1.3 2009/01/19 13:24:42 nifi Exp $
* $Id: example-mesh.c,v 1.4 2009/03/12 21:58:21 adamdunkels Exp $
*/
/**
@ -68,9 +68,9 @@ recv(struct mesh_conn *c, rimeaddr_t *from, uint8_t hops)
{
printf("Data received from %d.%d: %.*s (%d)\n",
from->u8[0], from->u8[1],
rimebuf_datalen(), (char *)rimebuf_dataptr(), rimebuf_datalen());
packetbuf_datalen(), (char *)packetbuf_dataptr(), packetbuf_datalen());
rimebuf_copyfrom("Hopp", 4);
packetbuf_copyfrom("Hopp", 4);
mesh_send(&mesh, from);
}
@ -100,7 +100,7 @@ PROCESS_THREAD(example_mesh_process, ev, data)
* 6.
*/
rimebuf_copyfrom("Hej", 3);
packetbuf_copyfrom("Hej", 3);
addr.u8[0] = 161;
addr.u8[1] = 161;
mesh_send(&mesh, &addr);

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: example-meshconn.c,v 1.1 2008/01/25 18:00:50 adamdunkels Exp $
* $Id: example-meshconn.c,v 1.2 2009/03/12 21:58:21 adamdunkels Exp $
*/
/**
@ -77,7 +77,7 @@ static void
recv(struct meshconn_conn *c)
{
printf("Data received from %.*s (%d)\n",
rimebuf_datalen(), (char *)rimebuf_dataptr(), rimebuf_datalen());
packetbuf_datalen(), (char *)packetbuf_dataptr(), packetbuf_datalen());
/* meshconn_send(&meshconn, from);*/
}
@ -116,7 +116,7 @@ PROCESS_THREAD(test_meshconn_process, ev, data)
addr.u8[1] = 0;
meshconn_connect(&meshconn, addr);
rimebuf_copyfrom("Hej", 3);
packetbuf_copyfrom("Hej", 3);
meshconn_send(&meshconn, &addr);
}
PROCESS_END();

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: example-multihop.c,v 1.2 2009/01/16 17:40:16 nifi Exp $
* $Id: example-multihop.c,v 1.3 2009/03/12 21:58:21 adamdunkels Exp $
*/
/**
@ -54,13 +54,13 @@ static void
recv(struct multihop_conn *c, rimeaddr_t *sender, rimeaddr_t *prevhop,
uint8_t hops)
{
printf("multihop message received '%s'\n", (char *)rimebuf_dataptr());
printf("multihop message received '%s'\n", (char *)packetbuf_dataptr());
}
static rimeaddr_t *
forward(struct multihop_conn *c, rimeaddr_t *originator, rimeaddr_t *dest,
rimeaddr_t *prevhop, uint8_t hops)
{
printf("Forwarding message '%s'\n", (char *)rimebuf_dataptr());
printf("Forwarding message '%s'\n", (char *)packetbuf_dataptr());
return NULL;
}
static const struct multihop_callbacks multihop_call = {recv, forward};
@ -82,7 +82,7 @@ PROCESS_THREAD(example_multihop_process, ev, data)
PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et));
rimebuf_copyfrom("Hej", 4);
packetbuf_copyfrom("Hej", 4);
to.u8[0] = 161;
to.u8[1] = 161;
multihop_send(&multihop, &to);

View file

@ -11,7 +11,7 @@ AUTOSTART_PROCESSES(&example_polite_process);
static void
recv(struct polite_conn *c)
{
printf("recv '%s'\n", (char *)rimebuf_dataptr());
printf("recv '%s'\n", (char *)packetbuf_dataptr());
}
static void
sent(struct polite_conn *c)
@ -39,7 +39,7 @@ PROCESS_THREAD(example_polite_process, ev, data)
static struct etimer et;
etimer_set(&et, CLOCK_SECOND * 4);
PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et));
rimebuf_copyfrom("Hej", 4);
packetbuf_copyfrom("Hej", 4);
polite_send(&c, CLOCK_SECOND * 4, 4);

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: example-runicast.c,v 1.3 2009/03/03 12:28:39 fros4943 Exp $
* $Id: example-runicast.c,v 1.4 2009/03/12 21:58:21 adamdunkels Exp $
*/
/**
@ -144,7 +144,7 @@ PROCESS_THREAD(test_runicast_process, ev, data)
if(!runicast_is_transmitting(&runicast)) {
rimeaddr_t recv;
rimebuf_copyfrom("Hello", 5);
packetbuf_copyfrom("Hello", 5);
recv.u8[0] = 1;
recv.u8[1] = 0;

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: example-trickle.c,v 1.1 2008/01/25 18:00:51 adamdunkels Exp $
* $Id: example-trickle.c,v 1.2 2009/03/12 21:58:21 adamdunkels Exp $
*/
/**
@ -55,7 +55,7 @@ trickle_recv(struct trickle_conn *c)
{
printf("%d.%d: trickle message received '%s'\n",
rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1],
(char *)rimebuf_dataptr());
(char *)packetbuf_dataptr());
}
const static struct trickle_callbacks trickle_call = {trickle_recv};
static struct trickle_conn trickle;
@ -72,7 +72,7 @@ PROCESS_THREAD(example_trickle_process, ev, data)
PROCESS_WAIT_EVENT_UNTIL(ev == sensors_event &&
data == &button_sensor);
rimebuf_copyfrom("Hello, world", 13);
packetbuf_copyfrom("Hello, world", 13);
trickle_send(&trickle);
}

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: example-unicast.c,v 1.1 2008/06/26 11:20:22 adamdunkels Exp $
* $Id: example-unicast.c,v 1.2 2009/03/12 21:58:21 adamdunkels Exp $
*/
/**
@ -76,7 +76,7 @@ PROCESS_THREAD(example_unicast_process, ev, data)
PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et));
rimebuf_copyfrom("Hello", 5);
packetbuf_copyfrom("Hello", 5);
addr.u8[0] = 41;
addr.u8[1] = 41;
unicast_send(&uc, &addr);