mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-05 00:09:32 -04:00
Fix parsing of RMC NMEA 4.1 (#57204)
This commit is contained in:
parent
b6f929e5d5
commit
1c2250ad64
6
external/nmea/parse.c
vendored
6
external/nmea/parse.c
vendored
@ -415,14 +415,14 @@ int nmea_parse_GPRMC( const char *buff, int buff_sz, nmeaGPRMC *pack )
|
||||
nmea_trace_buff( buff, buff_sz );
|
||||
|
||||
nsen = nmea_scanf( buff, buff_sz,
|
||||
"$G%CRMC,%s,%C,%f,%C,%f,%C,%f,%f,%2d%2d%2d,%f,%C,%C*",
|
||||
"$G%CRMC,%s,%C,%f,%C,%f,%C,%f,%f,%2d%2d%2d,%f,%C,%C,%C*",
|
||||
&( type ), &( time_buff[0] ),
|
||||
&( pack->status ), &( pack->lat ), &( pack->ns ), &( pack->lon ), &( pack->ew ),
|
||||
&( pack->speed ), &( pack->direction ),
|
||||
&( pack->utc.day ), &( pack->utc.mon ), &( pack->utc.year ),
|
||||
&( pack->declination ), &( pack->declin_ew ), &( pack->mode ) );
|
||||
&( pack->declination ), &( pack->declin_ew ), &( pack->mode ), &( pack->navstatus ) );
|
||||
|
||||
if ( nsen != 14 && nsen != 15 )
|
||||
if ( nsen < 14 || nsen > 16 )
|
||||
{
|
||||
nmea_error( "G?RMC parse error!" );
|
||||
return 0;
|
||||
|
2
external/nmea/sentence.h
vendored
2
external/nmea/sentence.h
vendored
@ -118,7 +118,7 @@ typedef struct _nmeaGPRMC
|
||||
double declination; //!< Magnetic variation degrees (Easterly var. subtracts from true course)
|
||||
char declin_ew; //!< [E]ast or [W]est
|
||||
char mode; //!< Mode indicator of fix type (A = autonomous, D = differential, E = estimated, N = not valid, S = simulator)
|
||||
|
||||
char navstatus; //!< NMEA v4.1 - Navigation Status type (S = Safe, C = Caution, U = Unsafe, V = Navigational status not valid)
|
||||
} nmeaGPRMC;
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user