Skip to content

Commit

Permalink
Merge pull request #7481 from gebart/pr/netopt-csma-be
Browse files Browse the repository at this point in the history
netopt: add NETOPT_CSMA_MINBE, NETOPT_CSMA_MAXBE
  • Loading branch information
miri64 committed Aug 17, 2017
2 parents b5984d2 + 83ab722 commit 9ea1c6e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
37 changes: 33 additions & 4 deletions sys/include/net/netopt.h
Expand Up @@ -148,7 +148,7 @@ typedef enum {
* option will enable CSMA with a certain set of parameters to emulate the
* desired behaviour.
*
* @note Be sure not to set NETCONF_OPT_CSMA simultaneously.
* @note Be sure not to set NETOPT_CSMA simultaneously.
*
* TODO: How to get feedback?
*/
Expand All @@ -159,11 +159,40 @@ typedef enum {
*
* If the device supports CSMA in hardware, this option enables it with
* default parameters. For further configuration refer to the other
* NETCONF_OPT_CSMA_* options.
* NETOPT_CSMA_* options.
*/
NETOPT_CSMA,
NETOPT_CSMA_RETRIES, /**< get/set the number of retries when
when channel is busy */

/**
* @brief get/set the maximum number of CSMA retries
*
* (uint8_t)
* The maximum number of backoffs the CSMA-CA algorithm will attempt before
* declaring a channel access failure. Named macMaxCsmaBackoffs in
* IEEE Std 802.15.4-2015.
*
* 802.15.4 default: 4
*/
NETOPT_CSMA_RETRIES,

/**
* @brief get/set the maximum backoff exponent for the CSMA-CA algorithm
*
* (uint8_t) Named macMaxBE in IEEE Std 802.15.4-2015.
*
* 802.15.4 default: 5
*/
NETOPT_CSMA_MAXBE,

/**
* @brief get/set the minimum backoff exponent for the CSMA-CA algorithm
*
* (uint8_t) Named macMinBE in IEEE Std 802.15.4-2015.
*
* 802.15.4 default: 3
*/
NETOPT_CSMA_MINBE,

/**
* @brief read-only check for a wired interface.
*
Expand Down
2 changes: 2 additions & 0 deletions sys/net/crosslayer/netopt/netopt.c
Expand Up @@ -49,6 +49,8 @@ static const char *_netopt_strmap[] = {
[NETOPT_AUTOCCA] = "NETOPT_AUTOCCA",
[NETOPT_CSMA] = "NETOPT_CSMA",
[NETOPT_CSMA_RETRIES] = "NETOPT_CSMA_RETRIES",
[NETOPT_CSMA_MAXBE] = "NETOPT_CSMA_MAXBE",
[NETOPT_CSMA_MINBE] = "NETOPT_CSMA_MINBE",
[NETOPT_IS_WIRED] = "NETOPT_IS_WIRED",
[NETOPT_DEVICE_TYPE] = "NETOPT_DEVICE_TYPE",
[NETOPT_CHANNEL_PAGE] = "NETOPT_CHANNEL_PAGE",
Expand Down

0 comments on commit 9ea1c6e

Please sign in to comment.