TI-OpenThread  1.08.06.06
Macros | Functions | Variables
CC1352P_2_LAUNCHXL/thread/doorlock_oad_secure/platform/diag.c File Reference
#include <openthread/config.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <openthread/platform/alarm-milli.h>
#include <openthread/platform/diag.h>
#include <openthread/platform/radio.h>
#include <common/logging.hpp>
#include <utils/code_utils.h>
#include "radio.h"
+ Include dependency graph for CC1352P_2_LAUNCHXL/thread/doorlock_oad_secure/platform/diag.c:

Macros

#define PLAT_DIAG_RX_SEQNO_WINDOW   100
 
#define PLAT_DIAG_TX_INTERFRAME   100
 
#define PLAT_DIAG_TX_PACKETSIZE   30
 

Functions

bool otDiagIsEnabled (otInstance *aInstance)
 
void otPlatDiagAlarmCallback (otInstance *aInstance)
 
void otPlatDiagChannelSet (uint8_t aChannel)
 
bool otPlatDiagModeGet ()
 
void otPlatDiagModeSet (bool aMode)
 
otError otPlatDiagProcess (otInstance *aInstance, uint8_t argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
 
void otPlatDiagRadioReceived (otInstance *aInstance, otRadioFrame *aFrame, otError aError)
 
void otPlatDiagTxPowerSet (int8_t aTxPower)
 
unsigned int PlatDiag_calculatePER (void)
 
otError PlatDiag_parseLong (char *aArgVector, long *aValue)
 
otError PlatDiag_processReceive (otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
 
otError PlatDiag_processShield (otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
 
otError PlatDiag_processTone (otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
 
otError PlatDiag_processTransmit (otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
 

Variables

static bool PlatDiag_diagEnabled = false
 
static bool PlatDiag_rxEnabled = false
 
static uint16_t PlatDiag_rxExpectedSeqNo
 
static uint16_t PlatDiag_rxFrameCount
 
static uint16_t PlatDiag_rxLostFrames
 
static uint16_t PlatDiag_rxNokCount
 
static uint16_t PlatDiag_rxReceivedCount
 
static bool PlatDiag_txEnabled = false
 
static uint16_t PlatDiag_txFrameCount
 
static uint16_t PlatDiag_txFrameSize
 
static uint32_t PlatDiag_txPeriod
 
static uint16_t PlatDiag_txSentCount
 

Macro Definition Documentation

§ PLAT_DIAG_RX_SEQNO_WINDOW

#define PLAT_DIAG_RX_SEQNO_WINDOW   100

Window for rx frame to be counted as lost instead of RX nOK.

Workaround for issue of receiving valid 802.15.4 frames counts ad very large sequence numbers.

Referenced by otPlatDiagRadioReceived().

§ PLAT_DIAG_TX_INTERFRAME

#define PLAT_DIAG_TX_INTERFRAME   100

Default interframe spacing used for transmission command.

Referenced by PlatDiag_processTransmit().

§ PLAT_DIAG_TX_PACKETSIZE

#define PLAT_DIAG_TX_PACKETSIZE   30

Default packet size used for transmission command.

Referenced by PlatDiag_processTransmit().

Function Documentation

§ PlatDiag_parseLong()

otError PlatDiag_parseLong ( char *  aArgVector,
long *  aValue 
)

Helper function to parse strings into long variables and mark errors.

Parameters
[in]aArgVectorC string to parse.
[out]aValueaddress of long container.
Return values
OT_ERROR_NONEThe string was parsed correctly.
OT_ERROR_PARSEThe string was not formatted correctly.

Referenced by PlatDiag_processReceive(), PlatDiag_processShield(), and PlatDiag_processTransmit().

§ PlatDiag_calculatePER()

unsigned int PlatDiag_calculatePER ( void  )

Helper function to calculate the Packet Error Rate.

PER value based on PlatDiag_rxFrameCount PlatDiag_rxReceivedCount PlatDiag_rxNokCount and PlatDiag_rxLostFrames.

Returns
Packet Error Rate.

References PlatDiag_rxFrameCount, PlatDiag_rxLostFrames, PlatDiag_rxNokCount, and PlatDiag_rxReceivedCount.

Referenced by PlatDiag_processReceive().

§ PlatDiag_processReceive()

otError PlatDiag_processReceive ( otInstance *  aInstance,
int  argc,
char *  argv[],
char *  aOutput,
size_t  aOutputMaxLen 
)

Process the diag receive command.

Parameters
[in]aInstanceOpenThread instance structure.
[in]argcCount of command arguments.
[in]argvArray of command arguments.
[out]aOutputOutput buffer used for user interaction.
[in]aOutputMaxLenSize of the Output buffer.
Returns
Error value from parsing or executing the command.

References PlatDiag_calculatePER(), PlatDiag_diagEnabled, PlatDiag_parseLong(), PlatDiag_rxEnabled, PlatDiag_rxExpectedSeqNo, PlatDiag_rxFrameCount, PlatDiag_rxLostFrames, PlatDiag_rxNokCount, PlatDiag_rxReceivedCount, and PlatDiag_txEnabled.

Referenced by otPlatDiagProcess().

§ PlatDiag_processTransmit()

otError PlatDiag_processTransmit ( otInstance *  aInstance,
int  argc,
char *  argv[],
char *  aOutput,
size_t  aOutputMaxLen 
)

Process the diag transmit command.

Parameters
[in]aInstanceOpenThread instance structure.
[in]argcCount of command arguments.
[in]argvArray of command arguments.
[out]aOutputOutput buffer used for user interaction.
[in]aOutputMaxLenSize of the Output buffer.
Returns
Error value from parsing or executing the command.

References otPlatAlarmMilliGetNow(), otPlatAlarmMilliStartAt(), otPlatAlarmMilliStop(), PLAT_DIAG_TX_INTERFRAME, PLAT_DIAG_TX_PACKETSIZE, PlatDiag_diagEnabled, PlatDiag_parseLong(), PlatDiag_rxEnabled, PlatDiag_txEnabled, PlatDiag_txFrameCount, PlatDiag_txFrameSize, PlatDiag_txPeriod, and PlatDiag_txSentCount.

Referenced by otPlatDiagProcess().

§ PlatDiag_processTone()

otError PlatDiag_processTone ( otInstance *  aInstance,
int  argc,
char *  argv[],
char *  aOutput,
size_t  aOutputMaxLen 
)

Process the diag tone command.

Parameters
[in]aInstanceOpenThread instance structure.
[in]argcCount of command arguments.
[in]argvArray of command arguments.
[out]aOutputOutput buffer used for user interaction.
[in]aOutputMaxLenSize of the Output buffer.
Returns
Error value from parsing or executing the command.

References otPlatDiagRadioToneStart(), otPlatDiagRadioToneStop(), and PlatDiag_diagEnabled.

Referenced by otPlatDiagProcess().

§ PlatDiag_processShield()

otError PlatDiag_processShield ( otInstance *  aInstance,
int  argc,
char *  argv[],
char *  aOutput,
size_t  aOutputMaxLen 
)

Process the diag shield command.

Parameters
[in]aInstanceOpenThread instance structure.
[in]argcCount of command arguments.
[in]argvArray of command arguments.
[out]aOutputOutput buffer used for user interaction.
[in]aOutputMaxLenSize of the Output buffer.
Returns
Error value from parsing or executing the command.

References PlatDiag_parseLong(), rfCoreDiagChannelDisable(), and rfCoreDiagChannelEnable().

Referenced by otPlatDiagProcess().

§ otPlatDiagProcess()

otError otPlatDiagProcess ( otInstance *  aInstance,
uint8_t  argc,
char *  argv[],
char *  aOutput,
size_t  aOutputMaxLen 
)

Documented in <openthread/platform/diag.h>

References PlatDiag_processReceive(), PlatDiag_processShield(), PlatDiag_processTone(), and PlatDiag_processTransmit().

§ otPlatDiagModeSet()

void otPlatDiagModeSet ( bool  aMode)

Documented in <openthread/platform/diag.h>

References PlatDiag_diagEnabled.

§ otPlatDiagModeGet()

bool otPlatDiagModeGet ( )

Documented in <openthread/platform/diag.h>

References PlatDiag_diagEnabled.

§ otPlatDiagChannelSet()

void otPlatDiagChannelSet ( uint8_t  aChannel)

Documented in <openthread/platform/diag.h>

§ otPlatDiagTxPowerSet()

void otPlatDiagTxPowerSet ( int8_t  aTxPower)

Documented in <openthread/platform/diag.h>

§ otPlatDiagRadioReceived()

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

§ otPlatDiagAlarmCallback()

void otPlatDiagAlarmCallback ( otInstance *  aInstance)

§ otDiagIsEnabled()

bool otDiagIsEnabled ( otInstance *  aInstance)

Documented in <openthread/platform/diag.h>

Variable Documentation

§ PlatDiag_diagEnabled

bool PlatDiag_diagEnabled = false
static

§ PlatDiag_rxEnabled

bool PlatDiag_rxEnabled = false
static

§ PlatDiag_txEnabled

bool PlatDiag_txEnabled = false
static

§ PlatDiag_txPeriod

uint32_t PlatDiag_txPeriod
static

diag transmit variables.

Referenced by otPlatDiagAlarmCallback(), and PlatDiag_processTransmit().

§ PlatDiag_txSentCount

uint16_t PlatDiag_txSentCount
static

§ PlatDiag_txFrameSize

uint16_t PlatDiag_txFrameSize
static

§ PlatDiag_txFrameCount

uint16_t PlatDiag_txFrameCount
static

§ PlatDiag_rxExpectedSeqNo

uint16_t PlatDiag_rxExpectedSeqNo
static

diag receive variables.

Referenced by otPlatDiagRadioReceived(), and PlatDiag_processReceive().

§ PlatDiag_rxFrameCount

uint16_t PlatDiag_rxFrameCount
static

§ PlatDiag_rxLostFrames

uint16_t PlatDiag_rxLostFrames
static

§ PlatDiag_rxNokCount

uint16_t PlatDiag_rxNokCount
static

§ PlatDiag_rxReceivedCount

uint16_t PlatDiag_rxReceivedCount
static
© Copyright 1995-2022, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale