From bfb4f9537bd4a25087cdde08c2cc4ec0e619ec48 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Tue, 27 Feb 2018 08:20:46 -0800 Subject: [PATCH] 6p-packet example: use MAC address instead of node_id to hardcode coordinator --- examples/6tisch/6p-packet/sixp-node.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/6tisch/6p-packet/sixp-node.c b/examples/6tisch/6p-packet/sixp-node.c index d911701bc..43cabbe29 100644 --- a/examples/6tisch/6p-packet/sixp-node.c +++ b/examples/6tisch/6p-packet/sixp-node.c @@ -30,11 +30,13 @@ #include #include -#include #include #include #include +/* Hard-coded MAC address of the TSCH coordinator */ +static linkaddr_t coordinator_addr = {{ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}; + extern const sixtop_sf_t test_sf; extern int test_sf_start(const linkaddr_t *addr); @@ -49,7 +51,7 @@ PROCESS_THREAD(sixp_node_process, ev, data) sixtop_add_sf(&test_sf); - if(node_id == COORDINATOR_NODE_ID) { + if(linkaddr_cmp(&coordinator_addr, &linkaddr_node_addr)) { tsch_set_coordinator(1); assert(test_sf_start(NULL) == 0); } else {