Instance
This module includes functions that control the OpenThread Instance.
Summary
Typedefs |
|
---|---|
otChangedFlags
|
typedefuint32_t
This type represents a bit-field indicating specific state/configuration that has changed. |
otInstance
|
typedefstruct otInstance
This structure represents the OpenThread instance structure. |
otStateChangedCallback)(otChangedFlags aFlags, void *aContext)
|
typedefvoid(*
This function pointer is called to notify certain configuration or state changes within OpenThread. |
Functions |
|
---|---|
otGetRadioVersionString(otInstance *aInstance)
|
const char *
This function gets the OpenThread radio version string.
|
otGetVersionString(void)
|
const char *
This function gets the OpenThread version string.
|
otInstanceErasePersistentInfo(otInstance *aInstance)
|
This function erases all the OpenThread persistent info (network settings) stored on non-volatile memory.
|
otInstanceFactoryReset(otInstance *aInstance)
|
void
This method deletes all the settings stored on non-volatile memory, and then triggers platform reset.
|
otInstanceFinalize(otInstance *aInstance)
|
void
This function disables the OpenThread library.
|
otInstanceInit(void *aInstanceBuffer, size_t *aInstanceBufferSize)
|
This function initializes the OpenThread library.
|
otInstanceInitSingle(void)
|
This function initializes the static single instance of the OpenThread library.
|
otInstanceIsInitialized(otInstance *aInstance)
|
bool
This function indicates whether or not the instance is valid/initialized.
|
otInstanceReset(otInstance *aInstance)
|
void
This method triggers a platform reset.
|
otRemoveStateChangeCallback(otInstance *aInstance, otStateChangedCallback aCallback, void *aContext)
|
void
This function removes a callback to indicate when certain configuration or state changes within OpenThread.
|
otSetStateChangedCallback(otInstance *aInstance, otStateChangedCallback aCallback, void *aContext)
|
This function registers a callback to indicate when certain configuration or state changes within OpenThread.
|
Enumerations
anonymous enum
anonymous enum
This enumeration defines flags that are passed as part of otStateChangedCallback
.
Typedefs
otChangedFlags
uint32_t otChangedFlags
This type represents a bit-field indicating specific state/configuration that has changed.
See OT_CHANGED_*
definitions.
otInstance
struct otInstance otInstance
This structure represents the OpenThread instance structure.
otStateChangedCallback
void(* otStateChangedCallback)(otChangedFlags aFlags, void *aContext)
This function pointer is called to notify certain configuration or state changes within OpenThread.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
Functions
otGetRadioVersionString
const char * otGetRadioVersionString( otInstance *aInstance )
This function gets the OpenThread radio version string.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A pointer to the OpenThread radio version.
|
otGetVersionString
const char * otGetVersionString( void )
This function gets the OpenThread version string.
Details | |
---|---|
Returns |
A pointer to the OpenThread version.
|
otInstanceErasePersistentInfo
otError otInstanceErasePersistentInfo( otInstance *aInstance )
This function erases all the OpenThread persistent info (network settings) stored on non-volatile memory.
Erase is successful only if the device is in disabled
state/role.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otInstanceFactoryReset
void otInstanceFactoryReset( otInstance *aInstance )
This method deletes all the settings stored on non-volatile memory, and then triggers platform reset.
Details | |||
---|---|---|---|
Parameters |
|
otInstanceFinalize
void otInstanceFinalize( otInstance *aInstance )
This function disables the OpenThread library.
Call this function when OpenThread is no longer in use.
Details | |||
---|---|---|---|
Parameters |
|
otInstanceInit
otInstance * otInstanceInit( void *aInstanceBuffer, size_t *aInstanceBufferSize )
This function initializes the OpenThread library.
This function initializes OpenThread and prepares it for subsequent OpenThread API calls. This function must be called before any other calls to OpenThread.
This function is available and can only be used when support for multiple OpenThread instances is enabled.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
A pointer to the new OpenThread instance.
|
otInstanceFinalize
otInstanceInitSingle
otInstance * otInstanceInitSingle( void )
This function initializes the static single instance of the OpenThread library.
This function initializes OpenThread and prepares it for subsequent OpenThread API calls. This function must be called before any other calls to OpenThread.
This function is available and can only be used when support for multiple OpenThread instances is disabled.
Details | |
---|---|
Returns |
A pointer to the single OpenThread instance.
|
otInstanceIsInitialized
bool otInstanceIsInitialized( otInstance *aInstance )
This function indicates whether or not the instance is valid/initialized.
The instance is considered valid if it is acquired and initialized using either otInstanceInitSingle()
(in single instance case) or otInstanceInit()
(in multi instance case). A subsequent call to otInstanceFinalize()
causes the instance to be considered as uninitialized.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
TRUE if the given instance is valid/initialized, FALSE otherwise.
|
otInstanceReset
void otInstanceReset( otInstance *aInstance )
This method triggers a platform reset.
The reset process ensures that all the OpenThread state/info (stored in volatile memory) is erased. Note that the otPlatformReset
does not erase any persistent state/info saved in non-volatile memory.
Details | |||
---|---|---|---|
Parameters |
|
otRemoveStateChangeCallback
void otRemoveStateChangeCallback( otInstance *aInstance, otStateChangedCallback aCallback, void *aContext )
This function removes a callback to indicate when certain configuration or state changes within OpenThread.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otSetStateChangedCallback
otError otSetStateChangedCallback( otInstance *aInstance, otStateChangedCallback aCallback, void *aContext )
This function registers a callback to indicate when certain configuration or state changes within OpenThread.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|