Miscellaneous#

This module includes platform abstractions for miscellaneous behaviors.

Enumerations#

enum
OT_PLAT_RESET_REASON_POWER_ON = 0
OT_PLAT_RESET_REASON_EXTERNAL = 1
OT_PLAT_RESET_REASON_SOFTWARE = 2
OT_PLAT_RESET_REASON_FAULT = 3
OT_PLAT_RESET_REASON_CRASH = 4
OT_PLAT_RESET_REASON_ASSERT = 5
OT_PLAT_RESET_REASON_OTHER = 6
OT_PLAT_RESET_REASON_UNKNOWN = 7
OT_PLAT_RESET_REASON_WATCHDOG = 8
OT_PLAT_RESET_REASON_COUNT
}

Enumeration of possible reset reason codes.

enum
OT_PLAT_MCU_POWER_STATE_ON = 0
OT_PLAT_MCU_POWER_STATE_LOW_POWER = 1
OT_PLAT_MCU_POWER_STATE_OFF = 2
}

Enumeration of micro-controller's power states.

Functions#

void
otPlatReset(otInstance *aInstance)

Performs a software reset on the platform, if supported.

otPlatResetToBootloader(otInstance *aInstance)

Performs a hardware reset on the platform to launch bootloader mode, if supported.

otPlatGetResetReason(otInstance *aInstance)

Returns the reason for the last platform reset.

void
otPlatAssertFail(const char *aFilename, int aLineNumber)

Provides a platform specific implementation for assert.

void

Performs a platform specific operation to wake the host MCU.

otPlatSetMcuPowerState(otInstance *aInstance, otPlatMcuPowerState aState)

Sets the desired MCU power state.

otPlatGetMcuPowerState(otInstance *aInstance)

Gets the current desired MCU power state.

Logs a crash dump using OpenThread logging APIs.

Enumeration Documentation#

otPlatResetReason#

otPlatResetReason

Enumeration of possible reset reason codes.

These are in the same order as the Spinel reset reason codes.

Enumerator
OT_PLAT_RESET_REASON_POWER_ON
OT_PLAT_RESET_REASON_EXTERNAL
OT_PLAT_RESET_REASON_SOFTWARE
OT_PLAT_RESET_REASON_FAULT
OT_PLAT_RESET_REASON_CRASH
OT_PLAT_RESET_REASON_ASSERT
OT_PLAT_RESET_REASON_OTHER
OT_PLAT_RESET_REASON_UNKNOWN
OT_PLAT_RESET_REASON_WATCHDOG
OT_PLAT_RESET_REASON_COUNT

Definition at line 80 of file include/openthread/platform/misc.h

otPlatMcuPowerState#

otPlatMcuPowerState

Enumeration of micro-controller's power states.

These values are used for NCP configuration when OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL is enabled.

The power state specifies the desired power state of NCP's micro-controller (MCU) when the underlying platform's operating system enters idle mode (i.e., all active tasks/events are processed and the MCU can potentially enter a energy-saving power state).

The power state primarily determines how the host should interact with the NCP and whether the host needs an external trigger (a "poke") to NCP before it can communicate with the NCP or not.

After a reset, the MCU power state MUST be OT_PLAT_POWER_STATE_ON.

Enumerator
OT_PLAT_MCU_POWER_STATE_ON

NCP's MCU stays on and active all the time.

OT_PLAT_MCU_POWER_STATE_LOW_POWER

NCP's MCU can enter low-power (energy-saving) state.

OT_PLAT_MCU_POWER_STATE_OFF

NCP is fully off.


Definition at line 130 of file include/openthread/platform/misc.h

Function Documentation#

otPlatReset#

void otPlatReset (otInstance * aInstance)

Performs a software reset on the platform, if supported.

Parameters
[in]aInstance

The OpenThread instance structure.


Definition at line 60 of file include/openthread/platform/misc.h

otPlatResetToBootloader#

otError otPlatResetToBootloader (otInstance * aInstance)

Performs a hardware reset on the platform to launch bootloader mode, if supported.

Parameters
[in]aInstance

The OpenThread instance structure.

Used when OPENTHREAD_CONFIG_PLATFORM_BOOTLOADER_MODE_ENABLE is enabled.


Definition at line 73 of file include/openthread/platform/misc.h

otPlatGetResetReason#

otPlatResetReason otPlatGetResetReason (otInstance * aInstance)

Returns the reason for the last platform reset.

Parameters
[in]aInstance

The OpenThread instance structure.


Definition at line 100 of file include/openthread/platform/misc.h

otPlatAssertFail#

void otPlatAssertFail (const char * aFilename, int aLineNumber)

Provides a platform specific implementation for assert.

Parameters
[in]aFilename

The name of the file where the assert occurred.

[in]aLineNumber

The line number in the file where the assert occurred.


Definition at line 108 of file include/openthread/platform/misc.h

otPlatWakeHost#

void otPlatWakeHost (void )

Performs a platform specific operation to wake the host MCU.

Parameters
N/A

This is used only for NCP configurations.


Definition at line 114 of file include/openthread/platform/misc.h

otPlatSetMcuPowerState#

otError otPlatSetMcuPowerState (otInstance * aInstance, otPlatMcuPowerState aState)

Sets the desired MCU power state.

Parameters
[in]aInstance

A pointer to OpenThread instance.

[in]aState

The new MCU power state.

This is only applicable and used for NCP configuration when OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL is enabled.


Definition at line 180 of file include/openthread/platform/misc.h

otPlatGetMcuPowerState#

otPlatMcuPowerState otPlatGetMcuPowerState (otInstance * aInstance)

Gets the current desired MCU power state.

Parameters
[in]aInstance

A pointer to OpenThread instance.

This is only applicable and used for NCP configuration when OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL is enabled.

After a reset, the power state MUST return OT_PLAT_POWER_STATE_ON. During operation, power state SHOULD only change through an explicit successful call to otPlatSetMcuPowerState().

Returns

  • The current power state.


Definition at line 195 of file include/openthread/platform/misc.h

otPlatLogCrashDump#

otError otPlatLogCrashDump (void )

Logs a crash dump using OpenThread logging APIs.

Parameters
N/A

Note

  • This API is an optional logging platform API. It's up to the platform layer to implement it.


Definition at line 205 of file include/openthread/platform/misc.h