Open Garden  0.10.1-21
Functions
cmdli.c File Reference

Command Line Interface. More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "cmdli.h"
Include dependency graph for cmdli.c:

Functions

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_tcmdli_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)
 

Detailed Description

Command Line Interface.

Function Documentation

◆ cmdli_clear()

void cmdli_clear ( struct cmdli_t cmdli)

Clear the cli_t struct

◆ cmdli_exec()

void cmdli_exec ( char  c,
struct cmdli_t cmdli,
struct programs_t progs,
struct debug_t debug,
uint8_t *  serno 
)

Get a char from the users and echo it, compose the command line and, if an \r is entered, execute the command.

Parameters
cinput char,
cmdlistruct with the command line string,
progsthe programs structure,
debugneeded 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)

Print the help.

◆ cmdli_init()

struct cmdli_t* cmdli_init ( struct cmdli_t cmdli)

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
cmdchar with the command,
progsthe programs structure,
debugused to print things.

◆ sunsite_cmd()

void sunsite_cmd ( struct programs_t progs,
struct debug_t debug,
const char  c 
)

Set or print the sunsite parameter.

Parameters
progsptr to the programs.
debugptr to the print space.
cif provided the new sunsite position.

◆ valve_cmd()

void valve_cmd ( struct programs_t progs,
struct debug_t debug,
const char  c 
)

Set or print the valve type in use.

Parameters
progsptr to the programs.
debugptr to the print space.
cif provided the new valve type.