Retry

Fork of ublox-at-cellular-interface by u-blox

Files at this revision

API Documentation at this revision

Comitter:
fahim alavi
Date:
Tue Aug 15 12:38:31 2017 +0500
Parent:
8:edac5187d765
Child:
10:9ce5aab0fe54
Commit message:
retry mechanism added

Changed in this revision

UbloxATCellularInterface.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/UbloxATCellularInterface.cpp	Thu Aug 03 13:31:32 2017 +0100
+++ b/UbloxATCellularInterface.cpp	Tue Aug 15 12:38:31 2017 +0500
@@ -276,6 +276,14 @@
                     at_set_timeout(30000);
                     activated = _at->send("AT+UPSDA=" PROFILE ",3") && _at->recv("OK");
                     at_set_timeout(at_timeout);
+
+                    if(!activated)
+                    {
+                    	// 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(at_timeout);
+                    }
                 }
             }
         }