From 7c5977d9f717f402dfb44bb8dfb6d9e2c35e35d7 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Thu, 4 Oct 2018 10:43:41 +0200 Subject: [PATCH] tsch_init: check that a timeslot timing template is provided --- os/net/mac/tsch/tsch.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/os/net/mac/tsch/tsch.c b/os/net/mac/tsch/tsch.c index 7dbb0a7ce..e78b888d0 100644 --- a/os/net/mac/tsch/tsch.c +++ b/os/net/mac/tsch/tsch.c @@ -899,6 +899,12 @@ tsch_init(void) radio_value_t radio_tx_mode; rtimer_clock_t t; + /* Check that the platform provides a TSCH timeslot timing template */ + if(TSCH_DEFAULT_TIMESLOT_TIMING == NULL) { + LOG_ERR("! platform does not provide a timeslot timing template.\n"); + return; + } + /* Radio Rx mode */ if(NETSTACK_RADIO.get_value(RADIO_PARAM_RX_MODE, &radio_rx_mode) != RADIO_RESULT_OK) { LOG_ERR("! radio does not support getting RADIO_PARAM_RX_MODE. Abort init.\n");