A library for talking to Multi-Tech's Cellular SocketModem Devices.
Dependents: M2X_dev axeda_wrapper_dev MTS_M2x_Example1 MTS_Cellular_Connect_Example ... more
Diff: wifi/Wifi.cpp
- Revision:
- 113:7238f9b8db17
- Parent:
- 108:554585370b4a
- Child:
- 114:cd34b1d64360
--- a/wifi/Wifi.cpp Tue Dec 31 17:32:57 2013 +0000 +++ b/wifi/Wifi.cpp Tue Dec 31 19:57:21 2013 +0000 @@ -310,12 +310,17 @@ } std::string response = sendCommand("close", 10000, "CLOS"); + //printf("Close Response: %s\n\r", response.c_str()); if(response.find("CLOS") == string::npos) { printf("[ERROR] Failed to successfully close socket\r\n"); return false; } socketOpened = false; + + io->rxClear(); + io->txClear(); + return true; } @@ -416,7 +421,7 @@ printf("[ERROR] Failed to set IP due to mode issue\r\n"); return FAILURE; } - + //Set to DHCP mode if(address.compare("DHCP") == 0) { return sendBasicCommand("set ip dhcp 1", 1000); @@ -539,6 +544,7 @@ std::string response = sendCommand("$$", 2000, "CMD", '$'); if (response.find("CMD") != string::npos) { cmdOn = true; + wait(.5); return true; } printf("[ERROR] Failed to enter command mode\n\r");