Factory Diagnostics - Platform#

This module includes the platform abstraction for diagnostics features.

Enumerations#

enum
OT_GPIO_MODE_INPUT = 0
OT_GPIO_MODE_OUTPUT = 1
}

Defines the gpio modes.

Typedefs#

typedef void(*
otPlatDiagOutputCallback)(const char *aFormat, va_list aArguments, void *aContext)

Pointer to callback to output platform diag messages.

Functions#

void
otPlatDiagSetOutputCallback(otInstance *aInstance, otPlatDiagOutputCallback aCallback, void *aContext)

Sets the platform diag output callback.

otPlatDiagProcess(otInstance *aInstance, uint8_t aArgsLength, char *aArgs[])

Processes a factory diagnostics command line.

void
otPlatDiagModeSet(bool aMode)

Enables/disables the factory diagnostics mode.

bool

Indicates whether or not factory diagnostics mode is enabled.

void
otPlatDiagChannelSet(uint8_t aChannel)

Sets the channel to use for factory diagnostics.

void
otPlatDiagTxPowerSet(int8_t aTxPower)

Sets the transmit power to use for factory diagnostics.

void
otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otError aError)

Processes the received radio frame.

void
otPlatDiagAlarmCallback(otInstance *aInstance)

Processes the alarm event.

otPlatDiagGpioSet(uint32_t aGpio, bool aValue)

Sets the gpio value.

otPlatDiagGpioGet(uint32_t aGpio, bool *aValue)

Gets the gpio value.

otPlatDiagGpioSetMode(uint32_t aGpio, otGpioMode aMode)

Sets the gpio mode.

otPlatDiagGpioGetMode(uint32_t aGpio, otGpioMode *aMode)

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

Defines the gpio modes.

Enumerator
OT_GPIO_MODE_INPUT

Input mode without pull resistor.

OT_GPIO_MODE_OUTPUT

Output mode.


Typedef Documentation#

otPlatDiagOutputCallback#

typedef void(* otPlatDiagOutputCallback) (const char *aFormat, va_list aArguments, void *aContext) )(const char *aFormat, va_list aArguments, void *aContext)

Pointer to callback to output platform diag messages.

Parameters
TypeDirectionArgument NameDescription
[in]aFormat

The format string.

[in]aArguments

The format string arguments.

[out]aContext

A pointer to the user context.


Function Documentation#

otPlatDiagSetOutputCallback#

void otPlatDiagSetOutputCallback (otInstance * aInstance, otPlatDiagOutputCallback aCallback, void * aContext)

Sets the platform diag output callback.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

otPlatDiagOutputCallback[in]aCallback

A pointer to a function that is called on outputting diag messages.

void *[in]aContext

A pointer to the user context.


otPlatDiagProcess#

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

Processes a factory diagnostics command line.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance for current request.

uint8_t[in]aArgsLength

The number of arguments in aArgs.

char *[in]aArgs

The arguments of diagnostics command line.


otPlatDiagModeSet#

void otPlatDiagModeSet (bool aMode)

Enables/disables the factory diagnostics mode.

Parameters
TypeDirectionArgument NameDescription
bool[in]aMode

TRUE to enable diagnostics mode, FALSE otherwise.


otPlatDiagModeGet#

bool otPlatDiagModeGet (void )

Indicates whether or not factory diagnostics mode is enabled.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

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


otPlatDiagChannelSet#

void otPlatDiagChannelSet (uint8_t aChannel)

Sets the channel to use for factory diagnostics.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]aChannel

The channel value.


otPlatDiagTxPowerSet#

void otPlatDiagTxPowerSet (int8_t aTxPower)

Sets the transmit power to use for factory diagnostics.

Parameters
TypeDirectionArgument NameDescription
int8_t[in]aTxPower

The transmit power value.


otPlatDiagRadioReceived#

void otPlatDiagRadioReceived (otInstance * aInstance, otRadioFrame * aFrame, otError aError)

Processes the received radio frame.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance for current request.

otRadioFrame *[in]aFrame

The received radio frame.

otError[in]aError

The received radio frame status.


otPlatDiagAlarmCallback#

void otPlatDiagAlarmCallback (otInstance * aInstance)

Processes the alarm event.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance for current request.


otPlatDiagGpioSet#

otError otPlatDiagGpioSet (uint32_t aGpio, bool aValue)

Sets the gpio value.

Parameters
TypeDirectionArgument NameDescription
uint32_t[in]aGpio

The gpio number.

bool[in]aValue

true to set the gpio to high level, or false otherwise.


otPlatDiagGpioGet#

otError otPlatDiagGpioGet (uint32_t aGpio, bool * aValue)

Gets the gpio value.

Parameters
TypeDirectionArgument NameDescription
uint32_t[in]aGpio

The gpio number.

bool *[out]aValue

A pointer where to put gpio value.


otPlatDiagGpioSetMode#

otError otPlatDiagGpioSetMode (uint32_t aGpio, otGpioMode aMode)

Sets the gpio mode.

Parameters
TypeDirectionArgument NameDescription
uint32_t[in]aGpio

The gpio number.

otGpioMode[out]aMode

The gpio mode.


otPlatDiagGpioGetMode#

otError otPlatDiagGpioGetMode (uint32_t aGpio, otGpioMode * aMode)

Gets the gpio mode.

Parameters
TypeDirectionArgument NameDescription
uint32_t[in]aGpio

The gpio number.

otGpioMode *[out]aMode

A pointer where to put gpio mode.


otPlatDiagRadioSetRawPowerSetting#

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

Set the radio raw power setting for diagnostics module.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

const uint8_t *[in]aRawPowerSetting

A pointer to the raw power setting byte array.

uint16_t[in]aRawPowerSettingLength

The length of the aRawPowerSetting.


otPlatDiagRadioGetRawPowerSetting#

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

Get the radio raw power setting for diagnostics module.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

uint8_t *[out]aRawPowerSetting

A pointer to the raw power setting byte array.

uint16_t *[inout]aRawPowerSettingLength

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


otPlatDiagRadioRawPowerSettingEnable#

otError otPlatDiagRadioRawPowerSettingEnable (otInstance * aInstance, bool aEnable)

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

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

bool[in]aEnable

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


otPlatDiagRadioTransmitCarrier#

otError otPlatDiagRadioTransmitCarrier (otInstance * aInstance, bool aEnable)

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

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

bool[in]aEnable

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


otPlatDiagRadioTransmitStream#

otError otPlatDiagRadioTransmitStream (otInstance * aInstance, bool aEnable)

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

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

bool[in]aEnable

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


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
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

uint8_t[in]aChannel

The radio channel.

int16_t *[out]aTargetPower

The target power in 0.01 dBm.

int16_t *[out]aActualPower

The actual power in 0.01 dBm.

uint8_t *[out]aRawPowerSetting

A pointer to the raw power setting byte array.

uint16_t *[inout]aRawPowerSettingLength

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