NMEA generation change to prevent 2Hz reporting
GPGGA/GPRMC/GPGSA can be reported two times per second in some cases where we lose all satellite signals. We should report these NMEA sentences only from position report to prevent this. CRs-fixed: 884484 Change-Id: I123d9f074ca725703c6e90397160b701033e22f0
This commit is contained in:
parent
fd7b78112e
commit
29a9152e50
2 changed files with 16 additions and 43 deletions
|
@ -793,10 +793,7 @@ void LocEngReportPosition::proc() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (locEng->generateNmea &&
|
if (locEng->generateNmea &&
|
||||||
mLocation.position_source == ULP_LOCATION_IS_FROM_GNSS &&
|
locEng->adapter->isInSession())
|
||||||
mTechMask & (LOC_POS_TECH_MASK_SATELLITE |
|
|
||||||
LOC_POS_TECH_MASK_SENSORS |
|
|
||||||
LOC_POS_TECH_MASK_HYBRID))
|
|
||||||
{
|
{
|
||||||
unsigned char generate_nmea = reported &&
|
unsigned char generate_nmea = reported &&
|
||||||
(mStatus != LOC_SESS_FAILURE);
|
(mStatus != LOC_SESS_FAILURE);
|
||||||
|
|
|
@ -790,29 +790,7 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p,
|
||||||
|
|
||||||
}//if
|
}//if
|
||||||
|
|
||||||
if (svStatus.gps_used_in_fix_mask == 0 &&
|
// cache the used in fix mask, as it will be needed to send $GPGSA
|
||||||
svStatus.glo_used_in_fix_mask == 0 &&
|
|
||||||
svStatus.bds_used_in_fix_mask == 0)
|
|
||||||
{ // No sv used, so there will be no position report, so send
|
|
||||||
// blank NMEA sentences
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ // cache the used in fix mask, as it will be needed to send $GPGSA
|
|
||||||
// during the position report
|
// during the position report
|
||||||
loc_eng_data_p->sv_used_mask = svStatus.gps_used_in_fix_mask;
|
loc_eng_data_p->sv_used_mask = svStatus.gps_used_in_fix_mask;
|
||||||
|
|
||||||
|
@ -832,7 +810,5 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p,
|
||||||
loc_eng_data_p->vdop = 0;
|
loc_eng_data_p->vdop = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
EXIT_LOG(%d, 0);
|
EXIT_LOG(%d, 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue