This module includes functions for the Thread Joiner role.

Typedefs

typedef enum otJoinerState otJoinerState
This enumeration defines the Joiner State.
typedef void(* otJoinerCallback ) ( otError aError, void *aContext)
This function pointer is called to notify the completion of a join operation.

Enumerations

enum otJoinerState {
OT_JOINER_STATE_IDLE = 0,
OT_JOINER_STATE_DISCOVER = 1,
OT_JOINER_STATE_CONNECT = 2,
OT_JOINER_STATE_CONNECTED = 3,
OT_JOINER_STATE_ENTRUST = 4,
OT_JOINER_STATE_JOINED = 5
}
This enumeration defines the Joiner State.

Functions

otError 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.
void otJoinerStop ( otInstance *aInstance)
This function disables the Thread Joiner role.
otJoinerState otJoinerGetState ( otInstance *aInstance)
This function returns the Joiner State.
void otJoinerGetId ( otInstance *aInstance, otExtAddress *aJoinerId)
Get the Joiner ID.

Detailed Description

This module includes functions for the Thread Joiner role.

Note
The functions in this module require OPENTHREAD_CONFIG_JOINER_ENABLE=1 .

Typedef Documentation

otJoinerCallback

typedef void(* otJoinerCallback) ( otError aError, void *aContext)

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

Parameters
[in] aError OT_ERROR_NONE if the join process succeeded. OT_ERROR_SECURITY if the join process failed due to security credentials. OT_ERROR_NOT_FOUND if no joinable network was discovered. OT_ERROR_RESPONSE_TIMEOUT if a response timed out.
[in] aContext A pointer to application-specific context.

Function Documentation

otJoinerGetId()

void otJoinerGetId ( otInstance * aInstance,
otExtAddress * aJoinerId
)

Get the Joiner ID.

Joiner ID is the first 64 bits of the result of computing SHA-256 over factory-assigned IEEE EUI-64, which is used as IEEE 802.15.4 Extended Address during commissioning process.

Parameters
[in] aInstance A pointer to the OpenThread instance.
[out] aJoinerId A pointer to where the Joiner ID is placed.

otJoinerGetState()

otJoinerState otJoinerGetState ( otInstance * aInstance )

This function returns the Joiner State.

Parameters
[in] aInstance A pointer to an OpenThread instance.
Return values
OT_JOINER_STATE_IDLE
OT_JOINER_STATE_DISCOVER
OT_JOINER_STATE_CONNECT
OT_JOINER_STATE_CONNECTED
OT_JOINER_STATE_ENTRUST
OT_JOINER_STATE_JOINED

otJoinerStart()

otError 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] aInstance A pointer to an OpenThread instance.
[in] aPskd A pointer to the PSKd.
[in] aProvisioningUrl A pointer to the Provisioning URL (may be NULL).
[in] aVendorName A pointer to the Vendor Name (may be NULL).
[in] aVendorModel A pointer to the Vendor Model (may be NULL).
[in] aVendorSwVersion A pointer to the Vendor SW Version (may be NULL).
[in] aVendorData A pointer to the Vendor Data (may be NULL).
[in] aCallback A pointer to a function that is called when the join operation completes.
[in] aContext A pointer to application-specific context.
Return values
OT_ERROR_NONE Successfully started the Commissioner role.
OT_ERROR_INVALID_ARGS aPskd or aProvisioningUrl is invalid.

otJoinerStop()

void otJoinerStop ( otInstance * aInstance )

This function disables the Thread Joiner role.

Parameters
[in] aInstance A pointer to an OpenThread instance.