@@ -119,9 +119,15 @@ class ArduinoCellular {
119
119
* @param apn The Access Point Name.
120
120
* @param username The APN username.
121
121
* @param password The APN password.
122
+ * @param waitForever The function does not return unless a connection has been established
122
123
* @return True if the connection is successful, false otherwise.
123
124
*/
124
- bool connect (String apn = " " , String username = " " , String password = " " );
125
+ bool connect (String apn = " " , String username = " " , String password = " " , bool waitForever = true );
126
+
127
+ /* *
128
+ * @brief same as previous, username and password are empty
129
+ */
130
+ bool connect (String apn, bool waitForever = true );
125
131
126
132
/* *
127
133
* @brief Checks if the modem is registered on the network.
@@ -259,20 +265,22 @@ class ArduinoCellular {
259
265
*/
260
266
void setDebugStream (Stream& stream);
261
267
262
- private:
263
- bool connectToGPRS (const char * apn, const char * gprsUser, const char * gprsPass);
264
-
265
- /* *
268
+ /* *
266
269
* @brief Gets the SIM card status.
267
270
* @return The SIM card status.
268
271
*/
269
272
SimStatus getSimStatus ();
270
273
274
+ private:
275
+ bool connectToGPRS (const char * apn, const char * gprsUser, const char * gprsPass);
276
+
277
+
271
278
/* *
272
279
* @brief Waits for network registration. (Blocking call)
280
+ * @param waitForever if true the function does not return until a connection has been established
273
281
* @return True if the network registration is successful, false otherwise.
274
282
*/
275
- bool awaitNetworkRegistration ();
283
+ bool awaitNetworkRegistration (bool waitForever );
276
284
277
285
/* *
278
286
* @brief Gets the GPS location. (Blocking call)
0 commit comments