Add Channel Mask TLV CLI support (#549)

- Add a new Dataset::Set method to support variable TLV data payload. This is mainly for Channel Mask TLV
- Add CLI to support Channel Mask TLV
This commit is contained in:
Lu Wang
2016-09-13 20:55:11 -07:00
committed by Jonathan Hui
parent 84079beb3a
commit fb823f4f72
4 changed files with 100 additions and 22 deletions
+30 -22
View File
@@ -215,6 +215,12 @@ enum
OT_SECURITY_POLICY_BEACONS = 1 << 3, ///< Beacons enabled
};
/**
* This type represents Channel Mask Page 0.
*
*/
typedef uint32_t otChannelMaskPage0;
/**
* This type represents the IEEE 802.15.4 PAN ID.
*
@@ -340,29 +346,31 @@ typedef struct otEnergyScanResult
*/
typedef struct otOperationalDataset
{
uint64_t mActiveTimestamp; ///< Active Timestamp
uint64_t mPendingTimestamp; ///< Pending Timestamp
otMasterKey mMasterKey; ///< Network Master Key
otNetworkName mNetworkName; ///< Network Name
otExtendedPanId mExtendedPanId; ///< Extended PAN ID
otMeshLocalPrefix mMeshLocalPrefix; ///< Mesh Local Prefix
uint32_t mDelay; ///< Delay Timer
otPanId mPanId; ///< PAN ID
uint16_t mChannel; ///< Channel
otPSKc mPSKc; ///< PSKc
otSecurityPolicy mSecurityPolicy; ///< Security Policy
uint64_t mActiveTimestamp; ///< Active Timestamp
uint64_t mPendingTimestamp; ///< Pending Timestamp
otMasterKey mMasterKey; ///< Network Master Key
otNetworkName mNetworkName; ///< Network Name
otExtendedPanId mExtendedPanId; ///< Extended PAN ID
otMeshLocalPrefix mMeshLocalPrefix; ///< Mesh Local Prefix
uint32_t mDelay; ///< Delay Timer
otPanId mPanId; ///< PAN ID
uint16_t mChannel; ///< Channel
otPSKc mPSKc; ///< PSKc
otSecurityPolicy mSecurityPolicy; ///< Security Policy
otChannelMaskPage0 mChannelMaskPage0; ///< Channel Mask Page 0
bool mIsActiveTimestampSet : 1; ///< TRUE if Active Timestamp is set, FALSE otherwise.
bool mIsPendingTimestampSet : 1; ///< TRUE if Pending Timestamp is set, FALSE otherwise.
bool mIsMasterKeySet : 1; ///< TRUE if Network Master Key is set, FALSE otherwise.
bool mIsNetworkNameSet : 1; ///< TRUE if Network Name is set, FALSE otherwise.
bool mIsExtendedPanIdSet : 1; ///< TRUE if Extended PAN ID is set, FALSE otherwise.
bool mIsMeshLocalPrefixSet : 1; ///< TRUE if Mesh Local Prefix is set, FALSE otherwise.
bool mIsDelaySet : 1; ///< TRUE if Delay Timer is set, FALSE otherwise.
bool mIsPanIdSet : 1; ///< TRUE if PAN ID is set, FALSE otherwise.
bool mIsChannelSet : 1; ///< TRUE if Channel is set, FALSE otherwise.
bool mIsPSKcSet : 1; ///< TRUE if PSKc is set, FALSE otherwise.
bool mIsSecurityPolicySet : 1; ///< TRUE if Security Policy is set, FALSE otherwise.
bool mIsActiveTimestampSet : 1; ///< TRUE if Active Timestamp is set, FALSE otherwise.
bool mIsPendingTimestampSet : 1; ///< TRUE if Pending Timestamp is set, FALSE otherwise.
bool mIsMasterKeySet : 1; ///< TRUE if Network Master Key is set, FALSE otherwise.
bool mIsNetworkNameSet : 1; ///< TRUE if Network Name is set, FALSE otherwise.
bool mIsExtendedPanIdSet : 1; ///< TRUE if Extended PAN ID is set, FALSE otherwise.
bool mIsMeshLocalPrefixSet : 1; ///< TRUE if Mesh Local Prefix is set, FALSE otherwise.
bool mIsDelaySet : 1; ///< TRUE if Delay Timer is set, FALSE otherwise.
bool mIsPanIdSet : 1; ///< TRUE if PAN ID is set, FALSE otherwise.
bool mIsChannelSet : 1; ///< TRUE if Channel is set, FALSE otherwise.
bool mIsPSKcSet : 1; ///< TRUE if PSKc is set, FALSE otherwise.
bool mIsSecurityPolicySet : 1; ///< TRUE if Security Policy is set, FALSE otherwise.
bool mIsChannelMaskPage0Set : 1; ///< TRUE if Channel Mask Page 0 is set, FALSE otherwise.
} otOperationalDataset;
/**