wifly/socket interface for wifly modules

Dependents:   WiFi neurGAI_WIFI thingspeak thingspeak2

Revision:
5:8e253731f76f
Parent:
4:74bfdd00362a
Child:
6:f281180726e8
--- a/Wifly/Wifly.cpp	Thu Aug 23 10:32:45 2012 +0000
+++ b/Wifly/Wifly.cpp	Thu Aug 23 10:37:27 2012 +0000
@@ -42,8 +42,19 @@
     wifi(tx, rx), reset_pin(_reset), tcp_status(tcp_status), buf_wifly(256)
 {
     this->wpa = wpa;
-    this->phrase = phrase;
-    this->ssid = ssid;
+    
+    // change all ' ' in '$' in the ssid and the passphrase
+    strcpy(this->ssid, ssid);
+    for (int i = 0; i < strlen(ssid); i++) {
+        if (this->ssid[i] == ' ')
+            this->ssid[i] = '$';
+    }
+    strcpy(this->phrase, phrase);
+    for (int i = 0; i < strlen(phrase); i++) {
+        if (this->phrase[i] == ' ')
+            this->phrase[i] = '$';
+    }
+    
     inst = this;
     attach_rx(false);
     cmd_mode = false;