From d26e5fb48946eb16cf463a02b762c04cf776c7e9 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Thu, 12 Oct 2017 15:33:38 +0200 Subject: [PATCH] TSCH: automatically leave the network when setting as coordinator/node --- os/net/mac/tsch/tsch.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/os/net/mac/tsch/tsch.c b/os/net/mac/tsch/tsch.c index ba57c981e..cedc9c316 100644 --- a/os/net/mac/tsch/tsch.c +++ b/os/net/mac/tsch/tsch.c @@ -185,6 +185,9 @@ static void packet_input(void); void tsch_set_coordinator(int enable) { + if(tsch_is_coordinator != enable) { + tsch_is_associated = 0; + } tsch_is_coordinator = enable; tsch_set_eb_period(TSCH_EB_PERIOD); }