Stay organized with collections Save and categorize content based on your preferences.

Factory Diagnostics - Platform

This module includes the platform abstraction for diagnostics features.

Summary

Enumerations

otGpioMode{
  OT_GPIO_MODE_INPUT = 0,
  OT_GPIO_MODE_OUTPUT = 1
}
enum
This enumeration defines the gpio modes.

Functions

otPlatDiagAlarmCallback(otInstance *aInstance)
void
This function processes the alarm event.
otPlatDiagChannelSet(uint8_t aChannel)
void
This function sets the channel to use for factory diagnostics.
otPlatDiagGpioGet(uint32_t aGpio, bool *aValue)
This function gets the gpio value.
otPlatDiagGpioGetMode(uint32_t aGpio, otGpioMode *aMode)
This function gets the gpio mode.
otPlatDiagGpioSet(uint32_t aGpio, bool aValue)
This function sets the gpio value.
otPlatDiagGpioSetMode(uint32_t aGpio, otGpioMode aMode)
This function sets the gpio mode.
otPlatDiagModeGet(void)
bool
This function indicates whether or not factory diagnostics mode is enabled.
otPlatDiagModeSet(bool aMode)
void
This function enables/disables the factory diagnostics mode.
otPlatDiagProcess(otInstance *aInstance, uint8_t aArgsLength, char *aArgs[], char *aOutput, size_t aOutputMaxLen)
This function processes a factory diagnostics command line.
otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
void
This function processes the received radio frame.
otPlatDiagTxPowerSet(int8_t aTxPower)
void
This function sets the transmit power to use for factory diagnostics.

Enumerations

otGpioMode

 otGpioMode

This enumeration defines the gpio modes.

Properties
OT_GPIO_MODE_INPUT

Input mode without pull resistor.

OT_GPIO_MODE_OUTPUT

Output mode.

Functions

otPlatDiagAlarmCallback

void otPlatDiagAlarmCallback(
  otInstance *aInstance
)

This function processes the alarm event.

Details
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.

Details
Parameters
[in] aChannel
The channel value.

otPlatDiagGpioGet

otError otPlatDiagGpioGet(
  uint32_t aGpio,
  bool *aValue
)

This function 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
)

This function 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
)

This function 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
)

This function 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
)

This function 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
)

This function 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[],
  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.

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.
[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.

Details
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.

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.