MDK-ARM Keil, MDK-ARM Datasheet - Page 100

KIT REALVIEW MCU DEVELOPMENT

MDK-ARM

Manufacturer Part Number
MDK-ARM
Description
KIT REALVIEW MCU DEVELOPMENT
Manufacturer
Keil
Type
Compiler and IDEr
Datasheets

Specifications of MDK-ARM

For Use With/related Products
ARM MCUs
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
100
In a simple Telnet server, the amount of data that can be sent to the Telnet client
is limited by the size of the reply buffer buf. However, it is possible to force the
RL-TCPnet library to make multiple calls to the telnet_process_cmd() function.
Then, with each pass through the telnet_process_cmd() function, we can fill the
reply buffer, in order to send multiple packets of data to the client.
U16 tnet_process_cmd (U8 *cmd, U8 *buf, U16 buflen, U16 xcnt)
}
The tnet_process_cmd() function return value contains a repeat flag. The repeat
flag is bit 14. When this bit is set, the RL-TCPnet library will make another call
to the tnet_process_cmd() function. Each time this function is called, the fourth
parameter, xcnt, will be incremented by one. By using the repeat flag and the
pass counter xcnt, the parsing code can send large amounts of data to the Telnet
client.
Exercise: Telnet Server
This exercise extends the basic parser used in the last example to send a long
reply to a client.
Telnet Helper Functions
In addition to the tnet_cbfunc() and tnet_process_cmd() functions, there are
several custom helper functions. We have already seen the tnet_ccmp() function.
This is similar to strcmp(), except that it only compares the string contents up to
the first NULL or space character. Be careful with this function, as all the
characters in the string to be searched are converted to uppercase. The Telnet
server may also determine the MAC and IP address of the client PC. These
values are entered into a structure by calling the tnet_get_info() function.
/*--------------------------------------
*
*--------------------------------------*/
typedef struct remotem
} REMOTEM;
U16 len = 0;
if (repeatcall)
}
return(len);
U8 IpAdr [IP_ADRLEN];
U8 HwAdr [ETH_ADRLEN];
net_config.h
len |=0x4000;
{
{
//client IP address
//Client MAC address
Chapter 4. RL-TCPnet Introduction
{

Related parts for MDK-ARM