From 747eafd5f000deaa9cafcd6a5d2a58fef3a23fac Mon Sep 17 00:00:00 2001 From: Fredrik Osterlind Date: Fri, 11 Feb 2011 15:27:14 +0100 Subject: [PATCH] support for tinyos style node ids, to simplify testbed experiments with automatic node ids --- platform/sky/contiki-sky-main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platform/sky/contiki-sky-main.c b/platform/sky/contiki-sky-main.c index da77f157d..7edac0693 100644 --- a/platform/sky/contiki-sky-main.c +++ b/platform/sky/contiki-sky-main.c @@ -190,6 +190,10 @@ set_gateway(void) } #endif /* WITH_UIP */ /*---------------------------------------------------------------------------*/ +#if WITH_TINYOS_AUTO_IDS +uint16_t TOS_NODE_ID = 0x1234; /* non-zero */ +uint16_t TOS_LOCAL_ADDRESS = 0x1234; /* non-zero */ +#endif /* WITH_TINYOS_AUTO_IDS */ int main(int argc, char **argv) { @@ -225,8 +229,12 @@ main(int argc, char **argv) */ +#if WITH_TINYOS_AUTO_IDS + node_id = TOS_NODE_ID; +#else /* WITH_TINYOS_AUTO_IDS */ /* Restore node id if such has been stored in external mem */ node_id_restore(); +#endif /* WITH_TINYOS_AUTO_IDS */ /* for setting "hardcoded" IEEE 802.15.4 MAC addresses */ #ifdef IEEE_802154_MAC_ADDRESS