User Tools

Site Tools


products:w5100s:application:tcp_function

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
products:w5100s:application:tcp_function [2018/04/02 18:27]
lawrence
products:w5100s:application:tcp_function [2018/04/02 18:33] (current)
lawrence
Line 346: Line 346:
 {{:​products:​w5100s:​application:​tcp_client_flow.png|TCP CLIENT Operation Flow}} {{:​products:​w5100s:​application:​tcp_client_flow.png|TCP CLIENT Operation Flow}}
  
-It is same as TCP server except ‘CONNECT’ state. User can refer to the above "TCP SERVER” section.+=== OPEN === 
 +It is the same as "TCP SERVER".
  
 == CONNECT == == CONNECT ==
-Transmit the connect-request (SYN packet) ​to TCP SERVERIt occurs the +SOCKET n is operated as "TCP CLIENT"​ by Sn_CR[CONNECT]. 
-timeout such as ARP<​sub>​TO</​sub>,​ TCP<​sub>​TO</​sub>​ when make the “connection SOCKET” with “TCP SERVER”+SYN Packet is transmitted ​to "TCP SERVER" by Sn_CR[CONNECT].
  
 <code c> <code c>
 { {
-Sn_DIPR0 ​server_ip; /* set TCP SERVER IP address*/ +   /* set Destination IP Address, 192.168.0.11 */ 
-Sn_DPORT0 ​server_port; /* set TCP SERVER listen port number*/ +   ​Sn_DIPR[0:​3] ​={ 0xC0, 0xA8, 0x00, 0x0B}; 
-Sn_CR = CONNECT; /* set CONNECT ​command ​*/+    
 +   /* set Destination PORT Number, 5000(0x1388) ​*/ 
 +   Sn_DPORTR[0:​1] ​{0x13, 0x88}; 
 +    
 +   /* set CONNECT Command ​*/ 
 +   ​Sn_CR = CONNECT
 +   ​while(Sn_CR != 0x00); /* wait until CONNECT ​Command is cleared*/ 
 +   goto ESTABLISHED?;​
 } }
 </​code>​ </​code>​
 +
 +=== ESTABLISHED?​ ===
 +"TCP CLIENT"​ is in Sn_SR (SOCK_SYNSENT) until receiving SYN/ACK Packet from "TCP SERVER"​ against of SYN Packet transmitted. If SYN/ACK Packet is received from ‘TCP SERVER’, the Connection Process between ‘TCP SERVER’ and ‘TCP CLIENT’ is completed. If there is no response from Peer against of transmitted SYN Packet within the Retransmission
 +Time, Sn_IR [TIMEOUT] is set to ‘1’.
 +
 +=== Others flow ===
 +Refer to "TCP SERVER"​ flow.
products/w5100s/application/tcp_function.txt · Last modified: 2018/04/02 18:33 by lawrence