MDK-ARM Keil, MDK-ARM Datasheet - Page 105

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
Getting Started: Building Applications with RL-ARM
105
Transmission Control Protocol (TCP)
Communication
We will use the same basic PING project in order to establish TCP
communication between the two boards. Of course, this time we must enable the
TCP protocol in place of UDP.
TCP is more complex than UDP.
TCP supports full duplex
communication. TCP configures
one station and port as a server,
which listens for data packets
sent by a client on the specified
port. In order to support full
duplex communication, a TCP connection will use two ports on both stations.
One will receive data and the other will send data. Unlike UDP, the TCP
protocol guarantees delivery of data packets. This means that delivered packets
are acknowledged, lost packets are retransmitted, and data spread over multiple
frames will be delivered in the correct order.
socket_tcp = tcp_get_socket (TCP_TYPE_CLIENT, 0, 10, tcp_callback);
To establish a TCP connection we must first get a free socket. In a similar way
to using UDP, we call a tcp_get_socket() function. We then pass the type of
service and a callback function to handle received packets. In addition, we must
also pass an idle timeout period and a connection type. The basic connection
types are server or client. A client socket can initiate a connection to a remote
server, whereas a server listens for a client connection. It is also possible to
configure a socket as a client-server. This would allow it to both listen for a
connection and initiate a connection. The TCP connection can also be optimized
for large data transfers by enabling an acknowledge delay as shown below.
socket_tcp = tcp_get_socket (TCP_TYPE_CLIENT|TCP-TYPE_DELAY_ACK,
0, 10, tcp_callback);
The TCP protocol is more complex than UDP. Before we can open a TCP port
or send data, we must examine the current port state.
TCPState = tcp_get_state (socket_tcp);

Related parts for MDK-ARM