The Shell functions
The shell contains the following functions:

  • vConsoleLoop
  • vEchoff
  • vEchon
  • iGetChar
  • iPutChar
  • cGetLine

The vConsoleLoop function
Sinopsys
void vConsoleLoop(void)
This function takes data from the serial line and performs the parser of the received string. A string was received after a Enter key was inserted. It executes the command inserted if any and, if an invalid command was inserted it prints the log “Invalid command”.
A valid command is defined in the ptCommandTbl. If the inserted string contains less character than the command name the parser also parses less character, but if two o more commands have the same “beginning” characters the procedure prints the log “Ambigous command”.

The vEchon function
Sinopsys
void vEchon()
Enable the echo on the serial line.

The vEchoff function
Sinopsys
void vEchoff(void)

Disable the echo on the serial line.

The iGetChar function
Sinopsys
int iGetChar(void)
It returns the character received on the serial line.
The function parses the linefeed (replacing with CR) character and handles the backspace and cancel(0x7f) code. If no data is present in the receiver it loops until a character is received.
The function skips the control commands and if the echo is on it echoes the received character.

The iPutChar function
Sinopsys
int iPutChar(int iChar)
Send the character iChar over  the serial line.

 

 

(to be continued…)

The index page