Commissioner#
This module includes functions for the Thread Commissioner role.
Modules#
Enumerations#
Defines the Commissioner State.
Defines a Joiner Event on the Commissioner.
Defines a Joiner Info Type.
Typedefs#
Defines the Commissioner State.
Defines a Joiner Event on the Commissioner.
Represents the steering data.
Represents a Commissioning Dataset.
Represents a Joiner PSKd.
Defines a Joiner Info Type.
Represents a Joiner Info.
Pointer is called whenever the commissioner state changes.
Pointer is called whenever the joiner state changes.
Pointer is called when the Commissioner receives an Energy Report.
Pointer is called when the Commissioner receives a PAN ID Conflict message.
Functions#
Enables the Thread Commissioner role.
Disables the Thread Commissioner role.
Returns the Commissioner Id.
Sets the Commissioner Id.
Adds a Joiner entry.
Adds a Joiner entry with a given Joiner Discerner value.
Get joiner info at aIterator position.
Removes a Joiner entry.
Removes a Joiner entry.
Gets the Provisioning URL.
Sets the Provisioning URL.
Sends an Announce Begin message.
Sends an Energy Scan Query message.
Sends a PAN ID Query message.
Sends MGMT_COMMISSIONER_GET.
Sends MGMT_COMMISSIONER_SET.
Returns the Commissioner Session ID.
Returns the Commissioner State.
Macros#
Minimum size of the Commissioning Passphrase.
Maximum size of the Commissioning Passphrase.
Max size (number of chars) in Provisioning URL string (excludes null char).
Max steering data length (bytes)
Maximum string length of a Joiner PSKd (does not include null char).
Enumeration Documentation#
otCommissionerState#
otCommissionerState
Defines the Commissioner State.
Enumerator | |
---|---|
OT_COMMISSIONER_STATE_DISABLED | Commissioner role is disabled. |
OT_COMMISSIONER_STATE_PETITION | Currently petitioning to become a Commissioner. |
OT_COMMISSIONER_STATE_ACTIVE | Commissioner role is active. |
otCommissionerJoinerEvent#
otCommissionerJoinerEvent
Defines a Joiner Event on the Commissioner.
Enumerator | |
---|---|
OT_COMMISSIONER_JOINER_START | |
OT_COMMISSIONER_JOINER_CONNECTED | |
OT_COMMISSIONER_JOINER_FINALIZE | |
OT_COMMISSIONER_JOINER_END | |
OT_COMMISSIONER_JOINER_REMOVED |
otJoinerInfoType#
otJoinerInfoType
Defines a Joiner Info Type.
Enumerator | |
---|---|
OT_JOINER_INFO_TYPE_ANY | Accept any Joiner (no EUI64 or Discerner is specified). |
OT_JOINER_INFO_TYPE_EUI64 | Joiner EUI-64 is specified ( |
OT_JOINER_INFO_TYPE_DISCERNER | Joiner Discerner is specified ( |
Typedef Documentation#
otCommissionerState#
typedef enum otCommissionerState otCommissionerState
Defines the Commissioner State.
otCommissionerJoinerEvent#
typedef enum otCommissionerJoinerEvent otCommissionerJoinerEvent
Defines a Joiner Event on the Commissioner.
otCommissioningDataset#
typedef struct otCommissioningDataset otCommissioningDataset
Represents a Commissioning Dataset.
otCommissionerStateCallback#
typedef void(* otCommissionerStateCallback) (otCommissionerState aState, void *aContext) )(otCommissionerState aState, void *aContext)
Pointer is called whenever the commissioner state changes.
Type | Direction | Argument Name | Description |
---|---|---|---|
[in] | aState | The Commissioner state. | |
[in] | aContext | A pointer to application-specific context. |
otCommissionerJoinerCallback#
typedef void(* otCommissionerJoinerCallback) (otCommissionerJoinerEvent aEvent, const otJoinerInfo *aJoinerInfo, const otExtAddress *aJoinerId, void *aContext) )(otCommissionerJoinerEvent aEvent, const otJoinerInfo *aJoinerInfo, const otExtAddress *aJoinerId, void *aContext)
Pointer is called whenever the joiner state changes.
Type | Direction | Argument Name | Description |
---|---|---|---|
[in] | aEvent | The joiner event type. | |
[in] | aJoinerInfo | A pointer to the Joiner Info. | |
[in] | aJoinerId | A pointer to the Joiner ID (if not known, it will be NULL). | |
[in] | aContext | A pointer to application-specific context. |
otCommissionerEnergyReportCallback#
typedef void(* otCommissionerEnergyReportCallback) (uint32_t aChannelMask, const uint8_t *aEnergyList, uint8_t aEnergyListLength, void *aContext) )(uint32_t aChannelMask, const uint8_t *aEnergyList, uint8_t aEnergyListLength, void *aContext)
Pointer is called when the Commissioner receives an Energy Report.
Type | Direction | Argument Name | Description |
---|---|---|---|
[in] | aChannelMask | The channel mask value. | |
[in] | aEnergyList | A pointer to the energy measurement list. | |
[in] | aEnergyListLength | Number of entries in | |
[in] | aContext | A pointer to application-specific context. |
otCommissionerPanIdConflictCallback#
typedef void(* otCommissionerPanIdConflictCallback) (uint16_t aPanId, uint32_t aChannelMask, void *aContext) )(uint16_t aPanId, uint32_t aChannelMask, void *aContext)
Pointer is called when the Commissioner receives a PAN ID Conflict message.
Type | Direction | Argument Name | Description |
---|---|---|---|
[in] | aPanId | The PAN ID value. | |
[in] | aChannelMask | The channel mask value. | |
[in] | aContext | A pointer to application-specific context. |
Function Documentation#
otCommissionerStart#
otError otCommissionerStart (otInstance * aInstance, otCommissionerStateCallback aStateCallback, otCommissionerJoinerCallback aJoinerCallback, void * aCallbackContext)
Enables the Thread Commissioner role.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
otCommissionerStateCallback | [in] | aStateCallback | A pointer to a function that is called when the commissioner state changes. |
otCommissionerJoinerCallback | [in] | aJoinerCallback | A pointer to a function that is called with a joiner event occurs. |
void * | [in] | aCallbackContext | A pointer to application-specific context. |
otCommissionerStop#
otError otCommissionerStop (otInstance * aInstance)
Disables the Thread Commissioner role.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
otCommissionerGetId#
const char * otCommissionerGetId (otInstance * aInstance)
Returns the Commissioner Id.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Returns
The Commissioner Id.
otCommissionerSetId#
otError otCommissionerSetId (otInstance * aInstance, const char * aId)
Sets the Commissioner Id.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const char * | [in] | aId | A pointer to a string character array. Must be null terminated. |
otCommissionerAddJoiner#
otError otCommissionerAddJoiner (otInstance * aInstance, const otExtAddress * aEui64, const char * aPskd, uint32_t aTimeout)
Adds a Joiner entry.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const otExtAddress * | [in] | aEui64 | A pointer to the Joiner's IEEE EUI-64 or NULL for any Joiner. |
const char * | [in] | aPskd | A pointer to the PSKd. |
uint32_t | [in] | aTimeout | A time after which a Joiner is automatically removed, in seconds. |
Note
Only use this after successfully starting the Commissioner role with otCommissionerStart().
otCommissionerAddJoinerWithDiscerner#
otError otCommissionerAddJoinerWithDiscerner (otInstance * aInstance, const otJoinerDiscerner * aDiscerner, const char * aPskd, uint32_t aTimeout)
Adds a Joiner entry with a given Joiner Discerner value.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const otJoinerDiscerner * | [in] | aDiscerner | A pointer to the Joiner Discerner. |
const char * | [in] | aPskd | A pointer to the PSKd. |
uint32_t | [in] | aTimeout | A time after which a Joiner is automatically removed, in seconds. |
Note
Only use this after successfully starting the Commissioner role with otCommissionerStart().
otCommissionerGetNextJoinerInfo#
otError otCommissionerGetNextJoinerInfo (otInstance * aInstance, uint16_t * aIterator, otJoinerInfo * aJoiner)
Get joiner info at aIterator position.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to instance. |
uint16_t * | [inout] | aIterator | A pointer to the Joiner Info iterator context. |
otJoinerInfo * | [out] | aJoiner | A reference to Joiner info. |
otCommissionerRemoveJoiner#
otError otCommissionerRemoveJoiner (otInstance * aInstance, const otExtAddress * aEui64)
Removes a Joiner entry.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const otExtAddress * | [in] | aEui64 | A pointer to the Joiner's IEEE EUI-64 or NULL for any Joiner. |
Note
Only use this after successfully starting the Commissioner role with otCommissionerStart().
otCommissionerRemoveJoinerWithDiscerner#
otError otCommissionerRemoveJoinerWithDiscerner (otInstance * aInstance, const otJoinerDiscerner * aDiscerner)
Removes a Joiner entry.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const otJoinerDiscerner * | [in] | aDiscerner | A pointer to the Joiner Discerner. |
Note
Only use this after successfully starting the Commissioner role with otCommissionerStart().
otCommissionerGetProvisioningUrl#
const char * otCommissionerGetProvisioningUrl (otInstance * aInstance)
Gets the Provisioning URL.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Returns
A pointer to the URL string.
otCommissionerSetProvisioningUrl#
otError otCommissionerSetProvisioningUrl (otInstance * aInstance, const char * aProvisioningUrl)
Sets the Provisioning URL.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const char * | [in] | aProvisioningUrl | A pointer to the Provisioning URL (may be NULL to set as empty string). |
otCommissionerAnnounceBegin#
otError otCommissionerAnnounceBegin (otInstance * aInstance, uint32_t aChannelMask, uint8_t aCount, uint16_t aPeriod, const otIp6Address * aAddress)
Sends an Announce Begin message.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint32_t | [in] | aChannelMask | The channel mask value. |
uint8_t | [in] | aCount | The number of Announcement messages per channel. |
uint16_t | [in] | aPeriod | The time between two successive MLE Announce transmissions (in milliseconds). |
const otIp6Address * | [in] | aAddress | A pointer to the IPv6 destination. |
Note
Only use this after successfully starting the Commissioner role with otCommissionerStart().
otCommissionerEnergyScan#
otError otCommissionerEnergyScan (otInstance * aInstance, uint32_t aChannelMask, uint8_t aCount, uint16_t aPeriod, uint16_t aScanDuration, const otIp6Address * aAddress, otCommissionerEnergyReportCallback aCallback, void * aContext)
Sends an Energy Scan Query message.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint32_t | [in] | aChannelMask | The channel mask value. |
uint8_t | [in] | aCount | The number of energy measurements per channel. |
uint16_t | [in] | aPeriod | The time between energy measurements (milliseconds). |
uint16_t | [in] | aScanDuration | The scan duration for each energy measurement (milliseconds). |
const otIp6Address * | [in] | aAddress | A pointer to the IPv6 destination. |
otCommissionerEnergyReportCallback | [in] | aCallback | A pointer to a function called on receiving an Energy Report message. |
void * | [in] | aContext | A pointer to application-specific context. |
Note
Only use this after successfully starting the Commissioner role with otCommissionerStart().
otCommissionerPanIdQuery#
otError otCommissionerPanIdQuery (otInstance * aInstance, uint16_t aPanId, uint32_t aChannelMask, const otIp6Address * aAddress, otCommissionerPanIdConflictCallback aCallback, void * aContext)
Sends a PAN ID Query message.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint16_t | [in] | aPanId | The PAN ID to query. |
uint32_t | [in] | aChannelMask | The channel mask value. |
const otIp6Address * | [in] | aAddress | A pointer to the IPv6 destination. |
otCommissionerPanIdConflictCallback | [in] | aCallback | A pointer to a function called on receiving a PAN ID Conflict message. |
void * | [in] | aContext | A pointer to application-specific context. |
Note
Only use this after successfully starting the Commissioner role with otCommissionerStart().
otCommissionerSendMgmtGet#
otError otCommissionerSendMgmtGet (otInstance * aInstance, const uint8_t * aTlvs, uint8_t aLength)
Sends MGMT_COMMISSIONER_GET.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const uint8_t * | [in] | aTlvs | A pointer to TLVs. |
uint8_t | [in] | aLength | The length of TLVs. |
otCommissionerSendMgmtSet#
otError otCommissionerSendMgmtSet (otInstance * aInstance, const otCommissioningDataset * aDataset, const uint8_t * aTlvs, uint8_t aLength)
Sends MGMT_COMMISSIONER_SET.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const otCommissioningDataset * | [in] | aDataset | A pointer to commissioning dataset. |
const uint8_t * | [in] | aTlvs | A pointer to TLVs. |
uint8_t | [in] | aLength | The length of TLVs. |
otCommissionerGetSessionId#
uint16_t otCommissionerGetSessionId (otInstance * aInstance)
Returns the Commissioner Session ID.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Returns
The current commissioner session id.
otCommissionerGetState#
otCommissionerState otCommissionerGetState (otInstance * aInstance)
Returns the Commissioner State.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |