iLLD_TC27xD  1.0
Collaboration diagram for Shell:

Files

file  Ifx_Shell.h
 Shell functions.
 

Basic functionality

void Ifx_Shell_initConfig (Ifx_Shell_Config *config)
 
IFX_EXTERN boolean Ifx_Shell_init (Ifx_Shell *shell, const Ifx_Shell_Config *config)
 Initialize the shell. More...
 
IFX_EXTERN void Ifx_Shell_deinit (Ifx_Shell *shell)
 Deinitialise the shell. More...
 
IFX_EXTERN void Ifx_Shell_enable (Ifx_Shell *shell)
 Clear the receive buffer and enable the shell. More...
 
IFX_EXTERN void Ifx_Shell_disable (Ifx_Shell *shell)
 Disable the shell. More...
 
IFX_EXTERN void Ifx_Shell_process (Ifx_Shell *shell)
 Process the shell. More...
 

Parsing functions

IFX_EXTERN pchar Ifx_Shell_skipWhitespace (pchar args)
 Within the context of Shell.call, skip the whitespaces of the args string. More...
 
IFX_EXTERN boolean Ifx_Shell_matchToken (pchar *argsPtr, pchar token)
 Match string pointed by the *argsPtr with a given token. More...
 
IFX_EXTERN boolean Ifx_Shell_parseToken (pchar *argsPtr, char *tokenBuffer, int bufferLength)
 Parse a token. More...
 
IFX_EXTERN boolean Ifx_Shell_parseAddress (pchar *argsPtr, void **address)
 Parse an address. More...
 
IFX_EXTERN boolean Ifx_Shell_parseSInt32 (pchar *argsPtr, sint32 *value)
 Parse a signed 32-bit integer value. More...
 
IFX_EXTERN boolean Ifx_Shell_parseUInt32 (pchar *argsPtr, uint32 *value, boolean hex)
 Parse an unsigned 32-bit integer value. More...
 
IFX_EXTERN boolean Ifx_Shell_parseSInt64 (pchar *argsPtr, sint64 *value)
 Parse a signed 64-bit integer value. More...
 
IFX_EXTERN boolean Ifx_Shell_parseUInt64 (pchar *argsPtr, uint64 *value, boolean hex)
 Parse an unsigned 64-bit integer value. More...
 
IFX_EXTERN boolean Ifx_Shell_parseFloat64 (pchar *argsPtr, float64 *value)
 Parse a 64-bit (double precision) floating-point value. More...
 
IFX_EXTERN boolean Ifx_Shell_parseFloat32 (pchar *argsPtr, float32 *value)
 Parse a 32-bit (single precision) floating-point value. More...
 

Command list functions

IFX_EXTERN const
Ifx_Shell_Command
Ifx_Shell_commandFind (const Ifx_Shell_Command *commandList, pchar commandLine, pchar *args)
 Find command in commandList. More...
 
IFX_EXTERN boolean Ifx_Shell_showHelpSingle (pchar prefix, const void *commandList, IfxStdIf_DPipe *io)
 Implementation of Ifx_Shell_Call. Show the help menu from single command list. More...
 
IFX_EXTERN boolean Ifx_Shell_showHelp (pchar args, void *shellPtr, IfxStdIf_DPipe *io)
 Implementation of Ifx_Shell_Call. Show the help menu and list of commands. More...
 
IFX_EXTERN void Ifx_Shell_printSyntax (const Ifx_Shell_Syntax *syntaxList, IfxStdIf_DPipe *io)
 Find command in commandList. More...
 

Sub protocol functions

IFX_EXTERN boolean Ifx_Shell_protocolStart (pchar args, void *data, IfxStdIf_DPipe *io)
 Implementation of Ifx_Shell_Call. Start the ShellBb protocol. More...
 
IFX_EXTERN boolean Ifx_Shell_bbProtocolStart (pchar args, void *data, IfxStdIf_DPipe *io)
 Implementation of Ifx_Shell_Call. Start the ShellBb protocol. More...
 

Detailed Description

This module implements the Shell functions.

Function Documentation

IFX_EXTERN boolean Ifx_Shell_bbProtocolStart ( pchar  args,
void *  data,
IfxStdIf_DPipe io 
)

Implementation of Ifx_Shell_Call. Start the ShellBb protocol.

Parameters
argsThe argument null-terminated string
dataPointer to Ifx_Shell object
ioPointer to IfxStdIf_DPipe object

Definition at line 159 of file Ifx_Shell.c.

IFX_EXTERN const Ifx_Shell_Command* Ifx_Shell_commandFind ( const Ifx_Shell_Command commandList,
pchar  commandLine,
pchar args 
)

Find command in commandList.

Parameters
commandListPointer to the first entry of an array of Ifx_Shell_Command
commandLinePointer to null-terminated string containings the command to search.
argsPointer to the argument null-terminated string

Definition at line 817 of file Ifx_Shell.c.

Referenced by Ifx_Shell_commandListFind().

IFX_EXTERN void Ifx_Shell_deinit ( Ifx_Shell shell)

Deinitialise the shell.

Parameters
shellPointer to the Ifx_Shell object

Definition at line 520 of file Ifx_Shell.c.

IFX_EXTERN void Ifx_Shell_disable ( Ifx_Shell shell)

Disable the shell.

Parameters
shellPointer to the Ifx_Shell object

Definition at line 1154 of file Ifx_Shell.c.

IFX_EXTERN void Ifx_Shell_enable ( Ifx_Shell shell)

Clear the receive buffer and enable the shell.

Parameters
shellPointer to the Ifx_Shell object

Definition at line 1145 of file Ifx_Shell.c.

IFX_EXTERN boolean Ifx_Shell_init ( Ifx_Shell shell,
const Ifx_Shell_Config config 
)

Initialize the shell.

Parameters
shellPointer to the Ifx_Shell object
configPointer to the configuration structure

Definition at line 203 of file Ifx_Shell.c.

void Ifx_Shell_initConfig ( Ifx_Shell_Config config)

Set the config default parameter

Parameters
configPointer to the configuration structure to be initialized

Definition at line 180 of file Ifx_Shell.c.

IFX_EXTERN boolean Ifx_Shell_matchToken ( pchar argsPtr,
pchar  token 
)

Match string pointed by the *argsPtr with a given token.

Parameters
argsPtrPointer to the argument null-terminated string
tokenPointer to the token string to match
Return values
TRUEif the given token match with the string pointed by argsPtr

Definition at line 541 of file Ifx_Shell.c.

Referenced by Ifx_Shell_bbProtocolStart(), and Ifx_Shell_protocolStart().

IFX_EXTERN boolean Ifx_Shell_parseAddress ( pchar argsPtr,
void **  address 
)

Parse an address.

Parameters
argsPtrPointer to the argument null-terminated string
addressPointer to the value storage

Definition at line 660 of file Ifx_Shell.c.

IFX_EXTERN boolean Ifx_Shell_parseFloat32 ( pchar argsPtr,
float32 value 
)

Parse a 32-bit (single precision) floating-point value.

Parameters
argsPtrPointer to the argument null-terminated string
valuePointer to the value storage

Definition at line 797 of file Ifx_Shell.c.

IFX_EXTERN boolean Ifx_Shell_parseFloat64 ( pchar argsPtr,
float64 value 
)

Parse a 64-bit (double precision) floating-point value.

Parameters
argsPtrPointer to the argument null-terminated string
valuePointer to the value storage

Definition at line 777 of file Ifx_Shell.c.

IFX_EXTERN boolean Ifx_Shell_parseSInt32 ( pchar argsPtr,
sint32 value 
)

Parse a signed 32-bit integer value.

Parameters
argsPtrPointer to the argument null-terminated string
valuePointer to the value storage

Definition at line 680 of file Ifx_Shell.c.

IFX_EXTERN boolean Ifx_Shell_parseSInt64 ( pchar argsPtr,
sint64 value 
)

Parse a signed 64-bit integer value.

Parameters
argsPtrPointer to the argument null-terminated string
valuePointer to the value storage

Definition at line 722 of file Ifx_Shell.c.

Referenced by Ifx_Shell_parseSInt32().

IFX_EXTERN boolean Ifx_Shell_parseToken ( pchar argsPtr,
char *  tokenBuffer,
int  bufferLength 
)

Parse a token.

Parameters
argsPtrPointer to the argument null-terminated string
tokenBufferPointer to the value storage
bufferLengthMaximum parsing length

Definition at line 593 of file Ifx_Shell.c.

Referenced by Ifx_Shell_commandFind(), Ifx_Shell_matchToken(), Ifx_Shell_parseAddress(), Ifx_Shell_parseFloat32(), Ifx_Shell_parseFloat64(), Ifx_Shell_parseSInt64(), and Ifx_Shell_parseUInt64().

IFX_EXTERN boolean Ifx_Shell_parseUInt32 ( pchar argsPtr,
uint32 value,
boolean  hex 
)

Parse an unsigned 32-bit integer value.

Parameters
argsPtrPointer to the argument null-terminated string
valuePointer to the value storage
hexif TRUE, hex parsing will be done, else decimal parsing

Definition at line 701 of file Ifx_Shell.c.

IFX_EXTERN boolean Ifx_Shell_parseUInt64 ( pchar argsPtr,
uint64 value,
boolean  hex 
)

Parse an unsigned 64-bit integer value.

Parameters
argsPtrPointer to the argument null-terminated string
valuePointer to the value storage
hexif TRUE, hex parsing will be done, else decimal parsing

Definition at line 742 of file Ifx_Shell.c.

Referenced by Ifx_Shell_parseUInt32().

IFX_EXTERN void Ifx_Shell_printSyntax ( const Ifx_Shell_Syntax syntaxList,
IfxStdIf_DPipe io 
)

Find command in commandList.

Parameters
commandListPointer to the first entry of an array of Ifx_Shell_Command
commandLinePointer to null-terminated string containings the command to search.
argsPointer to the argument null-terminated string

Definition at line 1160 of file Ifx_Shell.c.

IFX_EXTERN void Ifx_Shell_process ( Ifx_Shell shell)

Process the shell.

This function shall be called within a loop or periodic timer to guarantee the correct processing of the incoming/received data.

Parameters
shellPointer to the Ifx_Shell object

Definition at line 260 of file Ifx_Shell.c.

IFX_EXTERN boolean Ifx_Shell_protocolStart ( pchar  args,
void *  data,
IfxStdIf_DPipe io 
)

Implementation of Ifx_Shell_Call. Start the ShellBb protocol.

Parameters
argsThe argument null-terminated string
dataPointer to Ifx_Shell object
ioPointer to IfxStdIf_DPipe object

Definition at line 125 of file Ifx_Shell.c.

Referenced by Ifx_Shell_bbProtocolStart().

IFX_EXTERN boolean Ifx_Shell_showHelp ( pchar  args,
void *  shellPtr,
IfxStdIf_DPipe io 
)

Implementation of Ifx_Shell_Call. Show the help menu and list of commands.

Parameters
argsThe argument null-terminated string
shellPtrPointer to a Shell object
ioPointer to IfxStdIf_DPipe object

Definition at line 106 of file Ifx_Shell.c.

IFX_EXTERN boolean Ifx_Shell_showHelpSingle ( pchar  prefix,
const void *  commandList,
IfxStdIf_DPipe io 
)

Implementation of Ifx_Shell_Call. Show the help menu from single command list.

Parameters
prefixPrefix for each command in the commandList
commandListPointer to an array of Ifx_Shell_Command
ioPointer to the IfxStdIf_DPipe object

Definition at line 85 of file Ifx_Shell.c.

Referenced by Ifx_Shell_showHelp().

IFX_EXTERN pchar Ifx_Shell_skipWhitespace ( pchar  args)

Within the context of Shell.call, skip the whitespaces of the args string.

Parameters
argsPointer to the original string
Returns
Pointer to the string after skipping the whitespaces

Definition at line 527 of file Ifx_Shell.c.

Referenced by Ifx_Shell_parseToken().