Short Reply
A short reply message is sent in a single TCP packet. When a telnet command is received, a reply message is generated and sent to the remote telnet client.
In the following example, the telnet command HELP is sent by the Telnet client:
MCB2100> HELP
This command is answered by the predefined help message tnet_help. This message is copied to the output buffer and sent to the remote telnet client. The following code sends the reply message.
U16 tnet_process_cmd (U8 *cmd, U8 *buf, U16 buflen, U32 *pcgi) {
..
if (tnet_ccmp (cmd, "HELP") == __TRUE || tnet_ccmp (cmd, "?") == __TRUE) {
/* 'HELP' command, display help text */
len = str_copy (buf,tnet_help);
return (len);
}
..
}