![]() |
0.01.00
|
This module includes functions for the Thread Commissioner role. More...
Typedefs | |
typedef enum otCommissionerState | otCommissionerState |
This enumeration defines the Commissioner State. | |
typedef void(OTCALL * | otCommissionerEnergyReportCallback) (uint32_t aChannelMask, const uint8_t *aEnergyList, uint8_t aEnergyListLength, void *aContext) |
This function pointer is called when the Commissioner receives an Energy Report. More... | |
typedef void(OTCALL * | otCommissionerPanIdConflictCallback) (uint16_t aPanId, uint32_t aChannelMask, void *aContext) |
This function pointer is called when the Commissioner receives a PAN ID Conflict message. More... | |
Enumerations | |
enum | otCommissionerState { OT_COMMISSIONER_STATE_DISABLED = 0, OT_COMMISSIONER_STATE_PETITION = 1, OT_COMMISSIONER_STATE_ACTIVE = 2 } |
This enumeration defines the Commissioner State. More... | |
Functions | |
OTAPI otError OTCALL | otCommissionerStart (otInstance *aInstance) |
This function enables the Thread Commissioner role. More... | |
OTAPI otError OTCALL | otCommissionerStop (otInstance *aInstance) |
This function disables the Thread Commissioner role. More... | |
OTAPI otError OTCALL | otCommissionerAddJoiner (otInstance *aInstance, const otExtAddress *aEui64, const char *aPSKd, uint32_t aTimeout) |
This function adds a Joiner entry. More... | |
OTAPI otError OTCALL | otCommissionerRemoveJoiner (otInstance *aInstance, const otExtAddress *aEui64) |
This function removes a Joiner entry. More... | |
OTAPI otError OTCALL | otCommissionerSetProvisioningUrl (otInstance *aInstance, const char *aProvisioningUrl) |
This function sets the Provisioning URL. More... | |
OTAPI otError OTCALL | otCommissionerAnnounceBegin (otInstance *aInstance, uint32_t aChannelMask, uint8_t aCount, uint16_t aPeriod, const otIp6Address *aAddress) |
This function sends an Announce Begin message. More... | |
OTAPI otError OTCALL | otCommissionerEnergyScan (otInstance *aInstance, uint32_t aChannelMask, uint8_t aCount, uint16_t aPeriod, uint16_t aScanDuration, const otIp6Address *aAddress, otCommissionerEnergyReportCallback aCallback, void *aContext) |
This function sends an Energy Scan Query message. More... | |
OTAPI otError OTCALL | otCommissionerPanIdQuery (otInstance *aInstance, uint16_t aPanId, uint32_t aChannelMask, const otIp6Address *aAddress, otCommissionerPanIdConflictCallback aCallback, void *aContext) |
This function sends a PAN ID Query message. More... | |
OTAPI otError OTCALL | otCommissionerSendMgmtGet (otInstance *aInstance, const uint8_t *aTlvs, uint8_t aLength) |
This function sends MGMT_COMMISSIONER_GET. More... | |
OTAPI otError OTCALL | otCommissionerSendMgmtSet (otInstance *aInstance, const otCommissioningDataset *aDataset, const uint8_t *aTlvs, uint8_t aLength) |
This function sends MGMT_COMMISSIONER_SET. More... | |
OTAPI uint16_t OTCALL | otCommissionerGetSessionId (otInstance *aInstance) |
This function returns the Commissioner Session ID. More... | |
OTAPI otCommissionerState OTCALL | otCommissionerGetState (otInstance *aInstance) |
This function returns the Commissioner State. More... | |
OTAPI otError OTCALL | otCommissionerGeneratePSKc (otInstance *aInstance, const char *aPassPhrase, const char *aNetworkName, const uint8_t *aExtPanId, uint8_t *aPSKc) |
This method generates PSKc. More... | |
This module includes functions for the Thread Commissioner role.
typedef void(OTCALL * otCommissionerEnergyReportCallback) (uint32_t aChannelMask, const uint8_t *aEnergyList, uint8_t aEnergyListLength, void *aContext) |
This function pointer is called when the Commissioner receives an Energy Report.
[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. |
typedef void(OTCALL * otCommissionerPanIdConflictCallback) (uint16_t aPanId, uint32_t aChannelMask, void *aContext) |
This function pointer is called when the Commissioner receives a PAN ID Conflict message.
[in] | aPanId | The PAN ID value. |
[in] | aChannelMask | The channel mask value. |
[in] | aContext | A pointer to application-specific context. |
enum otCommissionerState |
OTAPI otError OTCALL otCommissionerAddJoiner | ( | otInstance * | aInstance, |
const otExtAddress * | aEui64, | ||
const char * | aPSKd, | ||
uint32_t | aTimeout | ||
) |
This function adds a Joiner entry.
[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. |
OT_ERROR_NONE | Successfully added the Joiner. |
OT_ERROR_NO_BUFS | No buffers available to add the Joiner. |
OT_ERROR_INVALID_ARGS | aEui64 or aPSKd is invalid. |
OT_ERROR_INVALID_STATE | The commissioner is not active. |
OTAPI otError OTCALL otCommissionerAnnounceBegin | ( | otInstance * | aInstance, |
uint32_t | aChannelMask, | ||
uint8_t | aCount, | ||
uint16_t | aPeriod, | ||
const otIp6Address * | aAddress | ||
) |
This function sends an Announce Begin message.
[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] | aAddress | A pointer to the IPv6 destination. |
OT_ERROR_NONE | Successfully enqueued the Announce Begin message. |
OT_ERROR_NO_BUFS | Insufficient buffers to generate an Announce Begin message. |
OT_ERROR_INVALID_STATE | The commissioner is not active. |
OTAPI otError OTCALL otCommissionerEnergyScan | ( | otInstance * | aInstance, |
uint32_t | aChannelMask, | ||
uint8_t | aCount, | ||
uint16_t | aPeriod, | ||
uint16_t | aScanDuration, | ||
const otIp6Address * | aAddress, | ||
otCommissionerEnergyReportCallback | aCallback, | ||
void * | aContext | ||
) |
This function sends an Energy Scan Query message.
[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. |
OT_ERROR_NONE | Successfully enqueued the Energy Scan Query message. |
OT_ERROR_NO_BUFS | Insufficient buffers to generate an Energy Scan Query message. |
OT_ERROR_INVALID_STATE | The commissioner is not active. |
OTAPI otError OTCALL otCommissionerGeneratePSKc | ( | otInstance * | aInstance, |
const char * | aPassPhrase, | ||
const char * | aNetworkName, | ||
const uint8_t * | aExtPanId, | ||
uint8_t * | aPSKc | ||
) |
This method generates PSKc.
PSKc is used to establish the Commissioner Session.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aPassPhrase | The commissioning passphrase. |
[in] | aNetworkName | The network name for PSKc computation. |
[in] | aExtPanId | The extended pan id for PSKc computation. |
[out] | aPSKc | A pointer to the generated PSKc. |
OT_ERROR_NONE | Successfully generate PSKc. |
OT_ERROR_INVALID_ARGS | If any of the input arguments is invalid. |
OTAPI uint16_t OTCALL otCommissionerGetSessionId | ( | otInstance * | aInstance | ) |
This function returns the Commissioner Session ID.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI otCommissionerState OTCALL otCommissionerGetState | ( | otInstance * | aInstance | ) |
This function returns the Commissioner State.
[in] | aInstance | A pointer to an OpenThread instance. |
OT_COMMISSIONER_STATE_DISABLED | Commissioner disabled. |
OT_COMMISSIONER_STATE_PETITION | Becoming the commissioner. |
OT_COMMISSIONER_STATE_ACTIVE | Commissioner enabled. |
OTAPI otError OTCALL otCommissionerPanIdQuery | ( | otInstance * | aInstance, |
uint16_t | aPanId, | ||
uint32_t | aChannelMask, | ||
const otIp6Address * | aAddress, | ||
otCommissionerPanIdConflictCallback | aCallback, | ||
void * | aContext | ||
) |
This function sends a PAN ID Query message.
[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 an Energy Report message. |
[in] | aContext | A pointer to application-specific context. |
OT_ERROR_NONE | Successfully enqueued the PAN ID Query message. |
OT_ERROR_NO_BUFS | Insufficient buffers to generate a PAN ID Query message. |
OT_ERROR_INVALID_STATE | The commissioner is not active. |
OTAPI otError OTCALL otCommissionerRemoveJoiner | ( | otInstance * | aInstance, |
const otExtAddress * | aEui64 | ||
) |
This function removes a Joiner entry.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aEui64 | A pointer to the Joiner's IEEE EUI-64 or NULL for any Joiner. |
OT_ERROR_NONE | Successfully removed the Joiner. |
OT_ERROR_NOT_FOUND | The Joiner specified by aEui64 was not found. |
OT_ERROR_INVALID_ARGS | aEui64 is invalid. |
OT_ERROR_INVALID_STATE | The commissioner is not active. |
OTAPI otError OTCALL otCommissionerSendMgmtGet | ( | otInstance * | aInstance, |
const uint8_t * | aTlvs, | ||
uint8_t | aLength | ||
) |
This function sends MGMT_COMMISSIONER_GET.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aTlvs | A pointer to TLVs. |
[in] | aLength | The length of TLVs. |
OT_ERROR_NONE | Successfully send the meshcop dataset command. |
OT_ERROR_NO_BUFS | Insufficient buffer space to send. |
OTAPI otError OTCALL otCommissionerSendMgmtSet | ( | otInstance * | aInstance, |
const otCommissioningDataset * | aDataset, | ||
const uint8_t * | aTlvs, | ||
uint8_t | aLength | ||
) |
This function sends MGMT_COMMISSIONER_SET.
[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. |
OT_ERROR_NONE | Successfully send the meshcop dataset command. |
OT_ERROR_NO_BUFS | Insufficient buffer space to send. |
OTAPI otError OTCALL otCommissionerSetProvisioningUrl | ( | otInstance * | aInstance, |
const char * | aProvisioningUrl | ||
) |
This function sets the Provisioning URL.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aProvisioningUrl | A pointer to the Provisioning URL (may be NULL). |
OT_ERROR_NONE | Successfully set the Provisioning URL. |
OT_ERROR_INVALID_ARGS | aProvisioningUrl is invalid. |
OTAPI otError OTCALL otCommissionerStart | ( | otInstance * | aInstance | ) |
This function enables the Thread Commissioner role.
[in] | aInstance | A pointer to an OpenThread instance. |
OT_ERROR_NONE | Successfully started the Commissioner role. |
OTAPI otError OTCALL otCommissionerStop | ( | otInstance * | aInstance | ) |
This function disables the Thread Commissioner role.
[in] | aInstance | A pointer to an OpenThread instance. |
OT_ERROR_NONE | Successfully stopped the Commissioner role. |