ghj

Fork of WizFi310Interface_Legacy by WIZnet

Revision:
2:7b906ee634bb
Parent:
1:e08ea0ee2788
--- a/WizFi310Interface.cpp	Tue May 02 00:31:36 2017 +0000
+++ b/WizFi310Interface.cpp	Mon Nov 27 05:26:43 2017 +0000
@@ -64,6 +64,8 @@
 	return cmdWLEAVE();
 }
 
+
+
 char* WizFi310Interface::getMACAddress()
 {
     return _state.mac;
@@ -83,5 +85,42 @@
 {
 	return cmdWANT(mode);
 }
+//int WizFi310Interface::test()
+//{
+//	return cmdWSTATUS();
+//}
 
+
+int WizFi310Interface::test1()
+{   
+	// TCPSocketConnection();
+   int errConnect;
+    char http_cmd[1000] = "";
+    char buffer[2048] = "";
+	TCPSocketConnection TCPconnection;
+
+   char *p="arduino-tweet.appspot.com";
+   int a=TCPconnection.connect(p,80);
+  while (true) {
+        if(a!=0) {
+            printf("\r\ncould not connect to socket : error = %d\r\n", p);
+            a = TCPconnection.connect(p, 80);
+        } else {
+            printf("socket connected\r\n");
+            break;
+        }
+    }    
+     
+    sprintf((char *)http_cmd,"GET http://arduino-tweet.appspot.com/update?token=904626807491530753-sOaChz44g9YFS7EuvRkR75l1W9T303K&status=hekllotwitter4562314\r\n");
+
+    TCPconnection.send_all(http_cmd, sizeof(http_cmd));
+    
+    TCPconnection.receive_all(buffer, sizeof(buffer));
+    printf("%s",buffer);
+  
+	
+		return 0;
+	}
 //char* getNetworkMask();
+
+