From 2f964a9b81ab74d767477d82cd85a72e2d2366cb Mon Sep 17 00:00:00 2001 From: sdhsdh Date: Mon, 14 Sep 2009 21:42:40 +0000 Subject: [PATCH] more release nits --- support/sdk/c/blip/driver/routing.c | 7 ++-- tos/lib/net/blip/ICMPResponderP.nc | 4 ++- tos/lib/net/blip/IPDispatch.h | 5 ++- tos/lib/net/blip/doc/README | 52 ++++++++++++----------------- 4 files changed, 31 insertions(+), 37 deletions(-) diff --git a/support/sdk/c/blip/driver/routing.c b/support/sdk/c/blip/driver/routing.c index 1bcc036f..5640e36d 100644 --- a/support/sdk/c/blip/driver/routing.c +++ b/support/sdk/c/blip/driver/routing.c @@ -230,7 +230,8 @@ int routing_is_onehop(struct split_ip_msg *msg) { path_t *path; int ret = ROUTE_NO_ROUTE; - if (cmpPfx(msg->hdr.ip6_dst.s6_addr, multicast_prefix)) + if (msg->hdr.ip6_dst.s6_addr[0] == 0xff && + (msg->hdr.ip6_dst.s6_addr[1] & 0xf) <= 0x2) return ROUTE_ONEHOP; @@ -386,8 +387,10 @@ uint8_t routing_insert_route(struct split_ip_msg *orig) { ieee154_saddr_t routing_get_nexthop(struct split_ip_msg *msg) { ieee154_saddr_t ret = 0xffff;; path_t * path; - if (cmpPfx(msg->hdr.ip6_dst.s6_addr, multicast_prefix)) + if (msg->hdr.ip6_dst.s6_addr[0] == 0xff && + (msg->hdr.ip6_dst.s6_addr[1] & 0xf) <= 0x2) { return ret; + } // If it's source routed, just grab the next hop out of the header #if 0 diff --git a/tos/lib/net/blip/ICMPResponderP.nc b/tos/lib/net/blip/ICMPResponderP.nc index 3975c1b4..c7a335c8 100644 --- a/tos/lib/net/blip/ICMPResponderP.nc +++ b/tos/lib/net/blip/ICMPResponderP.nc @@ -222,7 +222,9 @@ module ICMPResponderP { printfUART("beacon seqno: %i my seqno: %i\n", beacon->seqno, nd_seqno); - if (beacon->seqno > nd_seqno || (nd_seqno > 0 && beacon->seqno == 0)) { + if (beacon->seqno > nd_seqno || + (nd_seqno > 0 && beacon->seqno == 0) || + !call IPRouting.hasRoute()) { call IPRouting.reset(); nd_seqno = beacon->seqno; } diff --git a/tos/lib/net/blip/IPDispatch.h b/tos/lib/net/blip/IPDispatch.h index b2e6caec..7bcd9372 100644 --- a/tos/lib/net/blip/IPDispatch.h +++ b/tos/lib/net/blip/IPDispatch.h @@ -32,7 +32,6 @@ enum { N_EPOCHS_COUNTED = 1, N_RECONSTRUCTIONS = 2, N_FORWARD_ENT = IP_NUMBER_FRAGMENTS, - N_RETRIES = 5, }; enum { @@ -60,8 +59,8 @@ enum { }; #else enum { + TGEN_BASE_TIME = 16384L, TGEN_MAX_INTERVAL = 60L * 1024L * 5L, - TGEN_BASE_TIME = TGEN_MAX_INTERVAL, }; #endif @@ -113,7 +112,7 @@ typedef struct { uint8_t nchoices:4; uint8_t retries; uint8_t actRetries; - uint8_t delay; + uint16_t delay; } send_policy_t; typedef struct { diff --git a/tos/lib/net/blip/doc/README b/tos/lib/net/blip/doc/README index 959584fa..8ae52d26 100644 --- a/tos/lib/net/blip/doc/README +++ b/tos/lib/net/blip/doc/README @@ -12,49 +12,39 @@ is necessary for appropriate radio stack support. - Make sure the c serial tools are built in - $TOS_ROOT/support/sdk/c/sf. You may need to run ./bootstrap, + $TOSROOT/support/sdk/c/sf. You may need to run ./bootstrap, ./configure, and make in that folder to generate libmote.a. - - Add two environment variables to your startup scripts: - export LOWPAN_ROOT=~/svn/code/b6lowpan/ - export TOSMAKE_PATH="$LOWPAN_ROOT/support/make" - where LOWPAN_ROOT is replaced with the path to the blip top - level directory. - - - Optionally, have a look at $TOS_ROOT/support/sdk/c/sf/serialsource.c. - There is an enum which defines ACK_TIMEOUT = 1000000 (one second in - usecs). This is much too long and will cause a lot of jitter when - (not if) serial writes fail. Changing it to 100000 is worthwhile. - You will need to rebuild libmote.a by typing 'make' in that folder - after making this change. (SDH : this was true up to a little past - version 2.1. It is now false.) - 2. Building - Build a test app: - * cd to $LOWPAN_ROOT/apps/UDPEcho/ and try typing `make blip` - - Build the IEEE802.15.4 bridge to your computer - * cd to $LOWPAN_ROOT/apps/IPBaseStation/ and `make blip` + * cd to $TOSROOT/apps/UDPEcho/ and try typing `make blip` + - Build the Ieee802.15.4 bridge to your computer + * cd to $TOSROOT/apps/IPBaseStation/ and `make blip` - Build the driver - * cd to $LOWPAN_ROOT/support/sdk/c/blip and type `make` + * cd to $TOSROOT/support/sdk/c/blip + * run ./bootstrap + * run ./configure + * run make 3. Running - Install IPBaseStation on a mote. This will be your - computer's interface to the world of low-power radio. + computer's interface to the world of low-power radio. Setting + the node id and channel is not important-- these settings will be + overwritten. - Start the driver (once you've built it) - * cd $LOWPAN_ROOT/support/sdk/c/blip - * edit the config file $LOWPAN_ROOT/support/sdk/c/blip/serial_tun.conf + * cd $TOSROOT/support/sdk/c/blip + * edit the config file $TOSROOT/support/sdk/c/blip/serial_tun.conf * set 'addr' you would like your computer's interface to use on the PAN - * set 'proxy' to the network device you would like to proxy - neighbor advertisements on - * sudo ./ip-driver /dev/ttyUSB0 telosb + * leave 'proxy' set to 'lo' + * sudo driver/ip-driver /dev/ttyUSB0 telosb (replace the device and baud with whatever you're using) The config file is assumed to be in the CWD when ip-driver starts; if this is not the case it may be specified using '-c ' - - The driver registers itself on the 2001:470:1f04:56d::/64 + - The driver registers itself on the fec0::/64 subnet (or whatever you have specified in the config file). - If you program a few motes with UDPEcho, their addresses are formed @@ -69,10 +59,10 @@ ICMPv6 DAD is not performed. - For instance, if you program a mote with ID 101 (0x65), you can try - ping6 2001:470:1f04:56d::65 - tracert6 2001:470:1f04:56d::65 - nc6 -u 2001:470:1f04:56d::65 7 - nc6 -u 2001:470:1f04:56d::65 2000 + ping6 fec0::65 + tracert6 fec0::65 + nc6 -u fec0::65 7 + nc6 -u fec0::65 2000 UDPEcho runs an echo service on port 7, and a simple shell on port 2000; type 'help' for a list of commands. @@ -81,7 +71,7 @@ UDP. They will send these reports to an address specified in the application make file; however these reports are disabled by default. You can observe these statistics using the Listener.py - script in $LOWPAN_ROOT/apps/UDPEcho/: `python Listener.py`. + script in $TOSROOT/apps/UDPEcho/: `python Listener.py`. - The driver provides a simple console when running, which allows you to inspect and manipulates routes, and view statistics. The -- 2.39.2