Factory Diagnostics - Platform#

This module includes the platform abstraction for diagnostics features.

Enumerations#

enum
OT_GPIO_MODE_INPUT = 0
OT_GPIO_MODE_OUTPUT = 1
}

This enumeration defines the gpio modes.

Functions#

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

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.

otPlatDiagGpioSet(uint32_t aGpio, bool aValue)

This function sets the gpio value.

otPlatDiagGpioGet(uint32_t aGpio, bool *aValue)

This function gets the gpio value.

otPlatDiagGpioSetMode(uint32_t aGpio, otGpioMode aMode)

This function sets the gpio mode.

otPlatDiagGpioGetMode(uint32_t aGpio, otGpioMode *aMode)

This function gets the gpio mode.

otPlatDiagRadioSetRawPowerSetting(otInstance *aInstance, const uint8_t *aRawPowerSetting, uint16_t aRawPowerSettingLength)

Set the radio raw power setting for diagnostics module.

otPlatDiagRadioGetRawPowerSetting(otInstance *aInstance, uint8_t *aRawPowerSetting, uint16_t *aRawPowerSettingLength)

Get the radio raw power setting for diagnostics module.

otPlatDiagRadioRawPowerSettingEnable(otInstance *aInstance, bool aEnable)

Enable/disable the platform layer to use the raw power setting set by otPlatDiagRadioSetRawPowerSetting().

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.

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.

Enumeration Documentation#

otGpioMode#

otGpioMode

This enumeration defines the gpio modes.

Enumerator
OT_GPIO_MODE_INPUT

Input mode without pull resistor.

OT_GPIO_MODE_OUTPUT

Output mode.


Definition at line 63 of file include/openthread/platform/diag.h

Function Documentation#

otPlatDiagProcess#

otError otPlatDiagProcess (otInstance * aInstance, uint8_t aArgsLength, char * aArgs, char * aOutput, size_t aOutputMaxLen)

This function processes a factory diagnostics command line.

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.

The output of this function (the content written to aOutput) MUST terminate with \0 and the \0 is within the output buffer.


Definition at line 86 of file include/openthread/platform/diag.h

otPlatDiagModeSet#

void otPlatDiagModeSet (bool aMode)

This function enables/disables the factory diagnostics mode.

Parameters
[in]aMode

TRUE to enable diagnostics mode, FALSE otherwise.


Definition at line 98 of file include/openthread/platform/diag.h

otPlatDiagModeGet#

bool otPlatDiagModeGet (void )

This function indicates whether or not factory diagnostics mode is enabled.

Parameters
N/A

Returns

  • TRUE if factory diagnostics mode is enabled, FALSE otherwise.


Definition at line 106 of file include/openthread/platform/diag.h

otPlatDiagChannelSet#

void otPlatDiagChannelSet (uint8_t aChannel)

This function sets the channel to use for factory diagnostics.

Parameters
[in]aChannel

The channel value.


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

otPlatDiagTxPowerSet#

void otPlatDiagTxPowerSet (int8_t aTxPower)

This function sets the transmit power to use for factory diagnostics.

Parameters
[in]aTxPower

The transmit power value.


Definition at line 122 of file include/openthread/platform/diag.h

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.


Definition at line 132 of file include/openthread/platform/diag.h

otPlatDiagAlarmCallback#

void otPlatDiagAlarmCallback (otInstance * aInstance)

This function processes the alarm event.

Parameters
[in]aInstance

The OpenThread instance for current request.


Definition at line 140 of file include/openthread/platform/diag.h

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.


Definition at line 155 of file include/openthread/platform/diag.h

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.


Definition at line 170 of file include/openthread/platform/diag.h

otPlatDiagGpioSetMode#

otError otPlatDiagGpioSetMode (uint32_t aGpio, otGpioMode aMode)

This function sets the gpio mode.

Parameters
[in]aGpio

The gpio number.

[out]aMode

The gpio mode.


Definition at line 185 of file include/openthread/platform/diag.h

otPlatDiagGpioGetMode#

otError otPlatDiagGpioGetMode (uint32_t aGpio, otGpioMode * aMode)

This function gets the gpio mode.

Parameters
[in]aGpio

The gpio number.

[out]aMode

A pointer where to put gpio mode.


Definition at line 201 of file include/openthread/platform/diag.h

otPlatDiagRadioSetRawPowerSetting#

otError otPlatDiagRadioSetRawPowerSetting (otInstance * aInstance, const uint8_t * aRawPowerSetting, uint16_t aRawPowerSettingLength)

Set the radio raw power setting for diagnostics module.

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.


Definition at line 215 of file include/openthread/platform/diag.h

otPlatDiagRadioGetRawPowerSetting#

otError otPlatDiagRadioGetRawPowerSetting (otInstance * aInstance, uint8_t * aRawPowerSetting, uint16_t * aRawPowerSettingLength)

Get the radio raw power setting for diagnostics module.

Parameters
[in]aInstance

The OpenThread instance structure.

[out]aRawPowerSetting

A pointer to the raw power setting byte array.

[inout]aRawPowerSettingLength

On input, a pointer to the size of aRawPowerSetting. On output, a pointer to the length of the raw power setting data.


Definition at line 234 of file include/openthread/platform/diag.h

otPlatDiagRadioRawPowerSettingEnable#

otError otPlatDiagRadioRawPowerSettingEnable (otInstance * aInstance, bool aEnable)

Enable/disable the platform layer to use the raw power setting set by otPlatDiagRadioSetRawPowerSetting().

Parameters
[in]aInstance

The OpenThread instance structure.

[in]aEnable

TRUE to enable or FALSE to disable the raw power setting.


Definition at line 248 of file include/openthread/platform/diag.h

otPlatDiagRadioTransmitCarrier#

otError otPlatDiagRadioTransmitCarrier (otInstance * aInstance, bool aEnable)

Start/stop the platform layer to transmit continuous carrier wave.

Parameters
[in]aInstance

The OpenThread instance structure.

[in]aEnable

TRUE to enable or FALSE to disable the platform layer to transmit continuous carrier wave.


Definition at line 261 of file include/openthread/platform/diag.h

otPlatDiagRadioTransmitStream#

otError otPlatDiagRadioTransmitStream (otInstance * aInstance, bool aEnable)

Start/stop the platform layer to transmit stream of characters.

Parameters
[in]aInstance

The OpenThread instance structure.

[in]aEnable

TRUE to enable or FALSE to disable the platform layer to transmit stream.


Definition at line 274 of file include/openthread/platform/diag.h

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.

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.

[inout]aRawPowerSettingLength

On input, a pointer to the size of aRawPowerSetting. On output, a pointer to the length of the raw power setting data.


Definition at line 294 of file include/openthread/platform/diag.h