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.
Revision 32:cba63ca70edc, committed 2019-08-05
- Comitter:
- mudassar0121
- Date:
- Mon Aug 05 14:32:15 2019 +0500
- Parent:
- 30:0f571a4920c8
- Parent:
- 31:07c9c5c3fb88
- Child:
- 33:5d5ce25405d4
- Commit message:
- merge branch 'profile_polling' to default
Changed in this revision
--- a/UbloxATCellularInterface.cpp Thu Aug 01 18:06:44 2019 +0500
+++ b/UbloxATCellularInterface.cpp Mon Aug 05 14:32:15 2019 +0500
@@ -274,13 +274,29 @@
success && (protocol <= nsapi_security_to_modem_security(NSAPI_SECURITY_CHAP)); protocol++) {
if ((_auth == NSAPI_SECURITY_UNKNOWN) || (nsapi_security_to_modem_security(_auth) == protocol)) {
if (_at->send("AT+UPSD=" PROFILE ",6,%d", protocol) && _at->recv("OK")) {
- // Activate, waiting 30 seconds for the connection to be made
- at_set_timeout(30000);
- activated = _at->send("AT+UPSDA=" PROFILE ",3") && _at->recv("OK");
+ at_set_timeout(3*60*1000);
+ _at->send("AT+UPSDA=" PROFILE ",3") && _at->recv("OK");
at_set_timeout(at_timeout);
}
}
}
+
+ Timer timer;
+ timer.start();
+ while (timer.read() < 180) {
+ if (_at->send("AT+UPSND=" PROFILE ",8") && _at->recv("+UPSND: %*d,%*d,%d\n", &active) &&
+ _at->recv("OK")) {
+ if (active == 1) {
+ tr_debug("Profile activated successfully");
+ activated = true;
+ break;
+ } else {
+ tr_error("Profile still inactive");
+ rtos::ThisThread::sleep_for(5000); //Wait for 5 seconds and then try again
+ }
+ }
+ }
+ timer.stop();
}
return activated;