Joiner

This module includes functions for the Thread Joiner role.

Summary

Enumerations

otJoinerState enum
This enumeration defines the Joiner State.

Typedefs

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

Functions

otJoinerGetDiscerner(otInstance *aInstance)
This method gets the Joiner Discerner.
otJoinerGetId(otInstance *aInstance)
const otExtAddress *
This method gets the Joiner ID.
otJoinerGetState(otInstance *aInstance)
This function returns the Joiner State.
otJoinerSetDiscerner(otInstance *aInstance, otJoinerDiscerner *aDiscerner)
This method sets the Joiner Discerner.
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.
otJoinerStop(otInstance *aInstance)
void
This function disables the Thread Joiner role.

Structs

otJoinerDiscerner

This structure represents a Joiner Discerner.

Enumerations

otJoinerState

 otJoinerState

This enumeration defines the Joiner State.

Typedefs

otJoinerCallback

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

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

Details
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.

otJoinerDiscerner

struct otJoinerDiscerner otJoinerDiscerner

This structure represents a Joiner Discerner.

otJoinerState

enum otJoinerState otJoinerState

This enumeration defines the Joiner State.

Functions

otJoinerGetDiscerner

const otJoinerDiscerner * otJoinerGetDiscerner(
  otInstance *aInstance
)

This method gets the Joiner Discerner.

Details
Parameters
[in] aInstance
A pointer to the OpenThread instance.
Returns
A pointer to Joiner Discerner or NULL if none is set.

otJoinerGetId

const otExtAddress * otJoinerGetId(
  otInstance *aInstance
)

This method gets the Joiner ID.

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 commissioning process.

Details
Parameters
[in] aInstance
A pointer to the OpenThread instance.
Returns
A pointer to the Joiner ID.

otJoinerGetState

otJoinerState otJoinerGetState(
  otInstance *aInstance
)

This function returns the Joiner State.

Details
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

otJoinerSetDiscerner

otError otJoinerSetDiscerner(
  otInstance *aInstance,
  otJoinerDiscerner *aDiscerner
)

This method sets the Joiner Discerner.

The Joiner Discerner is used to calculate the Joiner ID used during commissioning/joining process.

By default (when a discerner is not provided or set to NULL), Joiner ID is derived as first 64 bits of the result of computing SHA-256 over factory-assigned IEEE EUI-64. Note that this is the main behavior expected by Thread specification.

Details
Parameters
[in] aInstance
A pointer to the OpenThread instance.
[in] aDiscerner
A pointer to a Joiner Discerner. If NULL clears any previously set discerner.
Return Values
OT_ERROR_NONE
The Joiner Discerner updated successfully.
OT_ERROR_INVALID_ARGS
aDiscerner is not valid (specified length is not within valid range).
OT_ERROR_INVALID_STATE
There is an ongoing Joining process so Joiner Discerner could not be changed.

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.

Details
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 Joiner role.
OT_ERROR_BUSY
The previous attempt is still on-going.
OT_ERROR_INVALID_ARGS
aPskd or aProvisioningUrl is invalid.
OT_ERROR_INVALID_STATE
The IPv6 stack is not enabled or Thread stack is fully enabled.

otJoinerStop

void otJoinerStop(
  otInstance *aInstance
)

This function disables the Thread Joiner role.

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

Macros

OT_JOINER_MAX_DISCERNER_LENGTH

 OT_JOINER_MAX_DISCERNER_LENGTH 64

Maximum length of a Joiner Discerner in bits.