MT7687 API Reference  LinkIt SDK v4
cli_history_s Struct Reference

The MiniCLI control block definition. More...

#include <cli.h>

Data Fields

char ** history
 The pointers to history_max lines of buffer for input. More...
 
char * input
 used to save the current input before pressing "up" the first time
 
char * parse_token
 In cli.c, _cli_do_cmd() will result in the history command to be parsed into tokens, an additional array is required as an input to the #_cli_do_cmd() function to preserve the command history. More...
 
uint16_t history_max
 The maximum number of the lines in history. More...
 
uint16_t line_max
 The size of one history line. More...
 
uint16_t index
 When the user types a command and presses enter, index is the index that will be saved in. More...
 
uint16_t position
 When the user presses up/down, position is the history index displayed on the terminal. More...
 
uint8_t full
 Represents whether the number of history commands exceeded history_max if it is 0, history commands are not full, otherwise the commands are full. More...
 

Detailed Description

The MiniCLI control block definition.

The strcut cli_history_s and its aliased type cli_history_t is defined to aggregate the parameters for MiniCLI to work correctly.

Field Documentation

uint8_t full

Represents whether the number of history commands exceeded history_max if it is 0, history commands are not full, otherwise the commands are full.

char** history

The pointers to history_max lines of buffer for input.

uint16_t history_max

The maximum number of the lines in history.

uint16_t index

When the user types a command and presses enter, index is the index that will be saved in.

uint16_t line_max

The size of one history line.

char* parse_token

In cli.c, _cli_do_cmd() will result in the history command to be parsed into tokens, an additional array is required as an input to the #_cli_do_cmd() function to preserve the command history.

uint16_t position

When the user presses up/down, position is the history index displayed on the terminal.


The documentation for this struct was generated from the following file: