Bug#902096: xastir: [Improvement/Patch included] Add support Multi-GNSS receivers (GNRMC/GNGGA sentences)
Package: xastir
Version: 2.0.8-2
Severity: wishlist
Dear Maintainer,
Please find an attached patch to support multi-gnss receivers (added
support for GNRMC/GNGGA NMEA sentences which have strictly the same
format as GPRMC/GPGGA sentences).
I've built it on a debian strech, and it worked fine.
Kind regards.
-- System Information:
Debian Release: 9.4
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.16.0-0.bpo.1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8),
LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages xastir depends on:
ii debconf [debconf-2.0] 1.5.61
ii libax25 0.0.12-rc4-1
ii libbz2-1.0 1.0.6-8.1
ii libc6 2.24-11+deb9u3
ii libcurl3-gnutls 7.52.1-5+deb9u6
ii libdb5.3 5.3.28-12+deb9u1
ii libfreetype6 2.6.3-3.2
ii libgdal20 2.1.2+dfsg-5
ii libgeotiff2 1.4.2-2+b1
ii libgomp1 6.3.0-18+deb9u1
ii libgraphicsmagick-q16-3 1.3.25-8
ii libice6 2:1.0.9-2
ii libjbig0 2.1-3.1+b2
ii libjpeg62-turbo 1:1.5.1-2
ii liblcms2-2 2.8-4
ii liblzma5 5.2.2-1.2+b1
ii libpcre3 2:8.39-3
ii libpng16-16 1.6.28-1
ii libproj12 4.9.3-1
ii libshp2 1.4.0-1
ii libsm6 2:1.2.2-1+b3
ii libtiff5 4.0.8-2+deb9u2
ii libwebp6 0.5.2-1
ii libwmf0.2-7 0.2.8.4-10.6
ii libx11-6 2:1.6.4-3
ii libxext6 2:1.3.3-1+b2
ii libxm4 2.3.4-13
ii libxml2 2.9.4+dfsg1-2.2+deb9u2
ii libxt6 1:1.1.5-1
ii zlib1g 1:1.2.8.dfsg-5
Versions of packages xastir recommends:
ii festival 1:2.4~release-3+b1
ii python 2.7.13-2
Versions of packages xastir suggests:
ii direwolf 1.3-2
-- debconf information:
* xastir/install-setuid: true
Index: xastir-2.0.8/src/db.c
===================================================================
--- xastir-2.0.8.orig/src/db.c
+++ xastir-2.0.8/src/db.c
@@ -17319,9 +17319,9 @@ void decode_info_field(char *call,
fprintf(stderr,"decode_info_field: $ (raw gps or ultimeter 2000)\n");
if (strncmp("ULTW",message,4) == 0 && is_xnum_or_dash(message+4,44))
done = data_add(APRS_WX5,call,path,message+4,from,port,origin,third_party, station_is_mine, 0);
- else if (strncmp("GPGGA",message,5) == 0)
+ else if (strncmp("GPGGA",message,5) == 0 || strncmp("GNGGA",message,5) == 0)
done = data_add(GPS_GGA,call,path,message,from,port,origin,third_party, station_is_mine, 0);
- else if (strncmp("GPRMC",message,5) == 0)
+ else if (strncmp("GPRMC",message,5) == 0 || strncmp("GNRMC",message,5) == 0)
done = data_add(GPS_RMC,call,path,message,from,port,origin,third_party, station_is_mine, 0);
else if (strncmp("GPGLL",message,5) == 0)
done = data_add(GPS_GLL,call,path,message,from,port,origin,third_party, station_is_mine, 0);
Index: xastir-2.0.8/src/gps.c
===================================================================
--- xastir-2.0.8.orig/src/gps.c
+++ xastir-2.0.8/src/gps.c
@@ -139,7 +139,7 @@ int decode_gps_rmc( char *data,
if ( (data == NULL) || (strlen(data) < 37) )
return(0); // Not enough data to parse position from.
- if (strncmp(data,"$GPRMC,",7) != 0) // No GPRMC found
+ if ( (strncmp(data,"$GPRMC,",7) != 0) && (strncmp(data,"$GNRMC,",7) != 0) ) // No GPRMC found
return(0);
if(strchr(data,',') == NULL) // No comma found
@@ -393,7 +393,7 @@ int decode_gps_gga( char *data,
if ( (data == NULL) || (strlen(data) < 35) ) // Not enough data to parse position from.
return(0);
- if (strncmp(data,"$GPGGA,",7) != 0)
+ if ( (strncmp(data,"$GPGGA,",7) != 0) && (strncmp(data,"$GNGGA,",7) != 0) )
return(0);
if (strchr(data,',') == NULL)
@@ -564,7 +564,7 @@ int gps_data_find(char *gps_line_data, i
- if (strncmp(gps_line_data,"$GPRMC,",7)==0) {
+ if (strncmp(gps_line_data,"$GPRMC,",7)==0 || strncmp(gps_line_data,"$GNRMC,",7)==0) {
if (debug_level & 128) {
char filtered_data[MAX_LINE_SIZE+1];
@@ -652,7 +652,7 @@ DISABLE_SETUID_PRIVILEGE;
}
}
- if (strncmp(gps_line_data,"$GPGGA,",7)==0) {
+ if (strncmp(gps_line_data,"$GPGGA,",7)==0 || strncmp(gps_line_data,"$GNGGA,",7)==0) {
if (debug_level & 128) {
char filtered_data[MAX_LINE_SIZE+1];
Index: xastir-2.0.8/src/interface.c
===================================================================
--- xastir-2.0.8.orig/src/interface.c
+++ xastir-2.0.8/src/interface.c
@@ -1470,7 +1470,7 @@ void channel_data(int port, unsigned cha
// GPRMC and GPGGA strings into global variables.
// Drop other GPS strings on the floor.
//
- if ( (length > 7) && (strncmp((char *)string,"$GPRMC,",7) == 0) ) {
+ if ( (length > 7) && ( (strncmp((char *)string,"$GPRMC,",7) == 0) || (strncmp((char *)string,"$GNRMC,",7) == 0) ) ) {
xastir_snprintf(gprmc_save_string,
sizeof(gprmc_save_string),
"%s",
@@ -1478,7 +1478,7 @@ void channel_data(int port, unsigned cha
gps_port_save = port;
process_it = 0;
}
- else if ( (length > 7) && (strncmp((char *)string,"$GPGGA,",7) == 0) ) {
+ else if ( (length > 7) && ( (strncmp((char *)string,"$GPGGA,",7) == 0) || (strncmp((char *)string,"$GNGGA,",7) == 0) ) ) {
xastir_snprintf(gpgga_save_string,
sizeof(gpgga_save_string),
"%s",
Reply to: