Sam Clarke / Mbed 2 deprecated GPS-GPRS_Tracker

Dependencies:   GPS MODSERIAL mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
SamClarke
Date:
Mon Oct 08 06:32:46 2012 +0000
Parent:
4:0e55a4620f5e
Child:
6:32c25fb48fd2
Commit message:
Added an incoming call as another trigger for the SMS notification.; You call, it hangs up and sends you its coordinates :)

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Oct 08 01:16:13 2012 +0000
+++ b/main.cpp	Mon Oct 08 06:32:46 2012 +0000
@@ -99,13 +99,14 @@
     } 
    if (strncmp(GPRSbuffer, "$$RING",6) == 0) {
         //dump = "fixed";
-        GPRS.printf("ATH=0\r\n");
+        GPRS.printf("ATH0\r\n");
         wait(1);
+        // Flush any incoming rings in the MODSERIAL buffer
         GPRS.rxBufferFlush();
         pc.printf("\nCall recieved");
         // Do the send SMS routine...
         sendSms();
-        // Wait for the cascade of \r\nOK\r\n\r\nOK\r\n's from the SMS's to finish
+        // Wait for the cascade of [\r\nOK\r\n][\r\nOK\r\n]'s from the SMS's to finish
         wait(4);
         // Flush out any left in the serial buffer
         GPRS.rxBufferFlush();
@@ -128,6 +129,7 @@
     pc.baud(115200);
     GPRS.baud(19200);
     Thread thread(led_thread);
+    memset(GPRSbuffer, '0', 512);
     pc.printf("I'm Alive...\n");
     // Setup the GPS
     gps.Init();