GPS and GSM interface for remote TCp server

Could you please advice how to use the decode().

Just like this:

    while(gpsSerial.available()) { // check for gps data
      if(gps.encode(gpsSerial.read())) { // encode gps data
        gps.get_position(&lat,&lon,null); // get latitude and longitude

Except that I'd store the character and print it, too. And, I'd position the curly braces better. And, I'd ditch the comments that add no value.

    while(gpsSerial.available())
    {
       char c = gpsSerial.read();
       Serial.print(c);
       if(gps.encode(c))
       {
          gps.get_position(&lat,&lon,null);