Send feedback
Stay organized with collections
Save and categorize content based on your preferences.
This module includes the platform abstraction for diagnostics features.
Summary
Typedefs
otPlatDiagOutputCallback )(const char *aFormat, va_list aArguments, void *aContext)
typedef
void(*
Pointer to callback to output platform diag messages.
Functions
otPlatDiagAlarmCallback (otInstance *aInstance)
void
Processes the alarm event.
otPlatDiagChannelSet (uint8_t aChannel)
void
Sets the channel to use for factory diagnostics.
otPlatDiagGpioGet (uint32_t aGpio, bool *aValue)
Gets the gpio value.
otPlatDiagGpioGetMode (uint32_t aGpio, otGpioMode *aMode)
Gets the gpio mode.
otPlatDiagGpioSet (uint32_t aGpio, bool aValue)
Sets the gpio value.
otPlatDiagGpioSetMode (uint32_t aGpio, otGpioMode aMode)
Sets the gpio mode.
otPlatDiagModeGet (void)
bool
Indicates whether or not factory diagnostics mode is enabled.
otPlatDiagModeSet (bool aMode)
void
Enables/disables the factory diagnostics mode.
otPlatDiagProcess (otInstance *aInstance, uint8_t aArgsLength, char *aArgs[])
Processes a factory diagnostics command line.
otPlatDiagRadioGetPowerSettings (otInstance *aInstance, uint8_t aChannel, int16_t *aTargetPower, int16_t *aActualPower, uint8_t *aRawPowerSetting, uint16_t *aRawPowerSettingLength)
Get the power settings for the given channel.
otPlatDiagRadioGetRawPowerSetting (otInstance *aInstance, uint8_t *aRawPowerSetting, uint16_t *aRawPowerSettingLength)
Get the radio raw power setting for diagnostics module.
otPlatDiagRadioRawPowerSettingEnable (otInstance *aInstance, bool aEnable)
otPlatDiagRadioReceived (otInstance *aInstance, otRadioFrame *aFrame, otError aError)
void
Processes the received radio frame.
otPlatDiagRadioSetRawPowerSetting (otInstance *aInstance, const uint8_t *aRawPowerSetting, uint16_t aRawPowerSettingLength)
Set the radio raw power setting for diagnostics module.
otPlatDiagRadioTransmitCarrier (otInstance *aInstance, bool aEnable)
Start/stop the platform layer to transmit continuous carrier wave.
otPlatDiagRadioTransmitStream (otInstance *aInstance, bool aEnable)
Start/stop the platform layer to transmit stream of characters.
otPlatDiagSetOutputCallback (otInstance *aInstance, otPlatDiagOutputCallback aCallback, void *aContext)
void
Sets the platform diag output callback.
otPlatDiagTxPowerSet (int8_t aTxPower)
void
Sets the transmit power to use for factory diagnostics.
Enumerations
otGpioMode
otGpioMode
Defines the gpio modes.
Properties
OT_GPIO_MODE_INPUT
Input mode without pull resistor.
OT_GPIO_MODE_OUTPUT
Output mode.
Typedefs
otPlatDiagOutputCallback
void ( * otPlatDiagOutputCallback )( const char * aFormat , va_list aArguments , void * aContext )
Pointer to callback to output platform diag messages.
Details
Parameters
[in] aFormat
The format string.
[in] aArguments
The format string arguments.
[out] aContext
A pointer to the user context.
Functions
otPlatDiagAlarmCallback
void otPlatDiagAlarmCallback(
otInstance *aInstance
)
Processes the alarm event.
Details
Parameters
[in] aInstance
The OpenThread instance for current request.
otPlatDiagChannelSet
void otPlatDiagChannelSet(
uint8_t aChannel
)
Sets the channel to use for factory diagnostics.
Details
Parameters
[in] aChannel
The channel value.
otPlatDiagGpioGet
otError otPlatDiagGpioGet(
uint32_t aGpio,
bool *aValue
)
Gets the gpio value.
Details
Parameters
[in] aGpio
The gpio number.
[out] aValue
A pointer where to put gpio value.
Return Values
OT_ERROR_NONE
Successfully got the gpio value.
OT_ERROR_FAILED
A platform error occurred while getting the gpio value.
OT_ERROR_INVALID_ARGS
aGpio
is not supported or aValue
is NULL.
OT_ERROR_INVALID_STATE
Diagnostic mode was not enabled or aGpio
is not configured as input.
OT_ERROR_NOT_IMPLEMENTED
This function is not implemented or configured on the platform.
otPlatDiagGpioGetMode
otError otPlatDiagGpioGetMode(
uint32_t aGpio,
otGpioMode *aMode
)
Gets the gpio mode.
Details
Parameters
[in] aGpio
The gpio number.
[out] aMode
A pointer where to put gpio mode.
Return Values
OT_ERROR_NONE
Successfully got the gpio mode.
OT_ERROR_FAILED
Mode returned by the platform is not implemented in OpenThread or a platform error occurred while getting the gpio mode.
OT_ERROR_INVALID_ARGS
aGpio
is not supported or aMode
is NULL.
OT_ERROR_INVALID_STATE
Diagnostic mode was not enabled.
OT_ERROR_NOT_IMPLEMENTED
This function is not implemented or configured on the platform.
otPlatDiagGpioSet
otError otPlatDiagGpioSet(
uint32_t aGpio,
bool aValue
)
Sets the gpio value.
Details
Parameters
[in] aGpio
The gpio number.
[in] aValue
true to set the gpio to high level, or false otherwise.
Return Values
OT_ERROR_NONE
Successfully set the gpio.
OT_ERROR_FAILED
A platform error occurred while setting the gpio.
OT_ERROR_INVALID_ARGS
aGpio
is not supported.
OT_ERROR_INVALID_STATE
Diagnostic mode was not enabled or aGpio
is not configured as output.
OT_ERROR_NOT_IMPLEMENTED
This function is not implemented or configured on the platform.
otPlatDiagGpioSetMode
otError otPlatDiagGpioSetMode(
uint32_t aGpio,
otGpioMode aMode
)
Sets the gpio mode.
Details
Parameters
[in] aGpio
The gpio number.
[out] aMode
The gpio mode.
Return Values
OT_ERROR_NONE
Successfully set the gpio mode.
OT_ERROR_FAILED
A platform error occurred while setting the gpio mode.
OT_ERROR_INVALID_ARGS
aGpio
or aMode
is not supported.
OT_ERROR_INVALID_STATE
Diagnostic mode was not enabled.
OT_ERROR_NOT_IMPLEMENTED
This function is not implemented or configured on the platform.
otPlatDiagModeGet
bool otPlatDiagModeGet(
void
)
Indicates whether or not factory diagnostics mode is enabled.
Details
Returns
TRUE if factory diagnostics mode is enabled, FALSE otherwise.
otPlatDiagModeSet
void otPlatDiagModeSet(
bool aMode
)
Enables/disables the factory diagnostics mode.
Details
Parameters
[in] aMode
TRUE to enable diagnostics mode, FALSE otherwise.
otPlatDiagProcess
otError otPlatDiagProcess(
otInstance *aInstance,
uint8_t aArgsLength,
char *aArgs[]
)
Processes a factory diagnostics command line.
Details
Parameters
[in] aInstance
The OpenThread instance for current request.
[in] aArgsLength
The number of arguments in aArgs
.
[in] aArgs
The arguments of diagnostics command line.
Return Values
OT_ERROR_INVALID_ARGS
The command is supported but invalid arguments provided.
OT_ERROR_NONE
The command is successfully process.
OT_ERROR_INVALID_COMMAND
The command is not valid or not supported.
otPlatDiagRadioGetPowerSettings
otError otPlatDiagRadioGetPowerSettings(
otInstance *aInstance,
uint8_t aChannel,
int16_t *aTargetPower,
int16_t *aActualPower,
uint8_t *aRawPowerSetting,
uint16_t *aRawPowerSettingLength
)
Get the power settings for the given channel.
Details
Parameters
[in] aInstance
The OpenThread instance structure.
[in] aChannel
The radio channel.
[out] aTargetPower
The target power in 0.01 dBm.
[out] aActualPower
The actual power in 0.01 dBm.
[out] aRawPowerSetting
A pointer to the raw power setting byte array.
[in,out] aRawPowerSettingLength
On input, a pointer to the size of aRawPowerSetting
. On output, a pointer to the length of the raw power setting data.
Return Values
OT_ERROR_NONE
Successfully got the target power.
OT_ERROR_INVALID_ARGS
The aChannel
is invalid, , aActualPower
, aRawPowerSetting
or aRawPowerSettingLength
is NULL or is too short.
OT_ERROR_NOT_FOUND
The power settings for the aChannel
was not found.
OT_ERROR_NOT_IMPLEMENTED
This method is not implemented.
otPlatDiagRadioGetRawPowerSetting
otError otPlatDiagRadioGetRawPowerSetting(
otInstance *aInstance,
uint8_t *aRawPowerSetting,
uint16_t *aRawPowerSettingLength
)
Get the radio raw power setting for diagnostics module.
Details
Parameters
[in] aInstance
The OpenThread instance structure.
[out] aRawPowerSetting
A pointer to the raw power setting byte array.
[in,out] aRawPowerSettingLength
On input, a pointer to the size of aRawPowerSetting
. On output, a pointer to the length of the raw power setting data.
Return Values
OT_ERROR_NONE
Successfully set the raw power setting.
OT_ERROR_INVALID_ARGS
The aRawPowerSetting
or aRawPowerSettingLength
is NULL or is too short.
OT_ERROR_NOT_FOUND
The raw power setting is not set.
OT_ERROR_NOT_IMPLEMENTED
This method is not implemented.
otPlatDiagRadioRawPowerSettingEnable
otError otPlatDiagRadioRawPowerSettingEnable(
otInstance *aInstance,
bool aEnable
)
Enable/disable the platform layer to use the raw power setting set by otPlatDiagRadioSetRawPowerSetting()
.
Details
Parameters
[in] aInstance
The OpenThread instance structure.
[in] aEnable
TRUE to enable or FALSE to disable the raw power setting.
Return Values
OT_ERROR_NONE
Successfully enabled/disabled the raw power setting.
OT_ERROR_NOT_IMPLEMENTED
This method is not implemented.
otPlatDiagRadioReceived
void otPlatDiagRadioReceived(
otInstance *aInstance,
otRadioFrame *aFrame,
otError aError
)
Processes the received radio frame.
Details
Parameters
[in] aInstance
The OpenThread instance for current request.
[in] aFrame
The received radio frame.
[in] aError
The received radio frame status.
otPlatDiagRadioSetRawPowerSetting
otError otPlatDiagRadioSetRawPowerSetting (
otInstance * aInstance ,
const uint8_t * aRawPowerSetting ,
uint16_t aRawPowerSettingLength
)
Set the radio raw power setting for diagnostics module.
Details
Parameters
[in] aInstance
The OpenThread instance structure.
[in] aRawPowerSetting
A pointer to the raw power setting byte array.
[in] aRawPowerSettingLength
The length of the aRawPowerSetting
.
Return Values
OT_ERROR_NONE
Successfully set the raw power setting.
OT_ERROR_INVALID_ARGS
The aRawPowerSetting
is NULL or the aRawPowerSettingLength
is too long.
OT_ERROR_NOT_IMPLEMENTED
This method is not implemented.
otPlatDiagRadioTransmitCarrier
otError otPlatDiagRadioTransmitCarrier(
otInstance *aInstance,
bool aEnable
)
Start/stop the platform layer to transmit continuous carrier wave.
Details
Parameters
[in] aInstance
The OpenThread instance structure.
[in] aEnable
TRUE to enable or FALSE to disable the platform layer to transmit continuous carrier wave.
Return Values
OT_ERROR_NONE
Successfully enabled/disabled .
OT_ERROR_INVALID_STATE
The radio was not in the Receive state.
OT_ERROR_NOT_IMPLEMENTED
This method is not implemented.
otPlatDiagRadioTransmitStream
otError otPlatDiagRadioTransmitStream(
otInstance *aInstance,
bool aEnable
)
Start/stop the platform layer to transmit stream of characters.
Details
Parameters
[in] aInstance
The OpenThread instance structure.
[in] aEnable
TRUE to enable or FALSE to disable the platform layer to transmit stream.
Return Values
OT_ERROR_NONE
Successfully enabled/disabled.
OT_ERROR_INVALID_STATE
The radio was not in the Receive state.
OT_ERROR_NOT_IMPLEMENTED
This function is not implemented.
otPlatDiagSetOutputCallback
void otPlatDiagSetOutputCallback(
otInstance *aInstance,
otPlatDiagOutputCallback aCallback,
void *aContext
)
Sets the platform diag output callback.
Details
Parameters
[in] aInstance
The OpenThread instance structure.
[in] aCallback
A pointer to a function that is called on outputting diag messages.
[in] aContext
A pointer to the user context.
otPlatDiagTxPowerSet
void otPlatDiagTxPowerSet(
int8_t aTxPower
)
Sets the transmit power to use for factory diagnostics.
Details
Parameters
[in] aTxPower
The transmit power value.
Resources
OpenThread API Reference topics originate from the source code, available
on GitHub .
For more information, or to contribute to our documentation, refer to
Resources .
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates. The OPENTHREAD and related marks are trademarks of the Thread Group and are used under license.
Last updated 2024-06-21 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-21 UTC."],[],[]]