mirror of
https://github.com/espressif/openthread.git
synced 2026-09-17 22:50:07 +00:00
Move PSKc generation functionality to Commissioner role. (#1327)
This commit is contained in:
@@ -222,6 +222,25 @@ OTAPI ThreadError OTCALL otSendMgmtCommissionerSet(otInstance *, const otCommiss
|
||||
*/
|
||||
OTAPI uint16_t OTCALL otCommissionerGetSessionId(otInstance *);
|
||||
|
||||
/**
|
||||
* This method generates PSKc.
|
||||
*
|
||||
* PSKc is used to establish the Commissioner Session.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aPassPhrase The commissioning passphrase.
|
||||
* @param[in] aNetworkName The network name for PSKc computation.
|
||||
* @param[in] aExtPanId The extended pan id for PSKc computation.
|
||||
* @param[out] aPSKc A pointer to where the generated PSKc will be placed.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully generate PSKc.
|
||||
* @retval kThreadError_InvalidArgs If any of the input arguments is invalid.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otCommissionerGeneratePSKc(otInstance *aInstance, const char *aPassPhrase,
|
||||
const char *aNetworkName, const uint8_t *aExtPanId,
|
||||
uint8_t *aPSKc);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
|
||||
@@ -249,7 +249,6 @@ typedef struct otMeshLocalPrefix
|
||||
|
||||
#define OT_COMMISSIONING_PASSPHRASE_MIN_SIZE 6 ///< Minimum size of the Commissioning Passphrase
|
||||
#define OT_COMMISSIONING_PASSPHRASE_MAX_SIZE 255 ///< Maximum size of the Commissioning Passphrase
|
||||
#define OT_COMMISSIONING_PASSPHRASE_DEFAULT "OpenThreadPassphrase" ///< The default commissioning passphrase
|
||||
|
||||
/**
|
||||
* This structure represents PSKc.
|
||||
|
||||
@@ -639,24 +639,6 @@ OTAPI const uint8_t *OTCALL otGetMasterKey(otInstance *aInstance, uint8_t *aKeyL
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otSetMasterKey(otInstance *aInstance, const uint8_t *aKey, uint8_t aKeyLength);
|
||||
|
||||
/**
|
||||
* This method generates PSKc.
|
||||
*
|
||||
* PSKc is used to establish the Commissioner Session.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aPassPhrase The commissioning passphrase.
|
||||
* @param[in] aNetworkName The network name for PSKc computation.
|
||||
* @param[in] aExtPanId The extended pan id for PSKc computation.
|
||||
* @param[out] aPSKc A pointer to where the generated PSKc will be placed.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully generate PSKc.
|
||||
* @retval kThreadError_InvalidArgs If any of the input arguments is invalid.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otGeneratePSKc(otInstance *aInstance, const char *aPassPhrase, const char *aNetworkName,
|
||||
const uint8_t *aExtPanId, uint8_t *aPSKc);
|
||||
|
||||
/**
|
||||
* This function returns the maximum transmit power setting in dBm.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user