wiz net library

Dependents:   mywebserver

Fork of WIZnet_Library by WIZnet

Files at this revision

API Documentation at this revision

Comitter:
antanenko
Date:
Sun Jan 24 04:57:23 2016 +0000
Parent:
6:ca8405b9564d
Commit message:
first commit

Changed in this revision

WIZnetInterface/WIZnet/W5100.cpp Show annotated file Show diff for this revision Revisions of this file
WIZnetInterface/WIZnet/W5100.h Show annotated file Show diff for this revision Revisions of this file
WIZnetInterface/WIZnet/wiznet.h Show annotated file Show diff for this revision Revisions of this file
--- a/WIZnetInterface/WIZnet/W5100.cpp	Fri Apr 24 08:19:14 2015 +0000
+++ b/WIZnetInterface/WIZnet/W5100.cpp	Sun Jan 24 04:57:23 2016 +0000
@@ -140,6 +140,17 @@
     return false;
 }
 
+bool WIZnet_Chip::is_fin_received(int socket)
+{
+    uint8_t tmpSn_SR;
+    tmpSn_SR = sreg<uint8_t>(socket, Sn_SR);
+    // packet sending is possible, when state is SOCK_CLOSE_WAIT.
+    if (tmpSn_SR == SOCK_CLOSE_WAIT) {
+        return true;
+    }
+    return false;
+}
+
 void WIZnet_Chip::reset()
 {
     reset_pin = 1;
--- a/WIZnetInterface/WIZnet/W5100.h	Fri Apr 24 08:19:14 2015 +0000
+++ b/WIZnetInterface/WIZnet/W5100.h	Sun Jan 24 04:57:23 2016 +0000
@@ -144,7 +144,7 @@
     * @returns true if successful
     */
     bool is_connected(int socket);
-
+    bool is_fin_received(int socket);
     /*
     * Close a tcp connection
     *
--- a/WIZnetInterface/WIZnet/wiznet.h	Fri Apr 24 08:19:14 2015 +0000
+++ b/WIZnetInterface/WIZnet/wiznet.h	Sun Jan 24 04:57:23 2016 +0000
@@ -22,9 +22,9 @@
 #include "mbed.h"
 #include "mbed_debug.h"
 
-#define USE_W5500
+//#define USE_W5500
 //#define USE_W5200
-//#define USE_W5100
+#define USE_W5100
 
 #if defined(USE_W5500)
 #include "W5500.h"