Data Sheet
© Copyright 2013 WIZnet Co.,Ltd. All rights reserved.
52
iEthernet
W5200
ESTABLISHMENT : Check disconnect-request(FIN packet)
Check if the Disconnect-request(FIN packet) has been received. User can confirm the
reception of FIN packet as below.
First method :
{
if (Sn_IR(DISCON) == ‘1’) Sn_IR(DISCON)=‘1’; goto CLOSED stage;
/* In this case, if the interrupt of Socket n is activated, interrupt occurs. Refer to IR, IMR
Sn_IMR and Sn_IR. */
}
Second method :
{
if (Sn_SR == SOCK_CLOSE_WAIT) goto CLOSED stage;
}
ESTABLISHMENT : Check disconnect / disconnecting process
When the user does not need data communication with others, or receives a FIN
packet, disconnect the connection SOCKET.
{
/* set DISCON command */
Sn_CR = DISCON;
}
ESTABLISHMENT : Check closed
Confirm that the Socket n is disconnected or closed by DISCON or close command.
First method :
{
if (Sn_IR(DISCON) == ‘1’) goto CLOSED stage;
/* In this case, if the interrupt of Socket n is activated, interrupt occurs. Refer to IR, IMR
Sn_IMR and Sn_IR. */
}
Second method :
{
if (Sn_SR == SOCK_CLOSED) goto CLOSED stage;
}