wifly/socket interface for wifly modules

Dependents:   PROJET_MATTHIEU_2019 PROJET_MATTHIEU_2019

Revision:
13:108340829acc
Parent:
12:5ffaed1456c8
Child:
14:352388da9fa5
--- a/Wifly/Wifly.cpp	Fri Aug 24 13:11:20 2012 +0000
+++ b/Wifly/Wifly.cpp	Fri Aug 24 13:25:55 2012 +0000
@@ -43,7 +43,7 @@
 Wifly * Wifly::inst;
 
 Wifly::Wifly(   PinName tx, PinName rx, PinName _reset, PinName tcp_status, const char * ssid, const char * phrase, Security sec):
-    wifi(tx, rx), reset_pin(_reset), tcp_status(tcp_status), buf_wifly(512)
+    wifi(tx, rx), reset_pin(_reset), tcp_status(tcp_status), buf_wifly(256)
 {
     memset(&state, 0, sizeof(state));
     state.sec = sec;
@@ -67,7 +67,7 @@
 
 bool Wifly::join()
 {
-    char cmd[100];
+    char cmd[20];
 
     for (int i= 0; i < MAX_TRY_JOIN; i++) {
         // set time
@@ -145,10 +145,6 @@
                 continue;
         }
 
-        // save
-        if (!sendCommand("save\r", "Stor"))
-            return false;
-
         //join the network
         sprintf(cmd, "join\r");
         if (!sendCommand(cmd, "Associated", NULL, 3000))