WIZ820io(W5200) network interface, EthernetInterface compatible.

Dependents:   Seeed_Ethernet_Shield_V2_HelloWorld Seeed_Ethernet_Shield Cayenne-WIZ820ioInterface Seeed_Ethernet_Shield

Fork of WiflyInterface by mbed official

WIZ820io

Revision:
5:fb15c35d1e28
Parent:
1:fb4494783863
--- a/Socket/Socket.cpp	Thu Dec 20 15:08:58 2012 +0000
+++ b/Socket/Socket.cpp	Tue Aug 27 12:50:11 2013 +0000
@@ -17,12 +17,12 @@
  */
  
 #include "Socket.h"
-#include <cstring>
 
-Socket::Socket() : _blocking(true), _timeout(1500) {
-    wifi = Wifly::getInstance();
-    if (wifi == NULL)
-        error("Socket constructor error: no wifly instance available!\r\n");
+Socket::Socket() : _sock_fd(-1),_blocking(true), _timeout(1500) {
+    eth = WIZ820io::getInstance();
+    if (eth == NULL) {
+        error("Socket constructor error: no WIZ8820io instance available!\r\n");
+    }       
 }
 
 void Socket::set_blocking(bool blocking, unsigned int timeout) {
@@ -31,7 +31,7 @@
 }
 
 int Socket::close() {
-    return (wifi->close()) ? 0 : -1;
+    return (eth->close(_sock_fd)) ? 0 : -1;
 }
 
 Socket::~Socket() {