Sam Clarke / Mbed 2 deprecated GPS-GPRS_Tracker

Dependencies:   GPS MODSERIAL mbed-rtos mbed

Revision:
4:0e55a4620f5e
Parent:
3:a5df4bd224ad
Child:
5:3a42b208ac4e
diff -r a5df4bd224ad -r 0e55a4620f5e main.cpp
--- a/main.cpp	Sun Oct 07 20:28:32 2012 +0000
+++ b/main.cpp	Mon Oct 08 01:16:13 2012 +0000
@@ -97,24 +97,22 @@
         // Reset the char counter
         i = 0;
     } 
-   if (sscanf(GPRSbuffer, "$$NO CARRIER%s%*d", &dump)>0) {
+   if (strncmp(GPRSbuffer, "$$RING",6) == 0) {
         //dump = "fixed";
-       // GPRS.printf("ATH0\r\n");
+        GPRS.printf("ATH=0\r\n");
         wait(1);
         GPRS.rxBufferFlush();
-        wait(1);
         pc.printf("\nCall recieved");
-        wait(3);
         // 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(4);
+        wait(4);
         // Flush out any left in the serial buffer
-        //GPRS.rxBufferFlush();
+        GPRS.rxBufferFlush();
         // Reset the GPRS buffer
-        //memset(GPRSbuffer, '0', 512);
+        memset(GPRSbuffer, '0', 512);
         // Reset the char counter
-        //i = 0;
+        i = 0;
     } else {
         GPRS.rxBufferFlush();
         // Reset the GPRS buffer