mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
Remove old neighbor.h inclusion
This commit is contained in:
parent
a3a8c0e179
commit
f2c9b3e813
@ -28,7 +28,7 @@
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* $Id: shell-rime-debug-runicast.c,v 1.2 2010/02/23 18:22:44 adamdunkels Exp $
|
||||
* $Id: shell-rime-debug-runicast.c,v 1.3 2010/03/19 13:24:26 adamdunkels Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -47,7 +47,6 @@
|
||||
#include "lib/random.h"
|
||||
|
||||
#include "net/rime.h"
|
||||
#include "net/rime/neighbor.h"
|
||||
#include "net/rime/route.h"
|
||||
#include "net/rime/trickle.h"
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* $Id: shell-rime-debug.c,v 1.4 2009/11/08 19:43:00 adamdunkels Exp $
|
||||
* $Id: shell-rime-debug.c,v 1.5 2010/03/19 13:24:26 adamdunkels Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -47,7 +47,6 @@
|
||||
#include "lib/random.h"
|
||||
|
||||
#include "net/rime.h"
|
||||
#include "net/rime/neighbor.h"
|
||||
#include "net/rime/route.h"
|
||||
#include "net/rime/trickle.h"
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* $Id: shell-rime-netcmd.c,v 1.8 2009/04/06 23:29:31 adamdunkels Exp $
|
||||
* $Id: shell-rime-netcmd.c,v 1.9 2010/03/19 13:24:26 adamdunkels Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -48,7 +48,6 @@
|
||||
#include "lib/random.h"
|
||||
|
||||
#include "net/rime.h"
|
||||
#include "net/rime/neighbor.h"
|
||||
#include "net/rime/route.h"
|
||||
#include "net/rime/trickle.h"
|
||||
|
||||
@ -90,7 +89,7 @@ PROCESS_THREAD(shell_netcmd_server_process, ev, data)
|
||||
PROCESS_BEGIN();
|
||||
|
||||
/* XXX: direct output to null. */
|
||||
/* printf("netcmd server got command string '%s'\n", (char *)data);*/
|
||||
printf("netcmd server got command string '%s'\n", (char *)data);
|
||||
err = shell_start_command(data, strlen((char * )data), NULL, &child_command);
|
||||
if(err == SHELL_FOREGROUND && process_is_running(child_command)) {
|
||||
PROCESS_WAIT_EVENT_UNTIL(ev == PROCESS_EVENT_EXIT ||
|
||||
@ -132,7 +131,7 @@ PROCESS_THREAD(shell_netcmd_process, ev, data)
|
||||
/* Terminate the string with a NUL character. */
|
||||
msg->netcmd[len] = 0;
|
||||
msg->crc = crc16_data(msg->netcmd, len, 0);
|
||||
/* printf("netcmd sending '%s'\n", msg->netcmd);*/
|
||||
printf("netcmd sending '%s'\n", msg->netcmd);
|
||||
trickle_send(&trickle);
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* $Id: shell-rime-unicast.c,v 1.3 2009/11/08 19:43:00 adamdunkels Exp $
|
||||
* $Id: shell-rime-unicast.c,v 1.4 2010/03/19 13:24:26 adamdunkels Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -47,7 +47,6 @@
|
||||
#include "lib/random.h"
|
||||
|
||||
#include "net/rime.h"
|
||||
#include "net/rime/neighbor.h"
|
||||
#include "net/rime/route.h"
|
||||
#include "net/rime/trickle.h"
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* $Id: shell-rime.c,v 1.17 2010/02/28 14:16:19 adamdunkels Exp $
|
||||
* $Id: shell-rime.c,v 1.18 2010/03/19 13:24:26 adamdunkels Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -48,7 +48,6 @@
|
||||
#include "lib/random.h"
|
||||
|
||||
#include "net/rime.h"
|
||||
#include "net/rime/neighbor.h"
|
||||
#include "net/rime/route.h"
|
||||
|
||||
#include "net/rime/timesynch.h"
|
||||
@ -64,7 +63,7 @@ int snprintf(char *str, size_t size, const char *format, ...);
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#define COLLECT_REXMITS 8
|
||||
#define COLLECT_REXMITS 4
|
||||
|
||||
#define COLLECT_MSG_HDRSIZE 4
|
||||
struct collect_msg {
|
||||
|
@ -33,7 +33,7 @@
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* $Id: rime.h,v 1.27 2010/02/23 20:09:11 nifi Exp $
|
||||
* $Id: rime.h,v 1.28 2010/03/19 13:20:40 adamdunkels Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -53,7 +53,6 @@
|
||||
#include "net/rime/mesh.h"
|
||||
#include "net/rime/multihop.h"
|
||||
#include "net/rime/neighbor-discovery.h"
|
||||
#include "net/rime/neighbor.h"
|
||||
#include "net/rime/netflood.h"
|
||||
#include "net/rime/polite-announcement.h"
|
||||
#include "net/rime/polite.h"
|
||||
|
@ -33,7 +33,7 @@
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* $Id: neighbor-discovery.c,v 1.18 2010/03/17 14:36:46 fros4943 Exp $
|
||||
* $Id: neighbor-discovery.c,v 1.19 2010/03/19 13:21:48 adamdunkels Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -46,7 +46,6 @@
|
||||
#include "contiki.h"
|
||||
|
||||
#include "net/rime.h"
|
||||
#include "net/rime/neighbor.h"
|
||||
#include "net/rime/neighbor-discovery.h"
|
||||
|
||||
#include "dev/radio-sensor.h"
|
||||
@ -100,11 +99,11 @@ adv_packet_received(struct broadcast_conn *ibc, const rimeaddr_t *from)
|
||||
struct adv_msg *msg = packetbuf_dataptr();
|
||||
uint16_t val;
|
||||
|
||||
memcpy(&val, &msg->val, sizeof(val));
|
||||
|
||||
PRINTF("%d.%d: adv_packet_received from %d.%d with val %d\n",
|
||||
rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1],
|
||||
from->u8[0], from->u8[1], msg->val);
|
||||
|
||||
memcpy(&val, &msg->val, sizeof(val));
|
||||
from->u8[0], from->u8[1], val);
|
||||
|
||||
/* If we receive an announcement with a lower value than ours, we
|
||||
cancel our own announcement. */
|
||||
@ -145,10 +144,12 @@ send_timer(void *ptr)
|
||||
interval = c->max_interval;
|
||||
}
|
||||
|
||||
|
||||
c->current_interval = interval;
|
||||
|
||||
/* printf("current_interval %lu\n", (long unsigned int) interval);*/
|
||||
|
||||
PRINTF("current_interval %lu\n", (long unsigned int) interval);
|
||||
|
||||
set_timers(c);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
@ -162,6 +163,9 @@ neighbor_discovery_open(struct neighbor_discovery_conn *c, uint16_t channel,
|
||||
clock_time_t max,
|
||||
const struct neighbor_discovery_callbacks *cb)
|
||||
{
|
||||
PRINTF("%d.%d: neighbor discovery open channel %d\n",
|
||||
rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1],
|
||||
channel);
|
||||
broadcast_open(&c->c, channel, &broadcast_callbacks);
|
||||
c->u = cb;
|
||||
c->initial_interval = initial;
|
||||
|
@ -34,7 +34,7 @@
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* $Id: runicast.c,v 1.10 2010/02/23 18:38:05 adamdunkels Exp $
|
||||
* $Id: runicast.c,v 1.11 2010/03/19 13:21:59 adamdunkels Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -45,11 +45,9 @@
|
||||
*/
|
||||
|
||||
#include "net/rime/runicast.h"
|
||||
#include "net/rime/neighbor.h"
|
||||
#include "net/rime.h"
|
||||
#include <string.h>
|
||||
|
||||
#define RUNICAST_PACKET_ID_BITS 2
|
||||
|
||||
#ifdef RUNICAST_CONF_REXMIT_TIME
|
||||
#define REXMIT_TIME RUNICAST_CONF_REXMIT_TIME
|
||||
@ -83,13 +81,14 @@ sent_by_stunicast(struct stunicast_conn *stunicast, int status, int num_tx)
|
||||
/* Only process data packets, not ACKs. */
|
||||
if(packetbuf_attr(PACKETBUF_ATTR_PACKET_TYPE) == PACKETBUF_ATTR_PACKET_TYPE_DATA) {
|
||||
|
||||
c->rxmit += num_tx;
|
||||
c->rxmit += 1;
|
||||
|
||||
if(c->rxmit != 0) {
|
||||
RIMESTATS_ADD(rexmit);
|
||||
PRINTF("%d.%d: runicast: packet %u resent %u\n",
|
||||
PRINTF("%d.%d: runicast: sent_by_stunicast packet %u (%u) resent %u\n",
|
||||
rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1],
|
||||
packetbuf_attr(PACKETBUF_ATTR_PACKET_ID), c->rxmit);
|
||||
packetbuf_attr(PACKETBUF_ATTR_PACKET_ID),
|
||||
c->sndnxt, c->rxmit);
|
||||
}
|
||||
if(c->rxmit >= c->max_rxmit) {
|
||||
RIMESTATS_ADD(timedout);
|
||||
@ -234,6 +233,7 @@ runicast_send(struct runicast_conn *c, const rimeaddr_t *receiver,
|
||||
packetbuf_set_attr(PACKETBUF_ATTR_RELIABLE, 1);
|
||||
packetbuf_set_attr(PACKETBUF_ATTR_PACKET_TYPE, PACKETBUF_ATTR_PACKET_TYPE_DATA);
|
||||
packetbuf_set_attr(PACKETBUF_ATTR_PACKET_ID, c->sndnxt);
|
||||
packetbuf_set_attr(PACKETBUF_ATTR_MAX_MAC_REXMIT, 2);
|
||||
c->max_rxmit = max_retransmissions;
|
||||
c->rxmit = 0;
|
||||
c->is_tx = 1;
|
||||
|
@ -66,7 +66,7 @@
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* $Id: runicast.h,v 1.6 2009/11/08 19:40:18 adamdunkels Exp $
|
||||
* $Id: runicast.h,v 1.7 2010/03/19 13:22:08 adamdunkels Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -83,9 +83,12 @@
|
||||
|
||||
struct runicast_conn;
|
||||
|
||||
|
||||
#define RUNICAST_PACKET_ID_BITS 2
|
||||
|
||||
#define RUNICAST_ATTRIBUTES { PACKETBUF_ATTR_PACKET_TYPE, PACKETBUF_ATTR_BIT }, \
|
||||
{ PACKETBUF_ATTR_PACKET_ID, PACKETBUF_ATTR_BIT * 2 }, \
|
||||
STUNICAST_ATTRIBUTES
|
||||
{ PACKETBUF_ATTR_PACKET_ID, PACKETBUF_ATTR_BIT * RUNICAST_PACKET_ID_BITS }, \
|
||||
STUNICAST_ATTRIBUTES
|
||||
struct runicast_callbacks {
|
||||
void (* recv)(struct runicast_conn *c, const rimeaddr_t *from, uint8_t seqno);
|
||||
void (* sent)(struct runicast_conn *c, const rimeaddr_t *to, uint8_t retransmissions);
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* $Id: example-collect.c,v 1.10 2010/02/03 21:11:33 adamdunkels Exp $
|
||||
* $Id: example-collect.c,v 1.11 2010/03/19 13:26:27 adamdunkels Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -42,7 +42,6 @@
|
||||
#include "lib/random.h"
|
||||
#include "net/rime.h"
|
||||
#include "net/rime/collect.h"
|
||||
#include "net/rime/neighbor.h"
|
||||
#include "dev/leds.h"
|
||||
#include "dev/button-sensor.h"
|
||||
|
||||
@ -75,6 +74,13 @@ PROCESS_THREAD(example_collect_process, ev, data)
|
||||
|
||||
collect_open(&tc, 130, &callbacks);
|
||||
|
||||
if(rimeaddr_node_addr.u8[0] == 1 &&
|
||||
rimeaddr_node_addr.u8[1] == 1) {
|
||||
printf("I am sink\n");
|
||||
collect_set_sink(&tc, 1);
|
||||
|
||||
}
|
||||
|
||||
while(1) {
|
||||
static struct etimer et;
|
||||
|
||||
@ -85,7 +91,7 @@ PROCESS_THREAD(example_collect_process, ev, data)
|
||||
PROCESS_WAIT_EVENT();
|
||||
|
||||
if(etimer_expired(&et)) {
|
||||
while(tc.forwarding) {
|
||||
while(tc.sending) {
|
||||
PROCESS_PAUSE();
|
||||
}
|
||||
printf("Sending\n");
|
||||
|
Loading…
Reference in New Issue
Block a user