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:
- 127:526003734633
- Parent:
- 122:5f95f81a8b03
- Child:
- 130:5a8af68a46ec
- Child:
- 133:da0a2a7b5aa1
--- a/wifi/Wifi.cpp Thu Jan 02 15:52:46 2014 +0000 +++ b/wifi/Wifi.cpp Thu Jan 02 20:17:45 2014 +0000 @@ -17,6 +17,13 @@ return false; } instance->io = io; + + //Check initial state of command mode + std::string response = sendCommand("", 1000, ">"); + if(response.find(">") != string::npos) { + cmdOn = true; + } + //Set device into command mode if (!setCmdMode(true)) { return false; @@ -665,7 +672,7 @@ } } if(timer >= timeoutMillis) { - if(command.compare("reboot") != 0) { + if(!(command.compare("reboot") == 0 || command.compare("") == 0)) { printf("[WARNING] sendCommand [%s] timed out after %d milliseconds\r\n", command.c_str(), timeoutMillis); } done = true;