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:
@@ -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];
|
||||||
|
|||||||
Reference in New Issue
Block a user