Arduino GPS code question

hello i've tested an arduino code using TinyGPS library and its working however i do not know why one of the functions is used, can someone tell me?

#include <TinyGPS.h>

TinyGPS gps;
static void gpsdump(TinyGPS &gps);
static bool feedgps();

void setup()
{Serial.begin(9600);}

void loop()
{bool newdata = false;
  unsigned long start = millis();
  while (millis() - start < 5000)
  {if (feedgps())
      newdata = true;
  }
 gpsdump(gps);
}

static void gpsdump(TinyGPS &gps)
{float flat, flon;
  gps.f_get_position(&flat, &flon);
  Serial.print(flat);
  Serial.println(flon);
}
static bool feedgps()
{
  while (Serial.available())
  {if (gps.encode(Serial.read()))
      return true; }
  return false;
}

for what is feedGPS used? in the while loop of delay theres a condition there with feedgps whats its importance? and what does the return value do?
thanks

Have you consulted the documentation?

aarg:
Have you consulted the documentation?

Feed the object serial NMEA data one character at a time using the encode() method. (TinyGPS does not handle retrieving serial data from a GPS unit.) When encode() returns “true”, a valid sentence has just changed the TinyGPS object’s internal state.

gps.stats(&chars, &sentences, &failed_checksum);
This stats method provides a clue whether you are getting good data or not. It provides statistics that help with troubleshooting.

chars – the number of characters fed to the object
sentences – the number of valid $GPGGA and $GPRMC sentences processed
failed_checksum – the number of sentences that failed the checksum test

this is what they say about it but i still dont understand it

It is a kludge. The TinyGPS example program tries to do two things at once: print too much data at the wrong time, and keep the GPS input buffer from overflowing. Related thread here, with additional links.

Cheers,
/dev

What feedgps( ) does, is it gets the serial chars arriving from the GPS device, it gets each of those chars, one at a time, and feeds them into the gps parser object, using the encode( ) function of the gps object.

When the gps parser object gets a complete and valid "NMEA sentence", this function returns true, otherwise false.

When you get a true returned from this function, that means you have new information from the gps which you can use for whatever.

Perhaps instead of reading about the GPS, your comprehension of serial communications might be weak.

I suggest you review the tutorial on serial communications, if you can't understand what the code in feedgps( ) does.