Command Line Interface
The Embedded Telnet Server calls the tnet_process_cmd() function when a command is received from the user. A command is any sequence of characters that is terminated by the CRLF sequence (the Enter key is pressed). The Telnet Server assembles this command and passes it as an argument to the tnet_process_cmd() function.
The command line interface functions are located in the Telnet_uif.c module. You must copy this module to your project directory, add it to your project, and customize it. You can add new commands or remove existing commands from the module. The module is located in the \Keil\ARM\RL\TCPnet\User folder.
The following functions are implemented in this module:
- tnet_cbfunc() - copies various system messages to the sending buffer for transmission to the Telnet Client. You can also modify this function to support different languages.
- tnet_msg_poll() - polls the upper-layer application for Unsolicited messages.
- tnet_process_cmd() - called by the Telnet Server to process the commands entered by a remote user.
The following functions are optional in this module:
- tnet_accept_host() - used for the telnet server access filtering. It is called when a telnet client is trying to connect to a telnet server.
The following system functions are included in the RL-TCPnet library:
- tnet_ccmp() - compares the content of the command buffer.
- tnet_set_delay() - sets a delay before a repeated call to tnet_proc_cmd(). You can use this function to implement a continuously updating screen.
- tnet_get_info() - called from Telnet_uif.c to obtain the IP address and MAC address of the remote machine.