iLLD_TC27xD
1.0
|
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... | |
This module implements the Shell functions.
IFX_EXTERN boolean Ifx_Shell_bbProtocolStart | ( | pchar | args, |
void * | data, | ||
IfxStdIf_DPipe * | io | ||
) |
Implementation of Ifx_Shell_Call. Start the ShellBb protocol.
args | The argument null-terminated string |
data | Pointer to Ifx_Shell object |
io | Pointer 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.
commandList | Pointer to the first entry of an array of Ifx_Shell_Command |
commandLine | Pointer to null-terminated string containings the command to search. |
args | Pointer 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.
shell | Pointer 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.
shell | Pointer 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.
shell | Pointer 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.
shell | Pointer to the Ifx_Shell object |
config | Pointer 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
config | Pointer 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.
argsPtr | Pointer to the argument null-terminated string |
token | Pointer to the token string to match |
TRUE | if 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.
argsPtr | Pointer to the argument null-terminated string |
address | Pointer 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.
argsPtr | Pointer to the argument null-terminated string |
value | Pointer 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.
argsPtr | Pointer to the argument null-terminated string |
value | Pointer 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.
argsPtr | Pointer to the argument null-terminated string |
value | Pointer 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.
argsPtr | Pointer to the argument null-terminated string |
value | Pointer 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.
argsPtr | Pointer to the argument null-terminated string |
tokenBuffer | Pointer to the value storage |
bufferLength | Maximum 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.
argsPtr | Pointer to the argument null-terminated string |
value | Pointer to the value storage |
hex | if 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.
argsPtr | Pointer to the argument null-terminated string |
value | Pointer to the value storage |
hex | if 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.
commandList | Pointer to the first entry of an array of Ifx_Shell_Command |
commandLine | Pointer to null-terminated string containings the command to search. |
args | Pointer 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.
shell | Pointer 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.
args | The argument null-terminated string |
data | Pointer to Ifx_Shell object |
io | Pointer 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.
args | The argument null-terminated string |
shellPtr | Pointer to a Shell object |
io | Pointer 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.
prefix | Prefix for each command in the commandList |
commandList | Pointer to an array of Ifx_Shell_Command |
io | Pointer 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.
args | Pointer to the original string |
Definition at line 527 of file Ifx_Shell.c.
Referenced by Ifx_Shell_parseToken().