nRF5 SDK for Thread v0.9.0
Typedefs | Functions
Core-commissioning

Typedefs

typedef void(OTCALL * otCommissionerEnergyReportCallback )(uint32_t aChannelMask, const uint8_t *aEnergyList, uint8_t aEnergyListLength, void *aContext)
 
typedef void(OTCALL * otCommissionerPanIdConflictCallback )(uint16_t aPanId, uint32_t aChannelMask, void *aContext)
 
typedef void(OTCALL * otJoinerCallback )(ThreadError aError, void *aContext)
 

Functions

OTAPI ThreadError OTCALL otCommissionerStart (otInstance *aInstance)
 
OTAPI ThreadError OTCALL otCommissionerStop (otInstance *aInstance)
 
OTAPI ThreadError OTCALL otCommissionerAddJoiner (otInstance *aInstance, const otExtAddress *aExtAddress, const char *aPSKd, uint32_t aTimeout)
 
OTAPI ThreadError OTCALL otCommissionerRemoveJoiner (otInstance *aIntsance, const otExtAddress *aExtAddress)
 
OTAPI ThreadError OTCALL otCommissionerSetProvisioningUrl (otInstance *aInstance, const char *aProvisioningUrl)
 
OTAPI ThreadError OTCALL otCommissionerAnnounceBegin (otInstance *aInstance, uint32_t aChannelMask, uint8_t aCount, uint16_t aPeriod, const otIp6Address *aAddress)
 
OTAPI ThreadError OTCALL otCommissionerEnergyScan (otInstance *aInstance, uint32_t aChannelMask, uint8_t aCount, uint16_t aPeriod, uint16_t aScanDuration, const otIp6Address *aAddress, otCommissionerEnergyReportCallback aCallback, void *aContext)
 
OTAPI ThreadError OTCALL otCommissionerPanIdQuery (otInstance *aInstance, uint16_t aPanId, uint32_t aChannelMask, const otIp6Address *aAddress, otCommissionerPanIdConflictCallback aCallback, void *aContext)
 
OTAPI ThreadError OTCALL otCommissionerSendMgmtGet (otInstance *, const uint8_t *aTlvs, uint8_t aLength)
 
OTAPI ThreadError OTCALL otCommissionerSendMgmtSet (otInstance *, const otCommissioningDataset *aDataset, const uint8_t *aTlvs, uint8_t aLength)
 
OTAPI uint16_t OTCALL otCommissionerGetSessionId (otInstance *)
 
OTAPI otCommissionerState OTCALL otCommissionerGetState (otInstance *)
 
OTAPI ThreadError OTCALL otCommissionerGeneratePSKc (otInstance *aInstance, const char *aPassPhrase, const char *aNetworkName, const uint8_t *aExtPanId, uint8_t *aPSKc)
 
OTAPI ThreadError OTCALL otJoinerStart (otInstance *aInstance, const char *aPSKd, const char *aProvisioningUrl, const char *aVendorName, const char *aVendorModel, const char *aVendorSwVersion, const char *aVendordata, otJoinerCallback aCallback, void *aContext)
 
OTAPI ThreadError OTCALL otJoinerStop (otInstance *aInstance)
 

Detailed Description

Typedef Documentation

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.

Parameters
[in]aChannelMaskThe channel mask value.
[in]aEnergyListA pointer to the energy measurement list.
[in]aEnergyListLengthNumber of entries in aEnergyListLength.
[in]aContextA 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.

Parameters
[in]aPanIdThe PAN ID value.
[in]aChannelMaskThe channel mask value.
[in]aContextA pointer to application-specific context.
typedef void(OTCALL * otJoinerCallback)(ThreadError aError, void *aContext)

This function pointer is called to notify the completion of a join operation.

Parameters
[in]aErrorkThreadError_None if the join process succeeded. kThreadError_Security if the join process failed due to security credentials. kThreadError_NotFound if no joinable network was discovered. kThreadError_ResponseTimeout if a response timed out.
[in]aContextA pointer to application-specific context.

Function Documentation

OTAPI ThreadError OTCALL otCommissionerAddJoiner ( otInstance *  aInstance,
const otExtAddress aExtAddress,
const char *  aPSKd,
uint32_t  aTimeout 
)

This function adds a Joiner entry.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aExtAddressA pointer to the Joiner's extended address or NULL for any Joiner.
[in]aPSKdA pointer to the PSKd.
[in]aTimeoutA time after which a Joiner is automatically removed, in seconds.
Return values
kThreadError_NoneSuccessfully added the Joiner.
kThreadError_NoBufsNo buffers available to add the Joiner.
kThreadError_InvalidArgsaExtAddress or aPSKd is invalid.
OTAPI ThreadError OTCALL otCommissionerAnnounceBegin ( otInstance *  aInstance,
uint32_t  aChannelMask,
uint8_t  aCount,
uint16_t  aPeriod,
const otIp6Address aAddress 
)

This function sends an Announce Begin message.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aChannelMaskThe channel mask value.
[in]aCountThe number of energy measurements per channel.
[in]aPeriodThe time between energy measurements (milliseconds).
[in]aAddressA pointer to the IPv6 destination.
Return values
kThreadError_NoneSuccessfully enqueued the Announce Begin message.
kThreadError_NoBufsInsufficient buffers to generate an Announce Begin message.
OTAPI ThreadError 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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aChannelMaskThe channel mask value.
[in]aCountThe number of energy measurements per channel.
[in]aPeriodThe time between energy measurements (milliseconds).
[in]aScanDurationThe scan duration for each energy measurement (milliseconds).
[in]aAddressA pointer to the IPv6 destination.
[in]aCallbackA pointer to a function called on receiving an Energy Report message.
[in]aContextA pointer to application-specific context.
Return values
kThreadError_NoneSuccessfully enqueued the Energy Scan Query message.
kThreadError_NoBufsInsufficient buffers to generate an Energy Scan Query message.
OTAPI ThreadError 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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aPassPhraseThe commissioning passphrase.
[in]aNetworkNameThe network name for PSKc computation.
[in]aExtPanIdThe extended pan id for PSKc computation.
[out]aPSKcA pointer to where the generated PSKc will be placed.
Return values
kThreadErrorNoneSuccessfully generate PSKc.
kThreadError_InvalidArgsIf any of the input arguments is invalid.
OTAPI uint16_t OTCALL otCommissionerGetSessionId ( otInstance *  )

This function returns the Commissioner Session ID.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
The current commissioner session id.
OTAPI otCommissionerState OTCALL otCommissionerGetState ( otInstance *  )

This function returns the Commissioner State.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Return values
kCommissionerStateDisabledCommissioner disabled.
kCommissionerStatePetitionBecoming the commissioner.
kCommissionerStateActiveCommissioner enabled.
OTAPI ThreadError 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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aPanIdThe PAN ID to query.
[in]aChannelMaskThe channel mask value.
[in]aAddressA pointer to the IPv6 destination.
[in]aCallbackA pointer to a function called on receiving an Energy Report message.
[in]aContextA pointer to application-specific context.
Return values
kThreadError_NoneSuccessfully enqueued the PAN ID Query message.
kThreadError_NoBufsInsufficient buffers to generate a PAN ID Query message.
OTAPI ThreadError OTCALL otCommissionerRemoveJoiner ( otInstance *  aIntsance,
const otExtAddress aExtAddress 
)

This function removes a Joiner entry.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aExtAddressA pointer to the Joiner's extended address or NULL for any Joiner.
Return values
kThreadError_NoneSuccessfully added the Joiner.
kThreadError_NotFoundThe Joiner specified by aExtAddress was not found.
kThreadError_InvalidArgsaExtAddress is invalid.
OTAPI ThreadError OTCALL otCommissionerSendMgmtGet ( otInstance *  ,
const uint8_t *  aTlvs,
uint8_t  aLength 
)

This function sends MGMT_COMMISSIONER_GET.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aTlvsA pointer to TLVs.
[in]aLengthThe length of TLVs.
Return values
kThreadError_NoneSuccessfully send the meshcop dataset command.
kThreadError_NoBufsInsufficient buffer space to send.
OTAPI ThreadError OTCALL otCommissionerSendMgmtSet ( otInstance *  ,
const otCommissioningDataset aDataset,
const uint8_t *  aTlvs,
uint8_t  aLength 
)

This function sends MGMT_COMMISSIONER_SET.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aDatasetA pointer to commissioning dataset.
[in]aTlvsA pointer to TLVs.
[in]aLengthThe length of TLVs.
Return values
kThreadError_NoneSuccessfully send the meshcop dataset command.
kThreadError_NoBufsInsufficient buffer space to send.
OTAPI ThreadError OTCALL otCommissionerSetProvisioningUrl ( otInstance *  aInstance,
const char *  aProvisioningUrl 
)

This function sets the Provisioning URL.

Parameters
[in]aProvisioningUrlA pointer to the Provisioning URL (may be NULL).
Return values
kThreadError_NoneSuccessfully added the Joiner.
kThreadError_InvalidArgsaProvisioningUrl is invalid.
OTAPI ThreadError OTCALL otCommissionerStart ( otInstance *  aInstance)

This function enables the Thread Commissioner role.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Return values
kThreadError_NoneSuccessfully started the Commissioner role.
OTAPI ThreadError OTCALL otCommissionerStop ( otInstance *  aInstance)

This function disables the Thread Commissioner role.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Return values
kThreadError_NoneSuccessfully started the Commissioner role.
OTAPI ThreadError OTCALL otJoinerStart ( otInstance *  aInstance,
const char *  aPSKd,
const char *  aProvisioningUrl,
const char *  aVendorName,
const char *  aVendorModel,
const char *  aVendorSwVersion,
const char *  aVendordata,
otJoinerCallback  aCallback,
void *  aContext 
)

This function enables the Thread Joiner role.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aPSKdA pointer to the PSKd.
[in]aProvisioningUrlA pointer to the Provisioning URL (may be NULL).
[in]aVendorNameA pointer to the Vendor Name (must be static).
[in]aVendorModelA pointer to the Vendor Model (must be static).
[in]aVendorSwVersionA pointer to the Vendor SW Version (must be static).
[in]aVendorDataA pointer to the Vendor Data (must be static).
[in]aCallbackA pointer to a function that is called when the join operation completes.
[in]aContextA pointer to application-specific context.
Return values
kThreadError_NoneSuccessfully started the Commissioner role.
kThreadError_InvalidArgsaPSKd or aProvisioningUrl is invalid.
OTAPI ThreadError OTCALL otJoinerStop ( otInstance *  aInstance)

This function disables the Thread Joiner role.

Parameters
[in]aInstanceA pointer to an OpenThread instance.

Documentation feedback | Developer Zone | Subscribe | Updated