Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of MTS-Cellular by
Diff: Cellular/UIP.cpp
- Revision:
- 52:2cb58398a4f9
- Parent:
- 51:ffc556ba33f7
- Child:
- 54:a6c738bfc391
diff -r ffc556ba33f7 -r 2cb58398a4f9 Cellular/UIP.cpp --- a/Cellular/UIP.cpp Tue Aug 05 18:35:22 2014 +0000 +++ b/Cellular/UIP.cpp Mon Aug 11 16:03:19 2014 +0000 @@ -46,6 +46,14 @@ bool UIP::connect() { + //Check if APN is not set, if it is not, connect will not work. + if (type == MTSMC_H5_IP || type == MTSMC_H5 || type == MTSMC_G3) { + if(apn.size() == 0) { + logDebug("APN is not set"); + return false; + } + } + //Check if socket is open if(socketOpened) { return true; @@ -91,7 +99,6 @@ } std::string pppResult = sendCommand("AT#CONNECTIONSTART", 120000); - if(pppResult.find("Ok_Info_GprsActivation") != std::string::npos) { std::vector<std::string> parts = Text::split(pppResult, "\r\n"); if(parts.size() >= 2) { @@ -314,8 +321,6 @@ return false; } - - if(io->write(ETX, 1000) != 1) { logError("Timed out attempting to close socket"); return false;