Added flag for 802.15.4 default channel

This commit is contained in:
Simon Duquennoy 2018-04-13 02:26:48 -07:00
parent 02aebac0d7
commit 15a06b85bc
3 changed files with 21 additions and 3 deletions

View File

@ -41,6 +41,16 @@
#define IEEE802154_CONF_PANID 0xabcd
#endif /* IEEE802154_CONF_PANID */
/* IEEE802154_CONF_DEFAULT_CHANNEL defines the default channel for IEEE 802.15.4
* networks, for MAC layers without a channel selection or channel hopping
* mechanism. Current 802.15.4 MAC layers:
* - CSMA: uses IEEE802154_CONF_DEFAULT_CHANNEL
* - TSCH: uses its own TSCH_DEFAULT_HOPPING_SEQUENCE instead
*/
#ifndef IEEE802154_CONF_DEFAULT_CHANNEL
#define IEEE802154_CONF_DEFAULT_CHANNEL 26
#endif /* IEEE802154_CONF_DEF_CHANNEL */
/* QUEUEBUF_CONF_NUM specifies the number of queue buffers. Queue
buffers are used throughout the Contiki netstack but the
configuration option can be tweaked to save memory. Performance can

View File

@ -43,6 +43,14 @@
#include "contiki.h"
#include "dev/radio.h"
/**
*\brief The default channel for IEEE 802.15.4 networks.
*/
#ifdef IEEE802154_CONF_DEFAULT_CHANNEL
#define IEEE802154_DEFAULT_CHANNEL IEEE802154_CONF_DEFAULT_CHANNEL
#else /* IEEE802154_CONF_DEFAULT_CHANNEL */
#define IEEE802154_DEFAULT_CHANNEL 26
#endif /* IEEE802154_CONF_DEFAULT_CHANNEL */
typedef void (* mac_callback_t)(void *ptr, int status, int transmissions);

View File

@ -68,10 +68,10 @@
#else /* MAC_CONF_WITH_TSCH */
#ifdef RF_CHANNEL
##### "RF_CHANNEL": ____________________________ == RF_CHANNEL
#ifdef IEEE802154_CONF_DEFAULT_CHANNEL
##### "IEEE802154_CONF_DEFAULT_CHANNEL": _______ == IEEE802154_CONF_DEFAULT_CHANNEL
#else
##### "RF_CHANNEL": ____________________________ ><
##### "IEEE802154_CONF_DEFAULT_CHANNEL": _______ -> IEEE802154_DEFAULT_CHANNEL
#endif
#endif /*MAC_CONF_WITH_TSCH */