WebSocket client library

Revision:
16:d4518b50f653
Parent:
13:3b058372cad9
Child:
17:1e339933c97a
--- a/Websocket.h	Tue Sep 06 16:44:56 2011 +0000
+++ b/Websocket.h	Wed Sep 21 09:31:36 2011 +0000
@@ -33,6 +33,7 @@
 
 #include "mbed.h"
 #include "Wifly.h"
+
 #include "EthernetNetIf.h"
 #include "TCPSocket.h"
 #include "dnsresolve.h"
@@ -159,31 +160,37 @@
         */
         bool close();
         
+        enum Type {
+            WIF,
+            ETH
+        };
         
     
     private:
+    
         
-        void fillFields(bool wifi, char * url);
-        void onTCPSocketEvent(TCPSocketEvent e);
+        void fillFields(char * url);
         
-        char * ip_domain;
-        char * path;
-        char * port;
+        char ip_domain[30];
+        char path[30];
+        char port[6];
         
         Wifly * wifi;
         
+        void onTCPSocketEvent(TCPSocketEvent e);
         bool eth_connected;
         bool eth_readable;
         bool eth_writeable;
         char eth_rx[512];
         bool response_server_eth;
-        
-        bool wifi_use;
-        bool eth_use;
+        bool new_msg;
         
-        EthernetNetIf eth;
-        TCPSocket sock;
-        IpAddr server_ip;
+        EthernetNetIf * eth;
+        TCPSocket * sock;
+        IpAddr * server_ip;
+        
+        Type netif;
+        
 
 };