1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

ieee802154: add DSME configs

This commit is contained in:
Jose Alamos 2022-06-29 11:15:08 +02:00
parent 99b13cbb1b
commit efc0d3d3d9
No known key found for this signature in database
GPG Key ID: F483EB800EF89DD9
2 changed files with 172 additions and 2 deletions

View File

@ -327,6 +327,116 @@ extern const uint8_t ieee802154_addr_bcast[IEEE802154_ADDR_BCAST_LEN];
#define CONFIG_IEEE802154_DEFAULT_ACK_REQ 1
#endif
/**
* @brief Enable DSME CAP reduction
*
* @note For the moment, this is only valid for @ref pkg_opendsme
*/
#ifndef CONFIG_IEEE802154_DSME_CAP_REDUCTION
#define CONFIG_IEEE802154_DSME_CAP_REDUCTION 0
#endif
/**
* @brief Set the maximum DSME MAC response wait time
*
* This configuration sets the maximum wait times for MAC commands (association,
* DSME GTS allocation, etc).
* The unit is "base superframe duration" (60 * symbol_time_us).
*
* @note For the moment, this is only valid for @ref pkg_opendsme
*/
#ifndef CONFIG_IEEE802154_DSME_MAC_RESPONSE_WAIT_TIME
#define CONFIG_IEEE802154_DSME_MAC_RESPONSE_WAIT_TIME (244U)
#endif
/**
* @brief Set the scan duration
*
* Set the scan duration for each channel to `60 * symbol_time_us *
* (2^scanDuration + 1)`
*
* @note For the moment, this is only valid for @ref pkg_opendsme
*/
#ifndef CONFIG_IEEE802154_DSME_SCAN_DURATION
#define CONFIG_IEEE802154_DSME_SCAN_DURATION (4U)
#endif
/**
* @brief Set IEEE 802.15.4 DSME Superframe Order (SO)
* The SO sets the slot duration to `60 * symbol_time_us * 2^SO` usecs.
* E.g for O-QPSK an SO=3 renders a slot duration of `60 * 16 * 8` = 7.6 ms and
* a superframe duration of 122.88 ms.
*
* Settings this value to 3 allows to transmit full IEEE 802.15.4 O-QPSK frames
* (127 bytes).
*
* @note For the moment, this is only valid for @ref pkg_opendsme
*/
#ifndef CONFIG_IEEE802154_DSME_SUPERFRAME_ORDER
#define CONFIG_IEEE802154_DSME_SUPERFRAME_ORDER (3U)
#endif
/**
* @brief Set IEEE 802.15.4 DSME Multisuperframe Order (MO)
*
* The MO sets the number of superframes per multisuperframe to `2^(MO-SO)`.
*
* @see @ref CONFIG_IEEE802154_DSME_SUPERFRAME_ORDER
*
* @note For the moment, this is only valid for @ref pkg_opendsme
*/
#ifndef CONFIG_IEEE802154_DSME_MULTISUPERFRAME_ORDER
#define CONFIG_IEEE802154_DSME_MULTISUPERFRAME_ORDER (3U)
#endif
/**
* @brief Set IEEE 802.15.4 DSME Beacon Order (BO)
*
* The BO sets the beacon interval to `2^(BO-SO)` superframes.
*
* @see @ref CONFIG_IEEE802154_DSME_SUPERFRAME_ORDER
*
* @note For the moment, this is only valid for @ref pkg_opendsme
*/
#ifndef CONFIG_IEEE802154_DSME_BEACON_ORDER
#define CONFIG_IEEE802154_DSME_BEACON_ORDER (3U)
#endif
/**
* @brief Use static GTS allocation
*
* When set, the MAC implementation will not use scheduling functions.
* This requires that the upper layer allocates slots manually using @ref NETOPT_GTS_ALLOC.
*
* @see @ref CONFIG_IEEE802154_DSME_STATIC_GTS
*
* @note For the moment, this is only valid for @ref pkg_opendsme
*/
#ifdef DOXYGEN
#define CONFIG_IEEE802154_DSME_STATIC_GTS 0
#endif
/**
* @brief Set expiration time of DSME GTS slot
*
* Sets the expiration time of DSME GTS slot (in number of idle slots). If DSME
* detects no activity, it will deallocate the GTS slot.
*
* @note For the moment, this is only valid for @ref pkg_opendsme
*/
#ifndef CONFIG_IEEE802154_DSME_GTS_EXPIRATION
#define CONFIG_IEEE802154_DSME_GTS_EXPIRATION (16U)
#endif
/**
* @brief Set the minimum LQI to consider a beacon from a coordinator valid.
*
* @note For the moment, this is only valid for @ref pkg_opendsme
*/
#ifndef CONFIG_IEEE802154_DSME_MIN_COORD_LQI
#define CONFIG_IEEE802154_DSME_MIN_COORD_LQI (100U)
#endif
/**
* @brief Initializes an IEEE 802.15.4 MAC frame header in @p buf.
*

View File

@ -109,8 +109,68 @@ if KCONFIG_USEMODULE_IEEE802154
default 4
config IEEE802154_AUTO_ACK_DISABLE
bool "Disable Auto ACK support" if !USEPKG_OPENWSN
default y if USEPKG_OPENWSN
bool "Disable Auto ACK support" if (!USEPKG_OPENWSN && !USEPKG_OPENDSME)
default y if (USEPKG_OPENWSN || USEPKG_OPENDSME)
config IEEE802154_DSME_CAP_REDUCTION
bool "Enable CAP reduction" if USEPKG_OPENDSME
default n if USEPKG_OPENDSME
config IEEE802154_DSME_SUPERFRAME_ORDER
int "Set the DSME superframe order" if USEPKG_OPENDSME
default 3
help
The SO sets the slot duration to `60 * symbol_time_us * 2^SO` usecs.
E.g for O-QPSK an SO=3 renders a slot duration of `60 * 16 * 8` = 7.6 ms and
a superframe duration of 122.88 ms.
Settings this value to 3 allows to transmit full IEEE 802.15.4 O-QPSK frames
(127 bytes).
config IEEE802154_DSME_MULTISUPERFRAME_ORDER
int "Set the DSME multisuperframe order" if USEPKG_OPENDSME
default 3
help
The MO sets the number of superframes per multisuperframe to `2^(MO-SO)`.
config IEEE802154_DSME_BEACON_ORDER
int "Set the DSME beacon order" if USEPKG_OPENDSME
default 3
help
The BO sets the beacon interval to `2^(BO-SO)` superframes.
config IEEE802154_DSME_STATIC_GTS
bool "Use static GTS allocation" if USEPKG_OPENDSME
default 0
help
When set, the MAC implementation will not use scheduling functions.
This requires that the upper layer allocates slots manually using NETOPT_GTS_ALLOC.
config IEEE802154_DSME_GTS_EXPIRATION
int "Set expiration time of DSME GTS slot" if USEPKG_OPENDSME
default 16
help
Sets the expiration time of DSME GTS slot (in number of idle slots). If DSME
detects no activity, it will deallocate the GTS slot.
config IEEE802154_DSME_MAC_RESPONSE_WAIT_TIME
int "Set expiration time of DSME GTS slot" if USEPKG_OPENDSME
default 244
help
This configuration sets the maximum wait times for MAC commands (association,
DSME GTS allocation, etc).
The unit is "base superframe duration" (60 * symbol_time_us).
config IEEE802154_DSME_SCAN_DURATION
int "Set the scan duration" if USEPKG_OPENDSME
default 4
help
Set the scan duration for each channel to `60 * symbol_time_us *
(2^scanDuration + 1)`
config IEEE802154_DSME_MIN_COORD_LQI
int "Set the minimum LQI to consider a beacon from a coordinator valid" if USEPKG_OPENDSME
default 100
config IEEE802154_DEFAULT_ACK_REQ
bool "Request ACKs by default"