Commissioner
This module includes functions for the Thread Commissioner role.
Summary
Enumerations |
|
---|---|
otCommissionerJoinerEvent
|
enum Defines a Joiner Event on the Commissioner. |
otCommissionerState{
|
enum Defines the Commissioner State. |
otJoinerInfoType{
|
enum Defines a Joiner Info Type. |
Typedefs |
|
---|---|
otCommissionerEnergyReportCallback)(uint32_t aChannelMask, const uint8_t *aEnergyList, uint8_t aEnergyListLength, void *aContext)
|
typedefvoid(*
Pointer is called when the Commissioner receives an Energy Report. |
otCommissionerJoinerCallback)(otCommissionerJoinerEvent aEvent, const otJoinerInfo *aJoinerInfo, const otExtAddress *aJoinerId, void *aContext)
|
typedefvoid(*
Pointer is called whenever the joiner state changes. |
otCommissionerJoinerEvent
|
typedef Defines a Joiner Event on the Commissioner. |
otCommissionerPanIdConflictCallback)(uint16_t aPanId, uint32_t aChannelMask, void *aContext)
|
typedefvoid(*
Pointer is called when the Commissioner receives a PAN ID Conflict message. |
otCommissionerState
|
typedefenum otCommissionerState
Defines the Commissioner State. |
otCommissionerStateCallback)(otCommissionerState aState, void *aContext)
|
typedefvoid(*
Pointer is called whenever the commissioner state changes. |
otCommissioningDataset
|
typedefstruct otCommissioningDataset
Represents a Commissioning Dataset. |
otJoinerInfo
|
typedefstruct otJoinerInfo
Represents a Joiner Info. |
otJoinerInfoType
|
typedefenum otJoinerInfoType
Defines a Joiner Info Type. |
otJoinerPskd
|
typedefstruct otJoinerPskd
Represents a Joiner PSKd. |
otSteeringData
|
typedefstruct otSteeringData
Represents the steering data. |
Functions |
|
---|---|
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.
|
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.
|
otCommissionerGetId(otInstance *aInstance)
|
const char *
Returns the Commissioner Id.
|
otCommissionerGetNextJoinerInfo(otInstance *aInstance, uint16_t *aIterator, otJoinerInfo *aJoiner)
|
Get joiner info at aIterator position.
|
otCommissionerGetProvisioningUrl(otInstance *aInstance)
|
const char *
Gets the Provisioning URL.
|
otCommissionerGetSessionId(otInstance *aInstance)
|
uint16_t
Returns the Commissioner Session ID.
|
otCommissionerGetState(otInstance *aInstance)
|
Returns the Commissioner State.
|
otCommissionerPanIdQuery(otInstance *aInstance, uint16_t aPanId, uint32_t aChannelMask, const otIp6Address *aAddress, otCommissionerPanIdConflictCallback aCallback, void *aContext)
|
Sends a PAN ID Query message.
|
otCommissionerRemoveJoiner(otInstance *aInstance, const otExtAddress *aEui64)
|
Removes a Joiner entry.
|
otCommissionerRemoveJoinerWithDiscerner(otInstance *aInstance, const otJoinerDiscerner *aDiscerner)
|
Removes a Joiner entry.
|
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.
|
otCommissionerSetId(otInstance *aInstance, const char *aId)
|
Sets the Commissioner Id.
|
otCommissionerSetProvisioningUrl(otInstance *aInstance, const char *aProvisioningUrl)
|
Sets the Provisioning URL.
|
otCommissionerStart(otInstance *aInstance, otCommissionerStateCallback aStateCallback, otCommissionerJoinerCallback aJoinerCallback, void *aCallbackContext)
|
Enables the Thread Commissioner role.
|
otCommissionerStop(otInstance *aInstance)
|
Disables the Thread Commissioner role.
|
Macros |
|
---|---|
OT_COMMISSIONING_PASSPHRASE_MAX_SIZE 255
|
Maximum size of the Commissioning Passphrase.
|
OT_COMMISSIONING_PASSPHRASE_MIN_SIZE 6
|
Minimum size of the Commissioning Passphrase.
|
OT_JOINER_MAX_PSKD_LENGTH 32
|
Maximum string length of a Joiner PSKd (does not include null char).
|
OT_PROVISIONING_URL_MAX_SIZE 64
|
Max size (number of chars) in Provisioning URL string (excludes null char).
|
OT_STEERING_DATA_MAX_LENGTH 16
|
Max steering data length (bytes)
|
Structs |
|
---|---|
otCommissioningDataset |
Represents a Commissioning Dataset. |
otJoinerInfo |
Represents a Joiner Info. |
otJoinerPskd |
Represents a Joiner PSKd. |
otSteeringData |
Represents the steering data. |
Enumerations
otCommissionerJoinerEvent
otCommissionerJoinerEvent
Defines a Joiner Event on the Commissioner.
otCommissionerState
otCommissionerState
otJoinerInfoType
otJoinerInfoType
Defines a Joiner Info Type.
Properties | |
---|---|
OT_JOINER_INFO_TYPE_ANY
|
Accept any Joiner (no EUI64 or Discerner is specified). |
OT_JOINER_INFO_TYPE_DISCERNER
|
Joiner Discerner is specified ( |
OT_JOINER_INFO_TYPE_EUI64
|
Joiner EUI-64 is specified ( |
Typedefs
otCommissionerEnergyReportCallback
void(* otCommissionerEnergyReportCallback)(uint32_t aChannelMask, const uint8_t *aEnergyList, uint8_t aEnergyListLength, void *aContext)
Pointer is called when the Commissioner receives an Energy Report.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
otCommissionerJoinerCallback
void(* otCommissionerJoinerCallback)(otCommissionerJoinerEvent aEvent, const otJoinerInfo *aJoinerInfo, const otExtAddress *aJoinerId, void *aContext)
Pointer is called whenever the joiner state changes.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
otCommissionerJoinerEvent
enum otCommissionerJoinerEvent otCommissionerJoinerEvent
Defines a Joiner Event on the Commissioner.
otCommissionerPanIdConflictCallback
void(* otCommissionerPanIdConflictCallback)(uint16_t aPanId, uint32_t aChannelMask, void *aContext)
Pointer is called when the Commissioner receives a PAN ID Conflict message.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otCommissionerStateCallback
void(* otCommissionerStateCallback)(otCommissionerState aState, void *aContext)
Pointer is called whenever the commissioner state changes.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otCommissioningDataset
struct otCommissioningDataset otCommissioningDataset
Represents a Commissioning Dataset.
Functions
otCommissionerAddJoiner
otError otCommissionerAddJoiner( otInstance *aInstance, const otExtAddress *aEui64, const char *aPskd, uint32_t aTimeout )
Adds a Joiner entry.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
otCommissionerAddJoinerWithDiscerner
otError otCommissionerAddJoinerWithDiscerner( otInstance *aInstance, const otJoinerDiscerner *aDiscerner, const char *aPskd, uint32_t aTimeout )
Adds a Joiner entry with a given Joiner Discerner value.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
otCommissionerAnnounceBegin
otError otCommissionerAnnounceBegin( otInstance *aInstance, uint32_t aChannelMask, uint8_t aCount, uint16_t aPeriod, const otIp6Address *aAddress )
Sends an Announce Begin message.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Return Values |
|
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.
Details | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||||||||
Return Values |
|
otCommissionerGetId
const char * otCommissionerGetId( otInstance *aInstance )
Returns the Commissioner Id.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The Commissioner Id.
|
otCommissionerGetNextJoinerInfo
otError otCommissionerGetNextJoinerInfo( otInstance *aInstance, uint16_t *aIterator, otJoinerInfo *aJoiner )
Get joiner info at aIterator position.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otCommissionerGetProvisioningUrl
const char * otCommissionerGetProvisioningUrl( otInstance *aInstance )
Gets the Provisioning URL.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A pointer to the URL string.
|
otCommissionerGetSessionId
uint16_t otCommissionerGetSessionId( otInstance *aInstance )
Returns the Commissioner Session ID.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The current commissioner session id.
|
otCommissionerGetState
otCommissionerState otCommissionerGetState( otInstance *aInstance )
Returns the Commissioner State.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otCommissionerPanIdQuery
otError otCommissionerPanIdQuery( otInstance *aInstance, uint16_t aPanId, uint32_t aChannelMask, const otIp6Address *aAddress, otCommissionerPanIdConflictCallback aCallback, void *aContext )
Sends a PAN ID Query message.
Details | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||||
Return Values |
|
otCommissionerRemoveJoiner
otError otCommissionerRemoveJoiner( otInstance *aInstance, const otExtAddress *aEui64 )
Removes a Joiner entry.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
otCommissionerRemoveJoinerWithDiscerner
otError otCommissionerRemoveJoinerWithDiscerner( otInstance *aInstance, const otJoinerDiscerner *aDiscerner )
Removes a Joiner entry.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
otCommissionerSendMgmtGet
otError otCommissionerSendMgmtGet( otInstance *aInstance, const uint8_t *aTlvs, uint8_t aLength )
Sends MGMT_COMMISSIONER_GET.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otCommissionerSendMgmtSet
otError otCommissionerSendMgmtSet( otInstance *aInstance, const otCommissioningDataset *aDataset, const uint8_t *aTlvs, uint8_t aLength )
Sends MGMT_COMMISSIONER_SET.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
otCommissionerSetId
otError otCommissionerSetId( otInstance *aInstance, const char *aId )
Sets the Commissioner Id.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otCommissionerSetProvisioningUrl
otError otCommissionerSetProvisioningUrl( otInstance *aInstance, const char *aProvisioningUrl )
Sets the Provisioning URL.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otCommissionerStart
otError otCommissionerStart( otInstance *aInstance, otCommissionerStateCallback aStateCallback, otCommissionerJoinerCallback aJoinerCallback, void *aCallbackContext )
Enables the Thread Commissioner role.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
otCommissionerStop
otError otCommissionerStop( otInstance *aInstance )
Disables the Thread Commissioner role.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
Macros
OT_COMMISSIONING_PASSPHRASE_MAX_SIZE
OT_COMMISSIONING_PASSPHRASE_MAX_SIZE 255
Maximum size of the Commissioning Passphrase.
OT_COMMISSIONING_PASSPHRASE_MIN_SIZE
OT_COMMISSIONING_PASSPHRASE_MIN_SIZE 6
Minimum size of the Commissioning Passphrase.
OT_JOINER_MAX_PSKD_LENGTH
OT_JOINER_MAX_PSKD_LENGTH 32
Maximum string length of a Joiner PSKd (does not include null char).
OT_PROVISIONING_URL_MAX_SIZE
OT_PROVISIONING_URL_MAX_SIZE 64
Max size (number of chars) in Provisioning URL string (excludes null char).
OT_STEERING_DATA_MAX_LENGTH
OT_STEERING_DATA_MAX_LENGTH 16
Max steering data length (bytes)
Resources
OpenThread API Reference topics originate from the source code, available on GitHub. For more information, or to contribute to our documentation, refer to Resources.