Commissioner#

This module includes functions for the Thread Commissioner role.

Modules#

otSteeringData

otCommissioningDataset

otJoinerPskd

otJoinerInfo

Enumerations#

enum
OT_COMMISSIONER_STATE_DISABLED = 0
OT_COMMISSIONER_STATE_PETITION = 1
OT_COMMISSIONER_STATE_ACTIVE = 2
}

Defines the Commissioner State.

enum
OT_COMMISSIONER_JOINER_START = 0
OT_COMMISSIONER_JOINER_CONNECTED = 1
OT_COMMISSIONER_JOINER_FINALIZE = 2
OT_COMMISSIONER_JOINER_END = 3
OT_COMMISSIONER_JOINER_REMOVED = 4
}

Defines a Joiner Event on the Commissioner.

enum
OT_JOINER_INFO_TYPE_ANY = 0
OT_JOINER_INFO_TYPE_EUI64 = 1
OT_JOINER_INFO_TYPE_DISCERNER = 2
}

Defines a Joiner Info Type.

Typedefs#

typedef enum otCommissionerState

Defines the Commissioner State.

Defines a Joiner Event on the Commissioner.

typedef struct otSteeringData

Represents the steering data.

typedef struct otCommissioningDataset

Represents a Commissioning Dataset.

typedef struct otJoinerPskd

Represents a Joiner PSKd.

typedef enum otJoinerInfoType

Defines a Joiner Info Type.

typedef struct otJoinerInfo

Represents a Joiner Info.

typedef void(*
otCommissionerStateCallback)(otCommissionerState aState, void *aContext)

Pointer is called whenever the commissioner state changes.

typedef void(*
otCommissionerJoinerCallback)(otCommissionerJoinerEvent aEvent, const otJoinerInfo *aJoinerInfo, const otExtAddress *aJoinerId, void *aContext)

Pointer is called whenever the joiner state changes.

typedef void(*
otCommissionerEnergyReportCallback)(uint32_t aChannelMask, const uint8_t *aEnergyList, uint8_t aEnergyListLength, void *aContext)

Pointer is called when the Commissioner receives an Energy Report.

typedef void(*
otCommissionerPanIdConflictCallback)(uint16_t aPanId, uint32_t aChannelMask, void *aContext)

Pointer is called when the Commissioner receives a PAN ID Conflict message.

Functions#

otCommissionerStart(otInstance *aInstance, otCommissionerStateCallback aStateCallback, otCommissionerJoinerCallback aJoinerCallback, void *aCallbackContext)

Enables the Thread Commissioner role.

otCommissionerStop(otInstance *aInstance)

Disables the Thread Commissioner role.

const char *
otCommissionerGetId(otInstance *aInstance)

Returns the Commissioner Id.

otCommissionerSetId(otInstance *aInstance, const char *aId)

Sets the Commissioner Id.

otCommissionerAddJoiner(otInstance *aInstance, const otExtAddress *aEui64, const char *aPskd, uint32_t aTimeout)

Adds a Joiner entry.

otCommissionerAddJoinerWithDiscerner(otInstance *aInstance, const otJoinerDiscerner *aDiscerner, const char *aPskd, uint32_t aTimeout)

Adds a Joiner entry with a given Joiner Discerner value.

otCommissionerGetNextJoinerInfo(otInstance *aInstance, uint16_t *aIterator, otJoinerInfo *aJoiner)

Get joiner info at aIterator position.

otCommissionerRemoveJoiner(otInstance *aInstance, const otExtAddress *aEui64)

Removes a Joiner entry.

otCommissionerRemoveJoinerWithDiscerner(otInstance *aInstance, const otJoinerDiscerner *aDiscerner)

Removes a Joiner entry.

const char *
otCommissionerGetProvisioningUrl(otInstance *aInstance)

Gets the Provisioning URL.

otCommissionerSetProvisioningUrl(otInstance *aInstance, const char *aProvisioningUrl)

Sets the Provisioning URL.

otCommissionerAnnounceBegin(otInstance *aInstance, uint32_t aChannelMask, uint8_t aCount, uint16_t aPeriod, const otIp6Address *aAddress)

Sends an Announce Begin message.

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.

otCommissionerPanIdQuery(otInstance *aInstance, uint16_t aPanId, uint32_t aChannelMask, const otIp6Address *aAddress, otCommissionerPanIdConflictCallback aCallback, void *aContext)

Sends a PAN ID Query message.

otCommissionerSendMgmtGet(otInstance *aInstance, const uint8_t *aTlvs, uint8_t aLength)

Sends MGMT_COMMISSIONER_GET.

otCommissionerSendMgmtSet(otInstance *aInstance, const otCommissioningDataset *aDataset, const uint8_t *aTlvs, uint8_t aLength)

Sends MGMT_COMMISSIONER_SET.

uint16_t
otCommissionerGetSessionId(otInstance *aInstance)

Returns the Commissioner Session ID.

otCommissionerGetState(otInstance *aInstance)

Returns the Commissioner State.

Macros#

#define

Minimum size of the Commissioning Passphrase.

#define

Maximum size of the Commissioning Passphrase.

#define

Max size (number of chars) in Provisioning URL string (excludes null char).

#define

Max steering data length (bytes)

#define

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.


Definition at line 62 of file include/openthread/commissioner.h

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

Definition at line 73 of file include/openthread/commissioner.h

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 (mSharedId.mEui64 in otJoinerInfo).

OT_JOINER_INFO_TYPE_DISCERNER

Joiner Discerner is specified (mSharedId.mDiscerner in otJoinerInfo).


Definition at line 132 of file include/openthread/commissioner.h

Typedef Documentation#

otCommissionerState#

typedef enum otCommissionerState otCommissionerState

Defines the Commissioner State.


Definition at line 67 of file include/openthread/commissioner.h

otCommissionerJoinerEvent#

typedef enum otCommissionerJoinerEvent otCommissionerJoinerEvent

Defines a Joiner Event on the Commissioner.


Definition at line 80 of file include/openthread/commissioner.h

otSteeringData#

typedef struct otSteeringData otSteeringData

Represents the steering data.


Definition at line 97 of file include/openthread/commissioner.h

otCommissioningDataset#

typedef struct otCommissioningDataset otCommissioningDataset

Represents a Commissioning Dataset.


Definition at line 115 of file include/openthread/commissioner.h

otJoinerPskd#

typedef struct otJoinerPskd otJoinerPskd

Represents a Joiner PSKd.


Definition at line 126 of file include/openthread/commissioner.h

otJoinerInfoType#

typedef enum otJoinerInfoType otJoinerInfoType

Defines a Joiner Info Type.


Definition at line 137 of file include/openthread/commissioner.h

otJoinerInfo#

typedef struct otJoinerInfo otJoinerInfo

Represents a Joiner Info.


Definition at line 153 of file include/openthread/commissioner.h

otCommissionerStateCallback#

typedef void(* otCommissionerStateCallback) (otCommissionerState aState, void *aContext) )(otCommissionerState aState, void *aContext)

Pointer is called whenever the commissioner state changes.

Parameters
[in]aState

The Commissioner state.

[in]aContext

A pointer to application-specific context.


Definition at line 162 of file include/openthread/commissioner.h

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.

Parameters
[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.


Definition at line 173 of file include/openthread/commissioner.h

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.

Parameters
[in]aChannelMask

The channel mask value.

[in]aEnergyList

A pointer to the energy measurement list.

[in]aEnergyListLength

Number of entries in aEnergyListLength.

[in]aContext

A pointer to application-specific context.


Definition at line 370 of file include/openthread/commissioner.h

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.

Parameters
[in]aPanId

The PAN ID value.

[in]aChannelMask

The channel mask value.

[in]aContext

A pointer to application-specific context.


Definition at line 411 of file include/openthread/commissioner.h

Function Documentation#

otCommissionerStart#

otError otCommissionerStart (otInstance * aInstance, otCommissionerStateCallback aStateCallback, otCommissionerJoinerCallback aJoinerCallback, void * aCallbackContext)

Enables the Thread Commissioner role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aStateCallback

A pointer to a function that is called when the commissioner state changes.

[in]aJoinerCallback

A pointer to a function that is called with a joiner event occurs.

[in]aCallbackContext

A pointer to application-specific context.


Definition at line 191 of file include/openthread/commissioner.h

otCommissionerStop#

otError otCommissionerStop (otInstance * aInstance)

Disables the Thread Commissioner role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.


Definition at line 205 of file include/openthread/commissioner.h

otCommissionerGetId#

const char * otCommissionerGetId (otInstance * aInstance)

Returns the Commissioner Id.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The Commissioner Id.


Definition at line 215 of file include/openthread/commissioner.h

otCommissionerSetId#

otError otCommissionerSetId (otInstance * aInstance, const char * aId)

Sets the Commissioner Id.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aId

A pointer to a string character array. Must be null terminated.


Definition at line 228 of file include/openthread/commissioner.h

otCommissionerAddJoiner#

otError otCommissionerAddJoiner (otInstance * aInstance, const otExtAddress * aEui64, const char * aPskd, uint32_t aTimeout)

Adds a Joiner entry.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aEui64

A pointer to the Joiner's IEEE EUI-64 or NULL for any Joiner.

[in]aPskd

A pointer to the PSKd.

[in]aTimeout

A time after which a Joiner is automatically removed, in seconds.

Note


Definition at line 246 of file include/openthread/commissioner.h

otCommissionerAddJoinerWithDiscerner#

otError otCommissionerAddJoinerWithDiscerner (otInstance * aInstance, const otJoinerDiscerner * aDiscerner, const char * aPskd, uint32_t aTimeout)

Adds a Joiner entry with a given Joiner Discerner value.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aDiscerner

A pointer to the Joiner Discerner.

[in]aPskd

A pointer to the PSKd.

[in]aTimeout

A time after which a Joiner is automatically removed, in seconds.

Note


Definition at line 267 of file include/openthread/commissioner.h

otCommissionerGetNextJoinerInfo#

otError otCommissionerGetNextJoinerInfo (otInstance * aInstance, uint16_t * aIterator, otJoinerInfo * aJoiner)

Get joiner info at aIterator position.

Parameters
[in]aInstance

A pointer to instance.

[inout]aIterator

A pointer to the Joiner Info iterator context.

[out]aJoiner

A reference to Joiner info.


Definition at line 283 of file include/openthread/commissioner.h

otCommissionerRemoveJoiner#

otError otCommissionerRemoveJoiner (otInstance * aInstance, const otExtAddress * aEui64)

Removes a Joiner entry.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aEui64

A pointer to the Joiner's IEEE EUI-64 or NULL for any Joiner.

Note


Definition at line 299 of file include/openthread/commissioner.h

otCommissionerRemoveJoinerWithDiscerner#

otError otCommissionerRemoveJoinerWithDiscerner (otInstance * aInstance, const otJoinerDiscerner * aDiscerner)

Removes a Joiner entry.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aDiscerner

A pointer to the Joiner Discerner.

Note


Definition at line 315 of file include/openthread/commissioner.h

otCommissionerGetProvisioningUrl#

const char * otCommissionerGetProvisioningUrl (otInstance * aInstance)

Gets the Provisioning URL.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • A pointer to the URL string.


Definition at line 325 of file include/openthread/commissioner.h

otCommissionerSetProvisioningUrl#

otError otCommissionerSetProvisioningUrl (otInstance * aInstance, const char * aProvisioningUrl)

Sets the Provisioning URL.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aProvisioningUrl

A pointer to the Provisioning URL (may be NULL to set as empty string).


Definition at line 337 of file include/openthread/commissioner.h

otCommissionerAnnounceBegin#

otError otCommissionerAnnounceBegin (otInstance * aInstance, uint32_t aChannelMask, uint8_t aCount, uint16_t aPeriod, const otIp6Address * aAddress)

Sends an Announce Begin message.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aChannelMask

The channel mask value.

[in]aCount

The number of Announcement messages per channel.

[in]aPeriod

The time between two successive MLE Announce transmissions (in milliseconds).

[in]aAddress

A pointer to the IPv6 destination.

Note


Definition at line 355 of file include/openthread/commissioner.h

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.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aChannelMask

The channel mask value.

[in]aCount

The number of energy measurements per channel.

[in]aPeriod

The time between energy measurements (milliseconds).

[in]aScanDuration

The scan duration for each energy measurement (milliseconds).

[in]aAddress

A pointer to the IPv6 destination.

[in]aCallback

A pointer to a function called on receiving an Energy Report message.

[in]aContext

A pointer to application-specific context.

Note


Definition at line 394 of file include/openthread/commissioner.h

otCommissionerPanIdQuery#

otError otCommissionerPanIdQuery (otInstance * aInstance, uint16_t aPanId, uint32_t aChannelMask, const otIp6Address * aAddress, otCommissionerPanIdConflictCallback aCallback, void * aContext)

Sends a PAN ID Query message.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aPanId

The PAN ID to query.

[in]aChannelMask

The channel mask value.

[in]aAddress

A pointer to the IPv6 destination.

[in]aCallback

A pointer to a function called on receiving a PAN ID Conflict message.

[in]aContext

A pointer to application-specific context.

Note


Definition at line 430 of file include/openthread/commissioner.h

otCommissionerSendMgmtGet#

otError otCommissionerSendMgmtGet (otInstance * aInstance, const uint8_t * aTlvs, uint8_t aLength)

Sends MGMT_COMMISSIONER_GET.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aTlvs

A pointer to TLVs.

[in]aLength

The length of TLVs.


Definition at line 449 of file include/openthread/commissioner.h

otCommissionerSendMgmtSet#

otError otCommissionerSendMgmtSet (otInstance * aInstance, const otCommissioningDataset * aDataset, const uint8_t * aTlvs, uint8_t aLength)

Sends MGMT_COMMISSIONER_SET.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aDataset

A pointer to commissioning dataset.

[in]aTlvs

A pointer to TLVs.

[in]aLength

The length of TLVs.


Definition at line 464 of file include/openthread/commissioner.h

otCommissionerGetSessionId#

uint16_t otCommissionerGetSessionId (otInstance * aInstance)

Returns the Commissioner Session ID.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The current commissioner session id.


Definition at line 477 of file include/openthread/commissioner.h

otCommissionerGetState#

otCommissionerState otCommissionerGetState (otInstance * aInstance)

Returns the Commissioner State.

Parameters
[in]aInstance

A pointer to an OpenThread instance.


Definition at line 489 of file include/openthread/commissioner.h

Macro Definition Documentation#

OT_COMMISSIONING_PASSPHRASE_MIN_SIZE#

#define OT_COMMISSIONING_PASSPHRASE_MIN_SIZE
Value:
6

Minimum size of the Commissioning Passphrase.


Definition at line 82 of file include/openthread/commissioner.h

OT_COMMISSIONING_PASSPHRASE_MAX_SIZE#

#define OT_COMMISSIONING_PASSPHRASE_MAX_SIZE
Value:
255

Maximum size of the Commissioning Passphrase.


Definition at line 83 of file include/openthread/commissioner.h

OT_PROVISIONING_URL_MAX_SIZE#

#define OT_PROVISIONING_URL_MAX_SIZE
Value:
64

Max size (number of chars) in Provisioning URL string (excludes null char).


Definition at line 85 of file include/openthread/commissioner.h

OT_STEERING_DATA_MAX_LENGTH#

#define OT_STEERING_DATA_MAX_LENGTH
Value:
16

Max steering data length (bytes)


Definition at line 87 of file include/openthread/commissioner.h

OT_JOINER_MAX_PSKD_LENGTH#

#define OT_JOINER_MAX_PSKD_LENGTH
Value:
32

Maximum string length of a Joiner PSKd (does not include null char).


Definition at line 117 of file include/openthread/commissioner.h