wifly/socket interface for wifly modules
Dependents: PROJET_MATTHIEU_2019 PROJET_MATTHIEU_2019
Revision 14:352388da9fa5, committed 2019-05-20
- Comitter:
- robin25
- Date:
- Mon May 20 09:09:10 2019 +0000
- Parent:
- 13:108340829acc
- Commit message:
- ok
Changed in this revision
Wifly/Wifly.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Wifly/Wifly.cpp Fri Aug 24 13:25:55 2012 +0000 +++ b/Wifly/Wifly.cpp Mon May 20 09:09:10 2019 +0000 @@ -20,7 +20,8 @@ #include "Wifly.h" #include <string> #include <algorithm> - +// decoche pour afficher les infos du wifi. +// #define info //Debug is disabled by default #if (0 && defined(TARGET_LPC1768)) #define DBG(x, ...) std::printf("[Wifly : DBG]"x"\r\n", ##__VA_ARGS__); @@ -68,13 +69,13 @@ bool Wifly::join() { char cmd[20]; - for (int i= 0; i < MAX_TRY_JOIN; i++) { // set time if (!sendCommand("set c t 20\r", "AOK")) continue; // set size + if (!sendCommand("set c s 128\r", "AOK")) continue; @@ -83,6 +84,7 @@ continue; // no string sent to the tcp client + if (!sendCommand("set c r 0\r", "AOK")) continue; @@ -158,7 +160,9 @@ exit(); state.associated = true; - INFO("\r\nssid: %s\r\nphrase: %s\r\nsecurity: %s\r\n\r\n", this->ssid, this->phrase, getStringSecurity()); +#ifdef info + INFO("\r\nssid: %s\r\nphrase: %s\r\nsecurity: %s\r\n\r\n", this->ssid, this->phrase, getStringSecurity()); + #endif return true; } return false; @@ -304,7 +308,7 @@ cmdMode(); } if (send(cmd, strlen(cmd), ack, res, timeout) == -1) { - ERR("sendCommand: cannot %s\r\n", cmd); + ERR("sendCommand: cannot %s\r\n", cmd); exit(); return false; }