Create a mechanism to modify the beacon version field. (#841)

* Create a mechanism to modify the beacon version field when the Join flag is set.
This commit is contained in:
pvanhorn
2016-10-18 18:36:58 -07:00
committed by Jonathan Hui
parent 81738bd8af
commit 05661bb26a
2 changed files with 20 additions and 1 deletions
+10 -1
View File
@@ -34,6 +34,8 @@
#ifndef MAC_FRAME_HPP_
#define MAC_FRAME_HPP_
#include <openthread-core-config.h>
#include <limits.h>
#include <stdint.h>
#include <string.h>
@@ -799,7 +801,14 @@ public:
* This method sets the Joining Permitted flag.
*
*/
void SetJoiningPermitted(void) { mFlags |= kJoiningFlag; }
void SetJoiningPermitted(void) {
mFlags |= kJoiningFlag;
#if OPENTHREAD_CONFIG_JOIN_BEACON_VERSION != kProtocolVersion
mFlags &= ~kVersionMask;
mFlags |= OPENTHREAD_CONFIG_JOIN_BEACON_VERSION << kVersionOffset;
#endif
}
/**
* This method returns a pointer to the Network Name field.
+10
View File
@@ -237,6 +237,16 @@
#define OPENTHREAD_CONFIG_COAP_MAX_RETRANSMIT 4
#endif // OPENTHREAD_CONFIG_COAP_MAX_RETRANSMIT
/**
* @def OPENTHREAD_CONFIG_JOIN_BEACON_VERSION
*
* The Beacon version to use when the beacon join flag is set.
*
*/
#ifndef OPENTHREAD_CONFIG_JOIN_BEACON_VERSION
#define OPENTHREAD_CONFIG_JOIN_BEACON_VERSION kProtocolVersion
#endif // OPENTHREAD_CONFIG_JOIN_BEACON_VERSION
/**
* @def OPENTHREAD_CONFIG_LOG_LEVEL
*