TSCH: automatically leave the network when setting as coordinator/node

This commit is contained in:
Simon Duquennoy 2017-10-12 15:33:38 +02:00
parent 9cb34c85c0
commit d26e5fb489
1 changed files with 3 additions and 0 deletions

View File

@ -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);
}