Command Line Interface.
More...
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "cmdli.h"
|
| void | sunsite_cmd (struct programs_t *progs, struct debug_t *debug, const char c) |
| |
| void | valve_cmd (struct programs_t *progs, struct debug_t *debug, const char c) |
| |
| void | cmdli_clear (struct cmdli_t *cmdli) |
| |
| struct cmdli_t * | cmdli_init (struct cmdli_t *cmdli) |
| |
| void | cmdli_free (struct cmdli_t *cmdli) |
| |
| void | cmdli_help (struct debug_t *debug) |
| |
| void | cmdli_run (char *cmd, struct programs_t *progs, struct debug_t *debug, uint8_t *serno) |
| |
| void | cmdli_exec (char c, struct cmdli_t *cmdli, struct programs_t *progs, struct debug_t *debug, uint8_t *serno) |
| |
◆ cmdli_clear()
| void cmdli_clear |
( |
struct cmdli_t * |
cmdli | ) |
|
◆ cmdli_exec()
Get a char from the users and echo it, compose the command line and, if an \r is entered, execute the command.
- Parameters
-
| c | input char, |
| cmdli | struct with the command line string, |
| progs | the programs structure, |
| debug | needed for printing things. |
◆ cmdli_free()
| void cmdli_free |
( |
struct cmdli_t * |
cmdli | ) |
|
Free the struct from memory.
◆ cmdli_help()
| void cmdli_help |
( |
struct debug_t * |
debug | ) |
|
◆ cmdli_init()
initialize the struct cli and allocate memory.
◆ cmdli_run()
| void cmdli_run |
( |
char * |
cmd, |
|
|
struct programs_t * |
progs, |
|
|
struct debug_t * |
debug, |
|
|
uint8_t * |
serno |
|
) |
| |
Execute an input command:
- Parameters
-
| cmd | char with the command, |
| progs | the programs structure, |
| debug | used to print things. |
◆ sunsite_cmd()
Set or print the sunsite parameter.
- Parameters
-
| progs | ptr to the programs. |
| debug | ptr to the print space. |
| c | if provided the new sunsite position. |
◆ valve_cmd()
Set or print the valve type in use.
- Parameters
-
| progs | ptr to the programs. |
| debug | ptr to the print space. |
| c | if provided the new valve type. |