@@ -35,8 +35,9 @@ void ArduinoCellular::begin() {
35
35
modem.sendAT (" +CNMI=2,1,0,0,0" );
36
36
modem.waitResponse ();
37
37
38
-
38
+ # if defined(ARDUINO_CELLULAR_BEARSSL)
39
39
ArduinoBearSSL.onGetTime (ArduinoCellular::getTime);
40
+ #endif
40
41
41
42
}
42
43
@@ -87,7 +88,7 @@ bool ArduinoCellular::connect(String apn, String username, String password){
87
88
}
88
89
89
90
90
- Location ArduinoCellular::getGPSLocation (unsigned long timeout){
91
+ CellularLocation ArduinoCellular::getGPSLocation (unsigned long timeout){
91
92
if (model == ModemModel::EG25){
92
93
float latitude = 0.00000 ;
93
94
float longitude = 0.00000 ;
@@ -98,7 +99,7 @@ Location ArduinoCellular::getGPSLocation(unsigned long timeout){
98
99
delay (1000 );
99
100
}
100
101
101
- Location loc;
102
+ CellularLocation loc;
102
103
loc.latitude = latitude;
103
104
loc.longitude = longitude;
104
105
@@ -107,7 +108,7 @@ Location ArduinoCellular::getGPSLocation(unsigned long timeout){
107
108
if (this ->debugStream != nullptr ){
108
109
this ->debugStream ->println (" Unsupported modem model" );
109
110
}
110
- return Location ();
111
+ return CellularLocation ();
111
112
}
112
113
}
113
114
@@ -155,13 +156,15 @@ HttpClient ArduinoCellular::getHTTPClient(const char * server, const int port){
155
156
return HttpClient (* new TinyGsmClient (modem), server, port);
156
157
}
157
158
159
+ #if defined(ARDUINO_CELLULAR_BEARSSL)
158
160
HttpClient ArduinoCellular::getHTTPSClient (const char * server, const int port){
159
161
return HttpClient (* new BearSSLClient (* new TinyGsmClient (modem)), server, port);
160
162
}
161
163
162
164
BearSSLClient ArduinoCellular::getSecureNetworkClient (){
163
165
return BearSSLClient (* new TinyGsmClient (modem));
164
166
}
167
+ #endif
165
168
166
169
bool ArduinoCellular::isConnectedToOperator (){
167
170
return modem.isNetworkConnected ();
@@ -214,11 +217,13 @@ bool ArduinoCellular::awaitNetworkRegistration(){
214
217
if (this ->debugStream != nullptr ){
215
218
this ->debugStream ->println (" Waiting for network registration..." );
216
219
}
220
+ /* reduce max wait time */
217
221
while (!modem.waitForNetwork ()) {
218
222
if (this ->debugStream != nullptr ){
219
223
this ->debugStream ->print (" ." );
220
224
}
221
225
delay (2000 );
226
+ /* Add watchdog kik*/
222
227
}
223
228
return true ;
224
229
}
0 commit comments