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

@ -26,14 +26,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: radio-test.c,v 1.4 2008/07/09 21:49:20 nifi Exp $
* $Id: radio-test.c,v 1.5 2009/03/12 21:58:21 adamdunkels Exp $
*
* -----------------------------------------------------------------
*
* Author : Adam Dunkels, Joakim Eriksson, Niclas Finne
* Created : 2006-03-07
* Updated : $Date: 2008/07/09 21:49:20 $
* $Revision: 1.4 $
* Updated : $Date: 2009/03/12 21:58:21 $
* $Revision: 1.5 $
*
* Simple application to indicate connectivity between two nodes:
*
@ -91,14 +91,14 @@ static void
abc_recv(struct abc_conn *c)
{
/* packet received */
if(rimebuf_datalen() < PACKET_SIZE
|| strncmp((char *)rimebuf_dataptr(), HEADER, sizeof(HEADER))) {
if(packetbuf_datalen() < PACKET_SIZE
|| strncmp((char *)packetbuf_dataptr(), HEADER, sizeof(HEADER))) {
/* invalid message */
} else {
PROCESS_CONTEXT_BEGIN(&radio_test_process);
set(&recv, ON);
set(&other, ((char *)rimebuf_dataptr())[sizeof(HEADER)] ? ON : OFF);
set(&other, ((char *)packetbuf_dataptr())[sizeof(HEADER)] ? ON : OFF);
/* synchronize the sending to keep the nodes from sending
simultaneously */
@ -137,10 +137,10 @@ PROCESS_THREAD(radio_test_process, ev, data)
etimer_reset(&send_timer);
/* send packet */
rimebuf_copyfrom(HEADER, sizeof(HEADER));
((char *)rimebuf_dataptr())[sizeof(HEADER)] = recv.onoff;
packetbuf_copyfrom(HEADER, sizeof(HEADER));
((char *)packetbuf_dataptr())[sizeof(HEADER)] = recv.onoff;
/* send arbitrary data to fill the packet size */
rimebuf_set_datalen(PACKET_SIZE);
packetbuf_set_datalen(PACKET_SIZE);
set(&flash, ON);
abc_send(&abc);

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: sky-collect.c,v 1.8 2008/12/02 08:09:46 adamdunkels Exp $
* $Id: sky-collect.c,v 1.9 2009/03/12 21:58:21 adamdunkels Exp $
*/
/**
@ -164,7 +164,7 @@ recv(const rimeaddr_t *originator, uint8_t seqno, uint8_t hops)
{
struct sky_collect_msg *msg;
msg = rimebuf_dataptr();
msg = packetbuf_dataptr();
printf("%u %u %u %u %u %u %u %u %u %u %u %lu %lu %lu %lu %lu ",
(originator->u8[1] << 8) + originator->u8[0],
seqno, hops,
@ -213,9 +213,9 @@ PROCESS_THREAD(test_collect_process, ev, data)
struct sky_collect_msg *msg;
struct neighbor *n;
/* leds_toggle(LEDS_BLUE);*/
rimebuf_clear();
msg = (struct sky_collect_msg *)rimebuf_dataptr();
rimebuf_set_datalen(sizeof(struct sky_collect_msg));
packetbuf_clear();
msg = (struct sky_collect_msg *)packetbuf_dataptr();
packetbuf_set_datalen(sizeof(struct sky_collect_msg));
msg->light1 = sensors_light1();
msg->light2 = sensors_light2();
msg->temperature = sht11_temp();