Damien Frost / WiflyInterface

Dependents:   IoT_Ex BatteryModelTester BatteryModelTester

Fork of WiflyInterface by Components

Revision:
25:36b2d76ca8d9
Parent:
24:705480e2e482
Child:
26:eaaedb036df1
--- a/Wifly/Wifly.cpp	Thu Mar 31 14:13:07 2016 +0000
+++ b/Wifly/Wifly.cpp	Thu Mar 31 16:22:37 2016 +0000
@@ -24,9 +24,9 @@
 #define DEBUG
 //Debug is disabled by default
 #ifdef DEBUG
-#define DBG(x, ...) std::printf("[Wifly : DBG]"x"\r\n", ##__VA_ARGS__);
-#define WARN(x, ...) std::printf("[Wifly : WARN]"x"\r\n", ##__VA_ARGS__);
-#define ERR(x, ...) std::printf("[Wifly : ERR]"x"\r\n", ##__VA_ARGS__);
+#define DBG(x, ...) pc.printf("[Wifly : DBG]"x"\r\n", ##__VA_ARGS__);
+#define WARN(x, ...) pc.printf("[Wifly : WARN]"x"\r\n", ##__VA_ARGS__);
+#define ERR(x, ...) pc.printf("[Wifly : ERR]"x"\r\n", ##__VA_ARGS__);
 #else
 #define DBG(x, ...)
 #define WARN(x, ...)
@@ -34,7 +34,7 @@
 #endif
 
 #ifdef DEBUG
-#define INFO(x, ...) std::printf("[Wifly : INFO]"x"\r\n", ##__VA_ARGS__);
+#define INFO(x, ...) pc.printf("[Wifly : INFO]"x"\r\n", ##__VA_ARGS__);
 #else
 #define INFO(x, ...)
 #endif
@@ -44,7 +44,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(256)
+    wifi(tx, rx), reset_pin(_reset), tcp_status(tcp_status), buf_wifly(1024)
 {
     memset(&state, 0, sizeof(state));
     state.sec = sec;
@@ -295,7 +295,6 @@
         string sub = h.substr(0, h.find("."));
         nb_digits = atoi(sub.c_str());
     }
-    //printf("substrL %s\r\n", sub.c_str());
     if (count(h.begin(), h.end(), '.') == 3 && nb_digits > 0) {
         strcpy(ip, host);
     }