Simple detection for LE910-NA1 modules
Fork of MTS-Cellular by
Diff: Cellular/Cellular.cpp
- Revision:
- 48:3f9d82915e83
- Parent:
- 45:b9ead235ab7c
- Child:
- 50:144099030d9b
--- a/Cellular/Cellular.cpp Fri Aug 01 16:19:39 2014 +0000 +++ b/Cellular/Cellular.cpp Fri Aug 01 21:54:36 2014 +0000 @@ -231,6 +231,12 @@ done = true; } + if (command.find("AT+CMGS=") != string::npos) { + if (result.find('>') != string::npos) { + done = true; + } + } + if(type == MTSMC_H5 || type == MTSMC_G3 || type == MTSMC_EV3 || type == MTSMC_C2) { if (result.find("CONNECT") != std::string::npos) { //Found CONNECT @@ -240,7 +246,7 @@ done = true; } } else if (type == MTSMC_H5_IP || type == MTSMC_EV3_IP || type == MTSMC_C2_IP) { - if (result.find("Ok_Info_")) { + if (result.find("Ok_Info_") != std::string::npos) { done = true; } } @@ -286,7 +292,7 @@ cmd.append(phoneNumber); cmd.append("\",145"); for (int i = 0; i < 5; i++) { - string response1 = sendCommand(cmd, 1000); + string response1 = sendCommand(cmd, 2000); if (response1.find('>') != string::npos) { break; } @@ -368,7 +374,7 @@ break; } //Check for the start of the next SMS message - size_t bodyEnd = received.find("\r\n+CMGL: ", pos); + size_t bodyEnd = received.find("\r\n+CMGL:", pos); if(bodyEnd == std::string::npos) { //This must be the last SMS message bodyEnd = received.find("\r\n\r\nOK", pos);