File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -231,20 +231,24 @@ bool ArduinoCellular::enableGPS(bool assisted){
231
231
this ->debugStream ->println (" Enabling GPS..." );
232
232
}
233
233
234
+ String response;
235
+
234
236
if (assisted){
235
- sendATCommand (" AT +QGPSCFG=\" agpsposmode\" ,33488767" );
237
+ response = sendATCommand (" +QGPSCFG=\" agpsposmode\" ,33488767" , 10000 );
236
238
} else {
237
- sendATCommand (" AT+QGPSCFG=\" agpsposmode\" ,8388608" );
239
+ // Sets the 23rd bit to 1 to enable standalone GPS
240
+ response = sendATCommand (" +QGPSCFG=\" agpsposmode\" ,8388608" , 10000 );
238
241
}
239
242
240
- // modem.sendAT(GF("+UTIME=1,1"));
241
- // modem.waitResponse();
242
- // modem.sendAT(GF("+UGPIOC=23,0,1"));
243
-
244
- // modem.waitResponse();
243
+ if (response.indexOf (" OK" ) == -1 ){
244
+ if (this ->debugStream != nullptr ){
245
+ this ->debugStream ->println (" Failed to set GPS mode." );
246
+ this ->debugStream ->println (" Response: " + response);
247
+ }
248
+ return false ;
249
+ }
245
250
246
251
return modem.enableGPS ();
247
- // delay(10000);
248
252
}
249
253
250
254
String ArduinoCellular::sendATCommand (const char * command, unsigned long timeout){
You can’t perform that action at this time.
0 commit comments