mirror of
https://github.com/espressif/openthread.git
synced 2026-08-19 00:49:53 +00:00
Add support for MGMT_COMMISSIONER_GET and MGMT_COMMISSIONER_SET (#634)
* - Add support for MGMT_COMMISSIONER_GET and MGMT_COMMISSIONER_SET - Add CLI for sending this two commands * - Move MGMT_COMMISSIONER_GET and MGMT_COMMISSIONER_SET to MeshCoP::commissioner
This commit is contained in:
@@ -127,6 +127,34 @@ ThreadError otCommissionerPanIdQuery(otInstance *aInstance, uint16_t aPanId, uin
|
||||
const otIp6Address *aAddress,
|
||||
otCommissionerPanIdConflictCallback aCallback, void *aContext);
|
||||
|
||||
/**
|
||||
* This function sends MGMT_COMMISSIONER_GET.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @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 otSendMgmtCommissionerGet(otInstance *, const uint8_t *aTlvs, uint8_t aLength);
|
||||
|
||||
/**
|
||||
* This function sends MGMT_COMMISSIONER_SET.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aDataset A pointer to commissioning 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 otSendMgmtCommissionerSet(otInstance *, const otCommissioningDataset *aDataset,
|
||||
const uint8_t *aTlvs, uint8_t aLength);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
|
||||
@@ -376,6 +376,35 @@ typedef struct otOperationalDataset
|
||||
bool mIsChannelMaskPage0Set : 1; ///< TRUE if Channel Mask Page 0 is set, FALSE otherwise.
|
||||
} otOperationalDataset;
|
||||
|
||||
#define OT_STEERING_DATA_MAX_LENGTH 16 ///< Max steering data length (bytes)
|
||||
|
||||
/**
|
||||
* This structure represents the steering data.
|
||||
*
|
||||
*/
|
||||
typedef struct otSteeringData
|
||||
{
|
||||
uint8_t mLength;
|
||||
uint8_t m8[OT_STEERING_DATA_MAX_LENGTH];
|
||||
} otSteeringData;
|
||||
|
||||
/**
|
||||
* This structure represents a Commissioning Dataset.
|
||||
*
|
||||
*/
|
||||
typedef struct otCommissioningDataset
|
||||
{
|
||||
uint16_t mLocator; ///< Border Router RLOC16
|
||||
uint16_t mSessionId; ///< Commissioner Session Id
|
||||
otSteeringData mSteeringData; ///< Steering Data
|
||||
uint16_t mJoinerUdpPort; ///< Joiner UDP Port
|
||||
|
||||
bool mIsLocatorSet : 1; ///< TRUE if Border Router RLOC16 is set, FALSE otherwise.
|
||||
bool mIsSessionIdSet: 1; ///< TRUE if Commissioner Session Id is set, FALSE otherwise.
|
||||
bool mIsSteeringDataSet : 1; ///< TRUE if Steering Data is set, FALSE otherwise.
|
||||
bool mIsJoinerUdpPortSet : 1; ///< TRUE if Joiner UDP Port is set, FALSE otherwise.
|
||||
} otCommissioningDataset;
|
||||
|
||||
/**
|
||||
* This enumeration represents meshcop TLV types.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user