No more update~~ please use W5500Interface.

Fork of EthernetInterfaceW5500 by Bongjun Hur


Bongjun Hur wrote:

NO more update for this library.

Please move to this page W5500Interface for newer version.

Import libraryW5500Interface

This is the Interface library for WIZnet W5500 chip which forked of EthernetInterfaceW5500, WIZnetInterface and WIZ550ioInterface. This library has simple name as "W5500Interface". and can be used for Wiz550io users also.

This Library for W5500 users. no need to use lwIP(or S/W TCP/IP) Some update & code clean for W5500 only refer from WIZ550ioInterface, WIZnetLibrary and WiflyInterface.

Thanks for ban4jp. This library forks of WIZ550ioInterface.

Revision:
10:cadac6bcd169
Parent:
5:fb15c35d1e28
Child:
12:d130abe9d4a8
--- a/Socket/TCPSocketServer.cpp	Mon Dec 23 13:51:35 2013 +0000
+++ b/Socket/TCPSocketServer.cpp	Thu Jul 17 07:10:36 2014 +0000
@@ -21,7 +21,8 @@
 TCPSocketServer::TCPSocketServer() {}
 
 // Server initialization
-int TCPSocketServer::bind(int port) {
+int TCPSocketServer::bind(int port)
+{
     if (_sock_fd < 0) {
         _sock_fd = eth->new_socket();
         if (_sock_fd < 0) {
@@ -37,7 +38,8 @@
     return 0;
 }
 
-int TCPSocketServer::listen(int backlog) {
+int TCPSocketServer::listen(int backlog)
+{
     if (_sock_fd < 0) {
         return -1;
     }
@@ -49,7 +51,8 @@
 }
 
 
-int TCPSocketServer::accept(TCPSocketConnection& connection) {
+int TCPSocketServer::accept(TCPSocketConnection& connection)
+{
     if (_sock_fd < 0) {
         return -1;
     }
@@ -69,6 +72,7 @@
     snprintf(host, sizeof(host), "%d.%d.%d.%d", (ip>>24)&0xff, (ip>>16)&0xff, (ip>>8)&0xff, ip&0xff);
     uint16_t port = eth->sreg<uint16_t>(_sock_fd, Sn_DPORT);
     connection._sock_fd = _sock_fd;
+    connection._is_connected = true;
     connection.set_address(host, port);
     return 0;
 }