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:
- 22:c1004a807490
- Parent:
- 19:f6261f1c3dd4
- Child:
- 26:2b769ed8de4f
diff -r 916ef2da10f1 -r c1004a807490 Cellular/UIP.cpp --- a/Cellular/UIP.cpp Tue Jun 17 22:02:22 2014 +0000 +++ b/Cellular/UIP.cpp Thu Jun 19 14:59:35 2014 +0000 @@ -127,8 +127,8 @@ bool UIP::isConnected() { - //1) Check if APN was set if we're on a HSPA radio - if (type == MTSMC_H5_IP) { + //1) Check if APN was set if we're on an HSPA radio + if (type == MTSMC_H5_IP || type == MTSMC_H5 || type == MTSMC_G3) { if(apn.size() == 0) { logDebug("APN is not set"); return false; @@ -583,6 +583,11 @@ for (int i = 0; i < PINGNUM; i++) { response = sendCommand("AT#PING", PINGDELAY * 1000); if (response.find("alive") != std::string::npos) { + /* the "OK" that comes on a new line doesn't come right after this reply + * wait a couple seconds to make sure we get it here, otherwise it could be read + * as the response to the next AT command sent + */ + wait(2); return true; } }