Return accuracy in GPS emulation

Accuracy is now a required field for location. To comply, set an
accuracy in returned fix. The accuracy is constant for now since
computing it from the NMEA sentence seems to be very complicated.

Bug: 6864500

Change-Id: Iff4c36b440b095539c717d35a812ee2ed7c1725f
This commit is contained in:
Laurent Tu
2012-10-11 20:41:23 -07:00
parent 9da0812284
commit 91d9d51f5d

View File

@@ -405,6 +405,16 @@ nmea_reader_update_speed( NmeaReader* r,
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
nmea_reader_parse( NmeaReader* r )
@@ -488,6 +498,10 @@ nmea_reader_parse( NmeaReader* r )
tok.p -= 2;
D("unknown sentence '%.*s", tok.end-tok.p, tok.p);
}
// Always update accuracy
nmea_reader_update_accuracy( r );
if (r->fix.flags != 0) {
#if GPS_DEBUG
char temp[256];