[joiner] adding otJoinerPskd and JoinerPskd types (#5137)

This commit is contained in:
Abtin Keshavarzian
2020-06-26 16:02:09 -07:00
committed by Jonathan Hui
parent 5210ca3eee
commit c7dc2be7d2
9 changed files with 200 additions and 69 deletions
+15 -6
View File
@@ -113,7 +113,16 @@ typedef struct otCommissioningDataset
bool mIsJoinerUdpPortSet : 1; ///< TRUE if Joiner UDP Port is set, FALSE otherwise.
} otCommissioningDataset;
#define OT_PSKD_MAX_SIZE 32 ///< Size of a Joiner PSKd (bytes)
#define OT_JOINER_MAX_PSKD_LENGTH 32 ///< Maximum string length of a Joiner PSKd (does not include null char).
/**
* This structure represent a Joiner PSKd.
*
*/
typedef struct otJoinerPskd
{
char m8[OT_JOINER_MAX_PSKD_LENGTH + 1]; ///< Char string array (must be null terminated - +1 is for null char).
} otJoinerPskd;
/**
* This enumeration defines a Joiner Info Typer.
@@ -135,11 +144,11 @@ typedef struct otJoinerInfo
otJoinerInfoType mType; ///< Joiner type.
union
{
otExtAddress mEui64; ///< Joiner EUI64 (when `mType` is `OT_JOINER_INFO_TYPE_EUI64`)
otJoinerDiscerner mDiscerner; ///< Joiner Discerner (when `mType` is `OT_JOINER_INFO_TYPE_DISCERNER`)
} mSharedId; ///< Shared fields
char mPsk[OT_PSKD_MAX_SIZE + 1]; ///< Joiner PSKd
uint32_t mExpirationTime; ///< Joiner expiration time in msec
otExtAddress mEui64; ///< Joiner EUI64 (when `mType` is `OT_JOINER_INFO_TYPE_EUI64`)
otJoinerDiscerner mDiscerner; ///< Joiner Discerner (when `mType` is `OT_JOINER_INFO_TYPE_DISCERNER`)
} mSharedId; ///< Shared fields
otJoinerPskd mPskd; ///< Joiner PSKd
uint32_t mExpirationTime; ///< Joiner expiration time in msec
} otJoinerInfo;
/**
+1 -1
View File
@@ -53,7 +53,7 @@ extern "C" {
* @note This number versions both OpenThread platform and user APIs.
*
*/
#define OPENTHREAD_API_VERSION (8)
#define OPENTHREAD_API_VERSION (9)
/**
* @addtogroup api-instance