The code below does send a sms but the lat and lon value =000000 and When I type "T" i send an sms with a proper value of lat and lon
void loop() {
char c;
unsigned long timeout = 0UL;
Serial.println("Press 'T' to send coordinates via Text.");
delay(1000);
while (true) {
if (Serial.available()) { // did user hit 'T' key to force text?
c = Serial.read();
while (Serial.available()) // flush buffer
Serial.read();
if (c == 'T' || c == 't') {
ssGprs.listen(); // listen to GPRS while we send coordinates
sendCoord(); // send coordinates as SMS msg
ssGps.listen(); // go back to listening to GPS
}
}
doGpsIo(); // decode next GPS character
if(sendtxt==false){
ssGprs.listen(); // listen to GPRS while we send coordinates
sendCoord(); // send coordinates as SMS msg
ssGps.listen();
}
if (millis() > timeout) { // ever <timeout> secs, check for SMS
if (debugMode)
gpsTest();
ssGprs.listen(); // start listening to GPRS
doSmsMsg(); // check for incoming SMS and respond w/ coordinates
ssGps.listen(); // go back to listening to GPS
timeout = millis() + textScanTimeout * 1000UL; // determine next time to check for SMS
}
} // main while
}