Joiner#
This module includes functions for the Thread Joiner role.
Note
- The functions in this module require - OPENTHREAD_CONFIG_JOINER_ENABLE=1.
Modules#
Enumerations#
Defines the Joiner State.
Typedefs#
Defines the Joiner State.
Represents a Joiner Discerner.
Pointer is called to notify the completion of a join operation.
Functions#
Enables the Thread Joiner role.
Disables the Thread Joiner role.
Gets the Joiner State.
Gets the Joiner ID.
Sets the Joiner Discerner.
Gets the Joiner Discerner.
Converts a given joiner state enumeration value to a human-readable string.
Macros#
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 | |
Typedef Documentation#
otJoinerCallback#
typedef void(* otJoinerCallback) (otError aError, void *aContext) )(otError aError, void *aContext)
Pointer is called to notify the completion of a join operation.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| [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#
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.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| otInstance * | [in] | aInstance | A pointer to an OpenThread instance. | 
| const char * | [in] | aPskd | A pointer to the PSKd. | 
| const char * | [in] | aProvisioningUrl | A pointer to the Provisioning URL (may be NULL). | 
| const char * | [in] | aVendorName | A pointer to the Vendor Name (may be NULL). | 
| const char * | [in] | aVendorModel | A pointer to the Vendor Model (may be NULL). | 
| const char * | [in] | aVendorSwVersion | A pointer to the Vendor SW Version (may be NULL). | 
| const char * | [in] | aVendorData | A pointer to the Vendor Data (may be NULL). | 
| otJoinerCallback | [in] | aCallback | A pointer to a function that is called when the join operation completes. | 
| void * | [in] | aContext | A pointer to application-specific context. | 
otJoinerStop#
void otJoinerStop (otInstance * aInstance)
Disables the Thread Joiner role.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| otInstance * | [in] | aInstance | A pointer to an OpenThread instance. | 
otJoinerGetState#
otJoinerState otJoinerGetState (otInstance * aInstance)
Gets the Joiner State.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| otInstance * | [in] | aInstance | A pointer to an OpenThread instance. | 
Returns
- The joiner state. 
otJoinerGetId#
const otExtAddress * otJoinerGetId (otInstance * aInstance)
Gets the Joiner ID.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| otInstance * | [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. 
otJoinerSetDiscerner#
otError otJoinerSetDiscerner (otInstance * aInstance, otJoinerDiscerner * aDiscerner)
Sets the Joiner Discerner.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| otInstance * | [in] | aInstance | A pointer to the OpenThread instance. | 
| otJoinerDiscerner * | [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. 
otJoinerGetDiscerner#
const otJoinerDiscerner * otJoinerGetDiscerner (otInstance * aInstance)
Gets the Joiner Discerner.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| otInstance * | [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. 
otJoinerStateToString#
const char * otJoinerStateToString (otJoinerState aState)
Converts a given joiner state enumeration value to a human-readable string.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| otJoinerState | [in] | aState | The joiner state. | 
Returns
- A human-readable string representation of - aState.