33#ifndef TR_CLI_MAX_LINE
37#define TR_CLI_MAX_LINE 120
40#ifndef TR_CLI_HISTORY_LEN
46#define TR_CLI_HISTORY_LEN 1000
49#ifndef TR_CLI_MAX_ARGC
53#define TR_CLI_MAX_ARGC 16
60#define TR_CLI_PROMPT "trident> "
63#ifndef TR_CLI_MAX_PROMPT_LEN
67#define TR_CLI_MAX_PROMPT_LEN 10
70#ifndef TR_CLI_SERIAL_XLATE
76#define TR_CLI_SERIAL_XLATE 1
79#ifndef TR_CLI_LOCAL_ECHO
83#define TR_CLI_LOCAL_ECHO 1
102#if TR_CLI_HISTORY_LEN
180 void (*put_char)(
char ch));
bool tr_cli_insert_char(char ch)
Adds a new character into the buffer.
#define TR_CLI_MAX_PROMPT_LEN
Maximum number of bytes in the prompt.
Definition tr_cli.h:67
void tr_cli_init(const char *prompt, void(*put_char)(char ch))
Starts up the Embedded CLI subsystem.
int tr_cli_argc(char ***argv)
Parses the internal buffer and returns it as an argc/argv combo.
#define TR_CLI_HISTORY_LEN
Maximum number of bytes to retain of history data.
Definition tr_cli.h:46
void tr_cli_common_printf(const char *pFormat,...)
Printf function used for printing to terminal.
const char * tr_cli_get_history(int history_pos)
Retrieves a history command line.
const char * tr_cli_get_line(void)
Returns the null terminated internal buffer.
#define TR_CLI_MAX_LINE
Maximum number of bytes to accept in a single line.
Definition tr_cli.h:37
void tr_cli_prompt(void)
Outputs the CLI prompt.
#define TR_CLI_MAX_ARGC
Maximum number of arguments we reserve space for.
Definition tr_cli.h:53
void tr_cli_char_received(char data)
Passes a received character to the CLI.
Structure which defines the current state of the CLI.
Definition tr_cli.h:95
int len
Number of characters in buffer at the moment.
Definition tr_cli.h:122
bool have_csi
Flag indicating if we have a CSI sequence.
Definition tr_cli.h:152
char * argv[TR_CLI_MAX_ARGC]
Array of argument strings.
Definition tr_cli.h:162
void * cb_data
Data to provide to the put_char callback.
Definition tr_cli.h:142
bool have_escape
Flag indicating if we have an escape sequence.
Definition tr_cli.h:147
char buffer[TR_CLI_MAX_LINE]
Internal buffer. This should not be accessed directly, use the access functions below.
Definition tr_cli.h:100
void(* put_char)(char ch)
Callback function to output a single character to the user.
Definition tr_cli.h:137
bool done
Have we just parsed a full line?
Definition tr_cli.h:132
char prompt[TR_CLI_MAX_PROMPT_LEN]
CLI prompt string.
Definition tr_cli.h:167
int cursor
Position of the cursor.
Definition tr_cli.h:127
int counter
Counter of the value for the CSI code.
Definition tr_cli.h:157
code for buffering bytes to be sent to the CLI utility
common CLI utility for parsing incoming commands
A simple printf utility for debug prints and cli support. Required for remote CLI to function properl...