sandbox / LWIPInterface

Dependencies:   lwip-eth lwip-sys lwip

Fork of LWIPInterface by Christopher Haster

Revision:
4:a7349bd7776c
Parent:
3:774869068511
Child:
5:2c7d2186543c
--- a/LWIPInterface.h	Mon Feb 29 22:58:45 2016 +0000
+++ b/LWIPInterface.h	Mon Feb 29 23:01:54 2016 +0000
@@ -37,6 +37,21 @@
 
     virtual SocketInterface *createSocket(ns_protocol_t proto);
     virtual void destroySocket(SocketInterface *socket);
+    
+private:
+    // Implementation of the TCP SocketInterface for LWIP
+    struct LWIPSocket : public SocketInterface
+    {
+        LWIPSocket(int fd) : fd(fd) {}
+        int fd;
+
+        // Implementation of SocketInterface
+        virtual int32_t open(const char *ip, uint16_t port);
+        virtual int32_t close();
+
+        virtual int32_t send(const void *data, uint32_t size);
+        virtual int32_t recv(void *data, uint32_t size);
+    };
 };