Add CLI for sending MGMT_ACTIVE_GET/SET, MGMT_PENDING_GET/SET (Reopen #402) (#474)

* Add CLI for sending MGMT_ACTIVE_GET, MGMT_ACTIVE_SET, MGMT_PENDING_GET and MGMT_PENDING_SET
This commit is contained in:
Lu Wang
2016-08-30 10:48:52 -07:00
committed by Jonathan Hui
parent 8858313feb
commit f4ea00c5f3
10 changed files with 769 additions and 20 deletions
+24
View File
@@ -321,6 +321,30 @@ typedef struct otOperationalDataset
bool mIsChannelSet : 1; ///< TRUE if Channel is set, FALSE otherwise.
} otOperationalDataset;
/**
* This enumeration represents meshcop TLV types.
*
*/
typedef enum otMeshcopTlvType
{
OT_MESHCOP_TLV_CHANNEL = 0, ///< meshcop Channel TLV
OT_MESHCOP_TLV_PANID = 1, ///< meshcop Pan Id TLV
OT_MESHCOP_TLV_EXTPANID = 2, ///< meshcop Extended Pan Id TLV
OT_MESHCOP_TLV_NETWORKNAME = 3, ///< meshcop Network Name TLV
OT_MESHCOP_TLV_PSKC = 4, ///< meshcop PSKc TLV
OT_MESHCOP_TLV_MASTERKEY = 5, ///< meshcop Network Master Key TLV
OT_MESHCOP_TLV_LOCALPREFIX = 7, ///< meshcop Mesh Local Prefix TLV
OT_MESHCOP_TLV_SECURITYPOLICY = 12, ///< meshcop Security Policy TLV
OT_MESHCOP_TLV_GET = 13, ///< meshcop Get TLV
OT_MESHCOP_TLV_ACTIVETIMESTAMP = 14, ///< meshcop Active Timestamp TLV
OT_MESHCOP_TLV_STATE = 16, ///< meshcop State TLV
OT_MESHCOP_TLV_PENDINGTIMESTAMP = 51, ///< meshcop Pending Timestamp TLV
OT_MESHCOP_TLV_DELAYTIMER = 52, ///< meshcop Delay Timer TLV
OT_MESHCOP_TLV_CHANNELMASK = 53, ///< meshcop Channel Mask TLV
OT_MESHCOP_TLV_DISCOVERYREQUEST = 128, ///< meshcop Discovery Request TLV
OT_MESHCOP_TLV_DISCOVERYRESPONSE = 129, ///< meshcop Discovery Response TLV
} otMeshcopTlvType;
/**
* This structure represents an MLE Link Mode configuration.
*/
+50
View File
@@ -735,6 +735,56 @@ ThreadError otGetPendingDataset(otOperationalDataset *aDataset);
*/
ThreadError otSetPendingDataset(otOperationalDataset *aDataset);
/**
* This function sends MGMT_ACTIVE_GET.
*
* @param[in] aTlvTypes A pointer to the TLV Types.
* @param[in] aLength The length of TLV Types.
*
* @retval kThreadError_None Successfully send the meshcop dataset command.
* @retval kThreadError_NoBufs Insufficient buffer space to send.
*
*/
ThreadError otSendActiveGet(const uint8_t *aTlvTypes, uint8_t aLength);
/**
* This function sends MGMT_ACTIVE_SET.
*
* @param[in] aDataset A pointer to operational dataset.
* @param[in] aTlvs A pointer to TLVs.
* @param[in] aLength The length of TLVs.
*
* @retval kThreadError_None Successfully send the meshcop dataset command.
* @retval kThreadError_NoBufs Insufficient buffer space to send.
*
*/
ThreadError otSendActiveSet(const otOperationalDataset *aDataset, const uint8_t *aTlvs, uint8_t aLength);
/**
* This function sends MGMT_PENDING_GET.
*
* @param[in] aTlvTypes A pointer to the TLV Types.
* @param[in] aLength The length of TLV Types.
*
* @retval kThreadError_None Successfully send the meshcop dataset command.
* @retval kThreadError_NoBufs Insufficient buffer space to send.
*
*/
ThreadError otSendPendingGet(const uint8_t *aTlvTypes, uint8_t aLength);
/**
* This function sends MGMT_PENDING_SET.
*
* @param[in] aDataset A pointer to operational dataset.
* @param[in] aTlvs A pointer to TLVs.
* @param[in] aLength The length of TLVs.
*
* @retval kThreadError_None Successfully send the meshcop dataset command.
* @retval kThreadError_NoBufs Insufficient buffer space to send.
*
*/
ThreadError otSendPendingSet(const otOperationalDataset *aDataset, const uint8_t *aTlvs, uint8_t aLength);
/**
* Get the data poll period of sleepy end deivce.
*