   }
 }
 
-// =====================================================================
-// Analyze the Serial information received after request the information
-// AT+CCPSINF=2
-// =====================================================================
-//AT+CGPSINF=2, get GPS location with format
-//Message ID       = 2
-//UTC time         = [hhmmss.sss]
-//Latitude         = [+/-[0dd.dddd]]
-//N/S indicator    = [N/S]
-//Longitude        = [+/-[0ddd.dddd]]
-//E/W indicator    = [W/E]
-//Position fix     = 1
-//Satellites used  = range 0 to 12
-//HDOP             = x.xx
-//MSL Altitude     = xxx.x
-//Units            = M
-//Geoid Separation = xxx
-//Units            = M
-void GPSAnalyzer(byte b) {
-
-   if ((b != ',')){
+/********************************************************************************
+ * boolean GPSAnalyzer(char *gpsBuffer)
+ * Analyze the Serial information received after request the information 
+ * AT+CCPSINF=2
+ * +CGPSINF: 2,050656.000,0030.2706,N,00120.1007,E,1,9,0.90,51.9,M,7.0,M,,
+ * AT+CGPSINF=2, get GPS location with format
+ * Message ID       = 2
+ * UTC time         = [hhmmss.sss]
+ * Latitude         = [+/-[0dd.dddd]]
+ * N/S indicator    = [N/S]
+ * Longitude        = [+/-[0ddd.dddd]]
+ * E/W indicator    = [W/E]
+ * Position fix     = 1
+ * Satellites used  = range 0 to 12
+ * HDOP             = x.xx
+ * MSL Altitude     = xxx.x
+ * Units            = M
+ * Geoid Separation = xxx
+ * Units            = M
+ * +CGPSINF: 2,050656.000,0030.2706,N,00120.1007,E,1,9,0.90,51.9,M,7.0,M,,
+ ********************************************************************************/
+boolean GPSAnalyzer(char *gpsBuffer) {
+   char *token;
+
+   /* get the first token */
+   Serial.println("****************Content of gpsBuffer*******************");
+   
+   //Command sent
+   token = strtok(gpsBuffer,"\n\r" );
+   if(token != NULL) {
+     Serial.print("Command sent:");   
+     Serial.println(token);     
+   }else return false;
+
+   token = strtok(NULL, ":");   
+   if(token != NULL) {
+     Serial.print("Command response:");   
+     Serial.println(token);     
+   }else return false;
+   
+   //Get CGPSINF_MODE
+   token = strtok(NULL, ",");
+   if(token != NULL) {
+      strcpy(gpsMode,token);
+      Serial.println("************************************************************ ");        
+      Serial.print("CGPSINF_MODE    : ");
+      Serial.println(gpsMode);   
+   }else return false;
+
+
+   //Get time    
+   token = strtok(NULL, ",");
+   if(token != NULL) {
+      strcpy(dateTime,token);
+      Serial.print("TIME            : ");
+      Serial.println(dateTime);        
+   }else return false;
+
+   //Get Latitude
+   token = strtok(NULL, ",");
+   if(token != NULL) {
+      strcpy(latitude,token);
+      Serial.print("LATITUDE        : ");
+      Serial.println(latitude);      
+   }else return false;   
+
+   //Get North or South
+   token = strtok(NULL, ",");
+   if(token != NULL) {
+      strcpy(north_south,token);
+      Serial.print("N/S INDICATOR  : ");
+      Serial.println(north_south);      
+   }else return false;   
+
+   //Get Longitude
+   token = strtok(NULL, ",");
+   if(token != NULL) {
+      strcpy(longitude,token);
+      Serial.print("LONGITUDE       : ");
+      Serial.println(longitude);      
+   }else return false;  
+
+   //Get East or West
+   token = strtok(NULL, ",");
+   if(token != NULL) {
+      strcpy(east_west,token);
+      Serial.print("E/W INDICATOR   : ");
+      Serial.println(east_west);    
+      Serial.println("************************************************************ ");  
+        
+   }else return false;  
+
+   return true;     
+
+/*   if ((b != ',')){
        buffer[pos++] = b;
    }
    

void GetGPSLocation(){
char infoLocation[BUFFER_SIZE];  

 
  while(GPRS.available()){
    GPRS.read();
  } 

SimpleTimer timer;

char* key;
char dateTime[11];
char gpsMode[4];
char latitude[11];
char north_south[2];
char longitude[11];
char east_west[2];
char positionFix[2];
char numSatelite[2];
char hdop[5];
