am 72452858: am 91d9d51f: Return accuracy in GPS emulation

* commit '72452858484192b07e550ae42f9068e3767cf68d':
  Return accuracy in GPS emulation
This commit is contained in:
Laurent Tu
2012-10-12 11:10:10 -07:00
committed by Android Git Automerger

View File

@@ -405,6 +405,16 @@ nmea_reader_update_speed( NmeaReader* r,
return 0; return 0;
} }
static int
nmea_reader_update_accuracy( NmeaReader* r )
{
// Always return 20m accuracy.
// Possibly parse it from the NMEA sentence in the future.
r->fix.flags |= GPS_LOCATION_HAS_ACCURACY;
r->fix.accuracy = 20;
return 0;
}
static void static void
nmea_reader_parse( NmeaReader* r ) nmea_reader_parse( NmeaReader* r )
@@ -488,6 +498,10 @@ nmea_reader_parse( NmeaReader* r )
tok.p -= 2; tok.p -= 2;
D("unknown sentence '%.*s", tok.end-tok.p, tok.p); D("unknown sentence '%.*s", tok.end-tok.p, tok.p);
} }
// Always update accuracy
nmea_reader_update_accuracy( r );
if (r->fix.flags != 0) { if (r->fix.flags != 0) {
#if GPS_DEBUG #if GPS_DEBUG
char temp[256]; char temp[256];