Factory Diagnostics - Platform
This module includes the platform abstraction for diagnostics features.
Functions | |
otError | otPlatDiagProcess (otInstance *aInstance, uint8_t aArgsLength, char *aArgs[], char *aOutput, size_t aOutputMaxLen) |
This function processes a factory diagnostics command line. | |
void | otPlatDiagModeSet (bool aMode) |
This function enables/disables the factory diagnostics mode. | |
bool | otPlatDiagModeGet (void) |
This function indicates whether or not factory diagnostics mode is enabled. | |
void | otPlatDiagChannelSet (uint8_t aChannel) |
This function sets the channel to use for factory diagnostics. | |
void | otPlatDiagTxPowerSet (int8_t aTxPower) |
This function sets the transmit power to use for factory diagnostics. | |
void | otPlatDiagRadioReceived (otInstance *aInstance, otRadioFrame *aFrame, otError aError) |
This function processes the received radio frame. | |
void | otPlatDiagAlarmCallback (otInstance *aInstance) |
This function processes the alarm event. | |
otError | otPlatDiagGpioSet (uint32_t aGpio, bool aValue) |
This function sets the gpio value. | |
otError | otPlatDiagGpioGet (uint32_t aGpio, bool *aValue) |
This function gets the gpio value. |
Detailed Description
This module includes the platform abstraction for diagnostics features.
Function Documentation
◆ otPlatDiagAlarmCallback()
void otPlatDiagAlarmCallback | ( | otInstance * | aInstance | ) |
This function processes the alarm event.
- Parameters
-
[in] aInstance
The OpenThread instance for current request.
◆ otPlatDiagChannelSet()
void otPlatDiagChannelSet | ( | uint8_t | aChannel | ) |
This function sets the channel to use for factory diagnostics.
- Parameters
-
[in] aChannel
The channel value.
◆ otPlatDiagGpioGet()
otError otPlatDiagGpioGet | ( | uint32_t | aGpio, |
bool * | aValue |
||
) |
This function gets the gpio value.
- 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_INVALID_ARGS
aGpio
is not supported oraValue
is NULL.OT_ERROR_NOT_IMPLEMENTED
This function is not implemented on the platform.
◆ otPlatDiagGpioSet()
otError otPlatDiagGpioSet | ( | uint32_t | aGpio, |
bool | aValue |
||
) |
This function sets the gpio value.
- 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_INVALID_ARGS
aGpio
is not supported.OT_ERROR_NOT_IMPLEMENTED
This function is not implemented on the platform.
◆ otPlatDiagModeGet()
bool otPlatDiagModeGet | ( | void |
| ) |
This function indicates whether or not factory diagnostics mode is enabled.
- Returns
- TRUE if factory diagnostics mode is enabled, FALSE otherwise.
◆ otPlatDiagModeSet()
void otPlatDiagModeSet | ( | bool | aMode | ) |
This function enables/disables the factory diagnostics mode.
- Parameters
-
[in] aMode
TRUE to enable diagnostics mode, FALSE otherwise.
◆ otPlatDiagProcess()
otError otPlatDiagProcess | ( | otInstance * | aInstance, |
uint8_t | aArgsLength, |
||
char * | aArgs[], |
||
char * | aOutput, |
||
size_t | aOutputMaxLen |
||
) |
This function processes a factory diagnostics command line.
The output of this function (the content written to aOutput
) MUST terminate with \0
and the \0
is within the output buffer.
- 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. [out] aOutput
The diagnostics execution result. [in] aOutputMaxLen
The output buffer size.
- 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.
◆ otPlatDiagRadioReceived()
void otPlatDiagRadioReceived | ( | otInstance * | aInstance, |
otRadioFrame * | aFrame, |
||
otError | aError |
||
) |
This function processes the received radio frame.
- Parameters
-
[in] aInstance
The OpenThread instance for current request. [in] aFrame
The received radio frame. [in] aError
The received radio frame status.
◆ otPlatDiagTxPowerSet()
void otPlatDiagTxPowerSet | ( | int8_t | aTxPower | ) |
This function sets the transmit power to use for factory diagnostics.
- Parameters
-
[in] aTxPower
The transmit power value.