Merge "Generate position report NMEAs only on final fix"
This commit is contained in:
commit
db2e850287
3 changed files with 401 additions and 376 deletions
|
@ -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)
|
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
|
// Free the allocated memory for rawData
|
||||||
|
|
|
@ -110,7 +110,9 @@ SIDE EFFECTS
|
||||||
|
|
||||||
===========================================================================*/
|
===========================================================================*/
|
||||||
void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
|
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();
|
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 utcMinutes = pTm->tm_min;
|
||||||
int utcSeconds = pTm->tm_sec;
|
int utcSeconds = pTm->tm_sec;
|
||||||
|
|
||||||
|
if (generate_nmea) {
|
||||||
// ------------------
|
// ------------------
|
||||||
// ------$GPGSA------
|
// ------$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));
|
length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
|
||||||
loc_eng_nmea_send(sentence, length, loc_eng_data_p);
|
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
|
// clear the dop cache so they can't be used again
|
||||||
loc_eng_data_p->pdop = 0;
|
loc_eng_data_p->pdop = 0;
|
||||||
loc_eng_data_p->hdop = 0;
|
loc_eng_data_p->hdop = 0;
|
||||||
|
|
|
@ -37,6 +37,6 @@
|
||||||
void loc_eng_nmea_send(char *pNmea, int length, loc_eng_data_s_type *loc_eng_data_p);
|
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);
|
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_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
|
#endif // LOC_ENG_NMEA_H
|
||||||
|
|
Loading…
Reference in a new issue