Simple CLI shell header.
More...
Go to the source code of this file.
#define SHELL_MAX_LINE_LENGTH 64 |
Shell maximum input line length.
#define SHELL_MAX_ARGUMENTS 4 |
Shell maximum arguments per command.
typedef void(* shellcmd_t)(vexStream *chp, int argc, char *argv[]) |
Command handler function type.
Shell manager initialization.
Thread* shellCreate |
( |
const ShellConfig * |
scp, |
|
|
size_t |
size, |
|
|
tprio_t |
prio |
|
) |
| |
Spawns a new shell using dynamic memory allocation.
- Parameters
-
[in] | scp | pointer to a ShellConfig object |
[in] | size | size of the shell working area to be allocated |
[in] | prio | priority level for the new shell |
- Returns
- A pointer to the shell thread.
- Return values
-
NULL | thread creation failed because memory allocation. |
- Note
- CH_USE_MALLOC_HEAP and
CH_USE_DYNAMIC
must be enabled.
Thread* shellCreateStatic |
( |
const ShellConfig * |
scp, |
|
|
void * |
wsp, |
|
|
size_t |
size, |
|
|
tprio_t |
prio |
|
) |
| |
Create statically allocated shell thread.
- Parameters
-
[in] | scp | pointer to a ShellConfig object |
[in] | wsp | pointer to a working area dedicated to the shell thread stack |
[in] | size | size of the shell working area to be allocated |
[in] | prio | priority level for the new shell |
- Returns
- A pointer to the shell thread.
bool_t shellGetLine |
( |
vexStream * |
chp, |
|
|
char * |
line, |
|
|
unsigned |
size |
|
) |
| |
Gets a single line of input for the shell.
- Parameters
-
[in] | chp | A pointer to a vexStream object |
[in] | line | A pointer the inpout buffer |
[in] | size | size of the inpout buffer |
- Returns
- True if shell is to be terminated else false