Joiner#

This module includes functions for the Thread Joiner role.

Note

  • The functions in this module require OPENTHREAD_CONFIG_JOINER_ENABLE=1.

Modules#

otJoinerDiscerner

Enumerations#

enum
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
}

Defines the Joiner State.

Typedefs#

typedef enum otJoinerState

Defines the Joiner State.

typedef struct otJoinerDiscerner

Represents a Joiner Discerner.

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

Pointer is called to notify the completion of a join operation.

Functions#

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)

Enables the Thread Joiner role.

void
otJoinerStop(otInstance *aInstance)

Disables the Thread Joiner role.

otJoinerGetState(otInstance *aInstance)

Gets the Joiner State.

const otExtAddress *
otJoinerGetId(otInstance *aInstance)

Gets the Joiner ID.

otJoinerSetDiscerner(otInstance *aInstance, otJoinerDiscerner *aDiscerner)

Sets the Joiner Discerner.

otJoinerGetDiscerner(otInstance *aInstance)

Gets the Joiner Discerner.

const char *
otJoinerStateToString(otJoinerState aState)

Converts a given joiner state enumeration value to a human-readable string.

Macros#

#define

Maximum length of a Joiner Discerner in bits.

Enumeration Documentation#

otJoinerState#

otJoinerState

Defines the Joiner State.

Enumerator
OT_JOINER_STATE_IDLE
OT_JOINER_STATE_DISCOVER
OT_JOINER_STATE_CONNECT
OT_JOINER_STATE_CONNECTED
OT_JOINER_STATE_ENTRUST
OT_JOINER_STATE_JOINED

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

Typedef Documentation#

otJoinerState#

typedef enum otJoinerState otJoinerState

Defines the Joiner State.


Definition at line 70 of file include/openthread/joiner.h

otJoinerDiscerner#

typedef struct otJoinerDiscerner otJoinerDiscerner

Represents a Joiner Discerner.


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

otJoinerCallback#

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

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.


Definition at line 94 of file include/openthread/joiner.h

Function Documentation#

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)

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.


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

otJoinerStop#

void otJoinerStop (otInstance * aInstance)

Disables the Thread Joiner role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.


Definition at line 131 of file include/openthread/joiner.h

otJoinerGetState#

otJoinerState otJoinerGetState (otInstance * aInstance)

Gets the Joiner State.

Parameters
[in]aInstance

A pointer to an OpenThread instance.


Definition at line 146 of file include/openthread/joiner.h

otJoinerGetId#

const otExtAddress * otJoinerGetId (otInstance * aInstance)

Gets the Joiner ID.

Parameters
[in]aInstance

A pointer to the OpenThread instance.

If a Joiner Discerner is not set, Joiner ID is the first 64 bits of the result of computing SHA-256 over factory-assigned IEEE EUI-64. Otherwise the Joiner ID is calculated from the Joiner Discerner value.

The Joiner ID is also used as the device's IEEE 802.15.4 Extended Address during the commissioning process.

Returns

  • A pointer to the Joiner ID.


Definition at line 161 of file include/openthread/joiner.h

otJoinerSetDiscerner#

otError otJoinerSetDiscerner (otInstance * aInstance, otJoinerDiscerner * aDiscerner)

Sets the Joiner Discerner.

Parameters
[in]aInstance

A pointer to the OpenThread instance.

[in]aDiscerner

A pointer to a Joiner Discerner. If NULL clears any previously set discerner.

The Joiner Discerner is used to calculate the Joiner ID during the Thread Commissioning process. For more information, refer to otJoinerGetId. Note

  • The Joiner Discerner takes the place of the Joiner EUI-64 during the joiner session of Thread Commissioning.


Definition at line 178 of file include/openthread/joiner.h

otJoinerGetDiscerner#

const otJoinerDiscerner * otJoinerGetDiscerner (otInstance * aInstance)

Gets the Joiner Discerner.

Parameters
[in]aInstance

A pointer to the OpenThread instance.

For more information, refer to otJoinerSetDiscerner.

Returns

  • A pointer to Joiner Discerner or NULL if none is set.


Definition at line 188 of file include/openthread/joiner.h

otJoinerStateToString#

const char * otJoinerStateToString (otJoinerState aState)

Converts a given joiner state enumeration value to a human-readable string.

Parameters
[in]aState

The joiner state.

Returns

  • A human-readable string representation of aState.


Definition at line 198 of file include/openthread/joiner.h

Macro Definition Documentation#

OT_JOINER_MAX_DISCERNER_LENGTH#

#define OT_JOINER_MAX_DISCERNER_LENGTH
Value:
64

Maximum length of a Joiner Discerner in bits.


Definition at line 72 of file include/openthread/joiner.h