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 31:07c9c5c3fb88, committed 2019-08-02
- Comitter:
- mudassar0121
- Date:
- Fri Aug 02 11:32:14 2019 +0500
- Branch:
- profile_polling
- Parent:
- 30:0f571a4920c8
- Child:
- 32:cba63ca70edc
- Commit message:
- Polling to check profile activation
Changed in this revision
| UbloxATCellularInterface.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/UbloxATCellularInterface.cpp Thu Aug 01 18:06:44 2019 +0500
+++ b/UbloxATCellularInterface.cpp Fri Aug 02 11:32:14 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;