Generate position report NMEAs only on final fix

Position report NMEAs will be generated only
if the position report is a final fix and not
an intermediate fix. Blank NMEAs will be sent
otherwise.

CRs-fixed: 467575
Change-Id: I60e63faf3e4503f5a6ce93211d4017aa7695b78b
This commit is contained in:
Tushar Janefalkar 2013-03-26 15:52:00 -07:00
parent 4ff37ed47f
commit 6bc10c567a
3 changed files with 401 additions and 376 deletions

View file

@ -1620,7 +1620,10 @@ static void loc_eng_deferred_action_thread(void* arg)
if (loc_eng_data_p->generateNmea && rpMsg->location.position_source == ULP_LOCATION_IS_FROM_GNSS)
{
loc_eng_nmea_generate_pos(loc_eng_data_p, rpMsg->location, rpMsg->locationExtended);
unsigned char generate_nmea = reported && (rpMsg->status != LOC_SESS_FAILURE);
loc_eng_nmea_generate_pos(loc_eng_data_p, rpMsg->location,
rpMsg->locationExtended,
generate_nmea);
}
// Free the allocated memory for rawData

View file

@ -110,7 +110,9 @@ SIDE EFFECTS
===========================================================================*/
void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
const UlpLocation &location, const GpsLocationExtended &locationExtended)
const UlpLocation &location,
const GpsLocationExtended &locationExtended,
unsigned char generate_nmea)
{
ENTRY_LOG();
@ -128,6 +130,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
int utcMinutes = pTm->tm_min;
int utcSeconds = pTm->tm_sec;
if (generate_nmea) {
// ------------------
// ------$GPGSA------
// ------------------
@ -548,6 +551,25 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
loc_eng_nmea_send(sentence, length, loc_eng_data_p);
}
//Send blank NMEA reports for non-final fixes
else {
strlcpy(sentence, "$GPGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence));
length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
loc_eng_nmea_send(sentence, length, loc_eng_data_p);
strlcpy(sentence, "$GPVTG,,T,,M,,N,,K,N", sizeof(sentence));
length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
loc_eng_nmea_send(sentence, length, loc_eng_data_p);
strlcpy(sentence, "$GPRMC,,V,,,,,,,,,,N", sizeof(sentence));
length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
loc_eng_nmea_send(sentence, length, loc_eng_data_p);
strlcpy(sentence, "$GPGGA,,,,,,0,,,,,,,,", sizeof(sentence));
length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
loc_eng_nmea_send(sentence, length, loc_eng_data_p);
}
// clear the dop cache so they can't be used again
loc_eng_data_p->pdop = 0;
loc_eng_data_p->hdop = 0;

View file

@ -37,6 +37,6 @@
void loc_eng_nmea_send(char *pNmea, int length, loc_eng_data_s_type *loc_eng_data_p);
int loc_eng_nmea_put_checksum(char *pNmea, int maxSize);
void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, const GpsSvStatus &svStatus, const GpsLocationExtended &locationExtended);
void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, const UlpLocation &location, const GpsLocationExtended &locationExtended);
void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, const UlpLocation &location, const GpsLocationExtended &locationExtended, unsigned char generate_nmea);
#endif // LOC_ENG_NMEA_H