Browse Source

Imported Upstream version 3.16

master
Bernd Zeimetz 4 years ago
parent
commit
747b9c025c
85 changed files with 254652 additions and 505 deletions
  1. +19
    -1
      NEWS
  2. +21
    -6
      SConstruct
  3. +3
    -3
      TODO
  4. +3
    -1
      ais_json.c
  5. +29
    -5
      build.txt
  6. +5
    -5
      clock_gettime.c
  7. +22
    -8
      compiler.h
  8. +1
    -1
      devtools/ais.py
  9. +51
    -19
      driver_ais.c
  10. +2
    -2
      driver_evermore.c
  11. +2
    -2
      driver_italk.c
  12. +2
    -2
      driver_navcom.c
  13. +19
    -9
      driver_nmea0183.c
  14. +2
    -2
      driver_oncore.c
  15. +2
    -2
      driver_proto.c
  16. +2
    -2
      driver_sirf.c
  17. +2
    -2
      driver_superstar2.c
  18. +2
    -2
      driver_ubx.c
  19. +32
    -21
      drivers.c
  20. +1
    -1
      gegps
  21. +63
    -0
      gpscap.ini
  22. +1
    -1
      gpscat
  23. +8
    -1
      gpsd.c
  24. +6
    -5
      gpsd.h-tail
  25. +4
    -6
      gpsd_config.h
  26. +3
    -3
      gpsd_json.5
  27. +8
    -8
      gpsd_json.c
  28. +6
    -5
      gpsd_json.xml
  29. +28
    -6
      gpsdecode.c
  30. +1
    -1
      gpsfake
  31. +15
    -9
      gpsmon.c
  32. +10
    -5
      gpsprof
  33. +45
    -2
      json.c
  34. +12
    -1
      json.h
  35. +1
    -1
      leapsecond.py
  36. +1
    -1
      libgps.pc.in
  37. +3
    -3
      libgps_json.c
  38. +1
    -1
      libgpsd.pc.in
  39. +6
    -3
      libgpsd_core.c
  40. +5
    -4
      monitor_nmea0183.c
  41. +1
    -0
      monitor_sirf.c
  42. +1
    -0
      monitor_ubx.c
  43. +9
    -7
      ntpshmmon.c
  44. +1
    -1
      packaging/rpm/gpsd.spec
  45. +8
    -8
      packet.c
  46. +2
    -2
      packet_names.h
  47. +2
    -2
      packet_states.h
  48. +13
    -10
      ppsthread.c
  49. +0
    -5
      ppsthread.h
  50. +1
    -1
      regress-driver
  51. +1
    -1
      revision.h
  52. +4
    -1
      serial.c
  53. +5
    -0
      shmexport.c
  54. +85187
    -0
      test/daemon/ais-nmea-sample.log
  55. +167714
    -0
      test/daemon/ais-nmea-sample.log.chk
  56. +21
    -0
      test/daemon/ais_unpack_sixbit.log
  57. +32
    -0
      test/daemon/ais_unpack_sixbit.log.chk
  58. +37
    -37
      test/daemon/bu303-climbing.log.chk
  59. +54
    -54
      test/daemon/bu303-moving.log.chk
  60. +8
    -8
      test/daemon/bu303-nofix.log.chk
  61. +55
    -55
      test/daemon/bu303-stillfix.log.chk
  62. +6
    -6
      test/daemon/bu303b-nofix.log.chk
  63. +55
    -0
      test/daemon/gr8013-w.log
  64. +62
    -0
      test/daemon/gr8013-w.log.chk
  65. +47
    -0
      test/daemon/hab-gpspi.log
  66. +50
    -0
      test/daemon/hab-gpspi.log.chk
  67. +17
    -17
      test/daemon/italk-binary.log.chk
  68. +33
    -33
      test/daemon/navcom.log.chk
  69. +145
    -0
      test/daemon/nl2008u.log
  70. +150
    -0
      test/daemon/nl2008u.log.chk
  71. +4
    -4
      test/daemon/ublox-aek-4t.log.chk
  72. +4
    -4
      test/daemon/ublox-lea-4t.log.chk
  73. +13
    -13
      test/daemon/ublox-sirf1.log.chk
  74. +103
    -0
      test/sample.aivdm
  75. +30
    -10
      test/sample.aivdm.chk
  76. +21
    -1
      test/sample.aivdm.js.chk
  77. +21
    -1
      test/sample.aivdm.ju.chk
  78. +7
    -2
      test_json.c
  79. +1
    -1
      test_maidenhead.py
  80. +259
    -49
      test_timespec.c
  81. +2
    -2
      timebase.c
  82. +3
    -3
      timebase.h
  83. +12
    -3
      timespec.h
  84. +1
    -1
      xgps
  85. +1
    -1
      xgpsspeed

+ 19
- 1
NEWS View File

@@ -1,7 +1,25 @@
GPSD project news

3.16: 2016-01-08 (Eric S. Raymond <esr@snark.thyrsus.com>)
Test rebuilds for mid-2015 leapsecond bump. Regression tests will
run even if "python" in Python 3. Build correctly on systems where
-ltinfo is split from -lncurses. Avoid some rare overflow conditions
in PPS code. Fix bugs in JSON sat-view parsing due to the JSON
parser stuffing ints into shorts. Various small fixes to AIS
interpretation. Prevent a memory leak in long-running gpsmon
instances. Fix Savannah bug #45270: serial driver does not work
properly on pipes. Fix Savannah bug #44648: GPSD won't build if
CCFLAGS contains options that are only compatible with the
cros1s-compiler. Fix Savannah bug #45342: SConstruct generates wrong
*.pc files. Fix Savannah bug #46495: gpsd_poll may crash due to
unitialized pointer (probably due to bugg FD_ISSET on hos
system). Fix Savannah bug #46648: gpsd crashes and buffer overflow
is reported when terminated. Fix Savannah bug #46802: AIVDM to CSV
is broken in some weird cases. Fix Savannah bug #46804: JSON
satellite view parsing is somewhat broken.

3.15: 2015-06-03 (Eric S. Raymond <esr@snark.thyrsus.com>)
Fix a rare crash bug related to devices becomin inaccessible while timed out.
Fix a rare crash bug related to devices becoming inaccessible while timed out.
Accept NMEA 4.1 GSV sententences with the trailing signal-ID field.
Fixed incorrect decode of south latitudes in AIS Type 17 messages.
splint has been retired; this removes almost 2KLOC of annotations.


+ 21
- 6
SConstruct View File

@@ -24,7 +24,7 @@
# * Coveraging mode: gcc "-coverage" flag requires a hack for building the python bindings

# Release identification begins here
gpsd_version = "3.15"
gpsd_version = "3.16"

# client library version
libgps_version_current = 22
@@ -541,6 +541,8 @@ else:
if env['ncurses']:
if config.CheckPKG('ncurses'):
ncurseslibs = pkg_config('ncurses')
if config.CheckPKG('tinfo'):
ncurseslibs += pkg_config('tinfo')
elif WhereIs('ncurses5-config'):
ncurseslibs = ['!ncurses5-config --libs --cflags']
elif WhereIs('ncursesw5-config'):
@@ -663,7 +665,7 @@ else:
announce("You do not have the endian.h header file. RTCM V2 support disabled.")
env["rtcm104v2"] = False

# check function after libraries, because some function require library
# check function after libraries, because some function require libraries
# for example clock_gettime() require librt on Linux glibc < 2.17
for f in ("daemon", "strlcpy", "strlcat", "clock_gettime"):
if config.CheckFunc(f):
@@ -1092,10 +1094,23 @@ else:
# ensure that we build the python modules with scan-build, too
if env['CC'] is None or env['CC'].find('scan-build') < 0:
python_env['CC'] = cc
# As we seem to be changing compilers we must assume that the
# CCFLAGS are incompatible with the new compiler. If we should
# use other flags, the variable or the variable for this
# should be predefined.
if cc.split()[0] != env['CC']:
python_env['CCFLAGS'] = ''
else:
python_env['CC'] = ' '.join([env['CC']] + cc.split()[1:])
if env['CXX'] is None or env['CXX'].find('scan-build') < 0:
python_env['CXX'] = cxx
# As we seem to be changing compilers we must assume that the
# CCFLAGS or CXXFLAGS are incompatible with the new
# compiler. If we should use other flags, the variable or the
# variable for this should be predefined.
if cxx.split()[0] != env['CXX']:
python_env['CCFLAGS'] = ''
python_env['CXXFLAGS'] = ''
else:
python_env['CXX'] = ' '.join([env['CXX']] + cxx.split()[1:])

@@ -1515,7 +1530,7 @@ else:
rtcm_regress = Utility('rtcm-regress', [gpsdecode], [
'@echo "Testing RTCM decoding..."',
'@for f in $SRCDIR/test/*.rtcm2; do '
'echo "Testing $${f}..."; '
'echo "\tTesting $${f}..."; '
'TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
'$SRCDIR/gpsdecode -u -j <$${f} >$${TMPFILE}; '
'diff -ub $${f}.chk $${TMPFILE}; '
@@ -1543,7 +1558,7 @@ else:
aivdm_regress = Utility('aivdm-regress', [gpsdecode], [
'@echo "Testing AIVDM decoding w/ CSV format..."',
'@for f in $SRCDIR/test/*.aivdm; do '
'echo "Testing $${f}..."; '
'echo "\tTesting $${f}..."; '
'TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
'$SRCDIR/gpsdecode -u -c <$${f} >$${TMPFILE}; '
'diff -ub $${f}.chk $${TMPFILE} || echo "Test FAILED!"; '
@@ -1551,7 +1566,7 @@ else:
'done;',
'@echo "Testing AIVDM decoding w/ JSON unscaled format..."',
'@for f in $SRCDIR/test/*.aivdm; do '
'echo " Testing $${f}..."; '
'echo "\tTesting $${f}..."; '
'TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
'$SRCDIR/gpsdecode -u -j <$${f} >$${TMPFILE}; '
'diff -ub $${f}.ju.chk $${TMPFILE} || echo "Test FAILED!"; '
@@ -1559,7 +1574,7 @@ else:
'done;',
'@echo "Testing AIVDM decoding w/ JSON scaled format..."',
'@for f in $SRCDIR/test/*.aivdm; do '
'echo " Testing $${f}..."; '
'echo "\tTesting $${f}..."; '
'TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
'$SRCDIR/gpsdecode -j <$${f} >$${TMPFILE}; '
'diff -ub $${f}.js.chk $${TMPFILE} || echo "Test FAILED!"; '


+ 3
- 3
TODO View File

@@ -20,13 +20,13 @@ the calibration process less annoying?

** Things to do when we can break compatibility **

In gps_data_t Make subtype longer. 128 chars long sounds good.
In gps_data_t make device subtype longer. 128 chars long sounds good.

In gps_data_t, save PPS precision; this will require creating a pps struct.

In gps_fix_t, maybe change time away from float to timespec?

Add MMSI sequence number fields to type 7.
Add MMSI sequence number fields to AIS type 7.

** Bugs in gpsd and its clients:

@@ -142,7 +142,7 @@ reliable in client mode.

**** Optional dump of GPS configuration using gpsctl.

Some setting, like antenna in use, dead-reckoning mode, would be
Some settings, like antenna in use, dead-reckoning mode, would be
helpful to see.

**** Integrate 1PPS into profiling ***


+ 3
- 1
ais_json.c View File

@@ -316,7 +316,9 @@ int json_ais_read(const char *buf,
}
else if (strstr(buf, "\"fid\":16,") != NULL) {
status = json_read_object(buf, json_ais8_fid16, endptr);
structured = true;
if (status == 0) {
structured = true;
}
}
else if (strstr(buf, "\"fid\":17,") != NULL) {
status = json_read_object(buf, json_ais8_fid17, endptr);


+ 29
- 5
build.txt View File

@@ -16,6 +16,12 @@ this line will do:

If you get any errors, you need to read the detailed instructions that follow.

If 'scons' fails, it is possible that your target system has moved to
Python 3 as its default 'python' interpreter, but you can work around
it by saying "python2 /usr/bin/scons" or something similar. GPSD's
own Python scripts assume that "#!/usr/bin/env python2" will invoke a
Python 2 interpreter.

== Supported platforms ==

Native-build success should be expected on the following platforms,
@@ -162,7 +168,9 @@ The build degrades gracefully in the absence of any of these. You should
be able to tell from scons messages which extensions you will get.

Under Ubuntu and most other Debian-derived distributions, an easy way
to pick up the prerequisites is: "apt-get build-dep gpsd"
to pick up the prerequisites is: "apt-get build-dep gpsd". Note
that your sources.list will need "deb-src" lines for this, not
just "deb" lines.

If you are custom-building a Linux kernel for embedded deployment, you
will need some subset of the following modules:
@@ -202,10 +210,6 @@ running "scons prefix=<installation_root>". The default value is
"/usr/local". The environment variable DESTDIR also works in the
usual way.

If your scons fails with the complaint "No tool named 'textfile'",
you need to upgrade it. This feature was introduced during the long
interval after the 1.2.0 release; 1.2.1 and later versions will have it.

If your linker run fails with missing math symbols, see the FIXME
comment relating to implicit_links in the scons recipe; you probably
need to build with implicit_link=no. If this happens, please report
@@ -280,6 +284,26 @@ leap-second offset bumps to affect your installation so that it begins
as late as possible, at your build time rather than from when the
source tree was copied.

If you have had a leap-second transition, the following regression tests
will break:

bu303-climbing.log
bu303-moving.log
bu303-nofix.log
bu303-stillfix.log
bu303b-nofix.log
italk-binary.log
navcom.log
ublox-aek-4t.log
ublox-lea-4t.log
ublox-sirf1.log

There is no help for this other than a test rebuild. The problem is
that these devices rely on the build-time leap-second offset; you'll
see times one second off. Other GPSes either return
leap-second-corrected time or the test loads include a
leapsecond-offset report before any time is reported.

== Optional features ==

By giving command-line options to scons you can configure certain rarely-used


+ 5
- 5
clock_gettime.c View File

@@ -15,7 +15,7 @@
#endif

#ifndef HAVE_CLOCK_GETTIME
int clock_gettime(clockid_t clk_id UNUSED, struct timespec *tp)
int clock_gettime(clockid_t clk_id UNUSED, struct timespec *ts)
{
#ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time
clock_serv_t cclock;
@@ -23,14 +23,14 @@ int clock_gettime(clockid_t clk_id UNUSED, struct timespec *tp)
host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
clock_get_time(cclock, &mts);
mach_port_deallocate(mach_task_self(), cclock);
tp->tv_sec = mts.tv_sec;
tp->tv_nsec = mts.tv_nsec;
ts->tv_sec = mts.tv_sec;
ts->tv_nsec = mts.tv_nsec;
#else
struct timeval tv;
if (gettimeofday(&tv, NULL) < 0)
return -1;
tp->ts_sec = tv.tv_sec;
tp->ts_nsec = tv.tv_usec * 1000;
ts->tv_sec = tv.tv_sec;
ts->tv_nsec = tv.tv_usec * 1000;
/* paranoid programming */
if (1000000 <= (tv)->tv_usec) {
(tv)->tv_usec -= 1000000;


+ 22
- 8
compiler.h View File

@@ -66,27 +66,41 @@
} while (0)

#ifdef HAVE_STDATOMIC_H
#if !defined(__COVERITY__) && !defined(__cplusplus)
#include <stdatomic.h>
#endif /* __COVERITY__ || __cplusplus */
#if !defined(__COVERITY__)
#if !defined(__cplusplus)
#include <stdatomic.h>
#elif __cplusplus >= 201103L
/* C++ before C++11 can not handle stdatomic.h or atomic */
/* atomic is just C++ for stdatomic.h */
#include <atomic>
#endif /* __cplusplus */
#endif /* __COVERITY__ */
#endif /* HAVE_STDATOMIC_H */

#ifdef HAVE_OSATOMIC_H
#include <libkern/OSAtomic.h>
#endif /* HAVE_STDATOMIC_H */
#endif /* HAVE_OSATOMIC_H */

static inline void memory_barrier(void)
/* prevent instruction reordering across any call to this function */
{
#ifdef _STDATOMIC_H
#ifndef __COVERITY__
#ifdef __COVERITY__
/* do nothing */
#elif defined(__cplusplus)
/* we are C++ */
#if __cplusplus >= 201103L
/* C++11 and later has atomics, earlier do not */
atomic_thread_fence(memory_order_seq_cst);
#endif
#elif defined HAVE_STDATOMIC_H
/* we are C and atomics are in C98 and newer */
atomic_thread_fence(memory_order_seq_cst);
#endif /* __COVERITY__ */
#elif defined(HAVE_OSATOMIC_H)
/* do it the OS X way */
OSMemoryBarrier();
#elif defined(__GNUC__)
asm volatile ("" : : : "memory");
#endif /* STD_ATOMIC_H */
#endif
}

#endif /* _GPSD_COMPILER_H_ */

+ 1
- 1
devtools/ais.py View File

@@ -899,7 +899,7 @@ lengths = {
18: 168,
19: 312,
20: (72, 160),
21: (272, 360),
21: (272, 368),
22: 168,
23: 160,
24: (160, 168),


+ 51
- 19
driver_ais.c View File

@@ -26,7 +26,7 @@
* Parse the data from the device
*/

static void from_sixbit(unsigned char *bitvec, uint start, int count, char *to)
static void from_sixbit_untrimmed(unsigned char *bitvec, uint start, int count, char *to)
/* beginning at bitvec bit start, unpack count sixbit characters */
{
const char sixchr[64] =
@@ -43,12 +43,31 @@ static void from_sixbit(unsigned char *bitvec, uint start, int count, char *to)
to[i] = newchar;
}
to[i] = '\0';
/* trim spaces on right end */
for (i = count - 2; i >= 0; i--)
}

static void trim_spaces_on_right_end(char* to)
/* trim spaces on right end */
{
int i;
for (i = strlen(to) - 1; i >= 0; i--)
{
if (to[i] == ' ' || to[i] == '@')
{
to[i] = '\0';
}
else
{
break;
}
}
}

static void from_sixbit(unsigned char *bitvec, uint start, int count, char *to)
/* beginning at bitvec bit start, unpack count sixbit characters and remove trailing
* spaces */
{
from_sixbit_untrimmed(bitvec, start, count, to);
trim_spaces_on_right_end(to);
}

bool ais_binary_decode(const struct gpsd_errout_t *errout,
@@ -99,7 +118,7 @@ bool ais_binary_decode(const struct gpsd_errout_t *errout,
case 1: /* Position Report */
case 2:
case 3:
PERMISSIVE_LENGTH_CHECK(168)
PERMISSIVE_LENGTH_CHECK(163)
ais->type1.status = UBITS(38, 4);
ais->type1.turn = SBITS(42, 8);
ais->type1.speed = UBITS(50, 10);
@@ -112,7 +131,10 @@ bool ais_binary_decode(const struct gpsd_errout_t *errout,
ais->type1.maneuver = UBITS(143, 2);
//ais->type1.spare = UBITS(145, 3);
ais->type1.raim = UBITS(148, 1)!=0;
ais->type1.radio = UBITS(149, 19);
if(bitlen >= 168)
ais->type1.radio = UBITS(149, 19);
if(bitlen < 168)
ais->type1.radio = UBITS(149, bitlen - 149);
break;
case 4: /* Base Station Report */
case 11: /* UTC/Date Response */
@@ -221,7 +243,6 @@ bool ais_binary_decode(const struct gpsd_errout_t *errout,
ais->type6.structured = true;
break;
}
break;
}
/* UK and Republic Of Ireland */
else if (ais->type6.dac == 235 || ais->type6.dac == 250) {
@@ -241,7 +262,6 @@ bool ais_binary_decode(const struct gpsd_errout_t *errout,
ais->type6.structured = true;
break;
}
break;
}
/* International */
else if (ais->type6.dac == 1)
@@ -509,10 +529,15 @@ bool ais_binary_decode(const struct gpsd_errout_t *errout,
break;
case 16: /* Number of Persons On Board */
if (ais->type8.bitcount == 136)
ais->type8.dac1fid16.persons = UBITS(88, 13);/* 289 */
else
ais->type8.dac1fid16.persons = UBITS(55, 13);/* 236 */
ais->type8.structured = true;
{
ais->type8.dac1fid16.persons = UBITS(88, 13);/* 289 */
ais->type8.structured = true;
}
else if (ais->type8.bitcount == 72)
{
ais->type8.dac1fid16.persons = UBITS(55, 13);/* 236 */
ais->type8.structured = true;
}
break;
case 17: /* IMO289 - VTS-generated/synthetic targets */
#define ARRAY_BASE 56
@@ -719,10 +744,16 @@ bool ais_binary_decode(const struct gpsd_errout_t *errout,
}
}
/* land here if we failed to match a known DAC/FID */
if (!ais->type8.structured)
(void)memcpy(ais->type8.bitdata,
(char *)bits + (56 / CHAR_BIT),
BITS_TO_BYTES(ais->type8.bitcount));
if (!ais->type8.structured) {
size_t number_of_bytes = BITS_TO_BYTES(ais->type8.bitcount);
(void)memcpy(ais->type8.bitdata,
(char *)bits + (56 / CHAR_BIT),
number_of_bytes);
size_t valid_bits_in_last_byte = ais->type8.bitcount % CHAR_BIT;
if(valid_bits_in_last_byte>0)
ais->type8.bitdata[number_of_bytes-1] &= (0xFF
<< (8-valid_bits_in_last_byte));
}
break;
case 9: /* Standard SAR Aircraft Position Report */
PERMISSIVE_LENGTH_CHECK(168);
@@ -781,7 +812,7 @@ bool ais_binary_decode(const struct gpsd_errout_t *errout,
}
break;
case 16: /* Assigned Mode Command */
RANGE_CHECK(96, 144);
RANGE_CHECK(96, 168);
ais->type16.mmsi1 = UBITS(40, 30);
ais->type16.offset1 = UBITS(70, 12);
ais->type16.increment1 = UBITS(82, 10);
@@ -848,7 +879,7 @@ bool ais_binary_decode(const struct gpsd_errout_t *errout,
//ais->type19.spare = UBITS(308, 4);
break;
case 20: /* Data Link Management Message */
RANGE_CHECK(72, 160);
RANGE_CHECK(72, 186);
//ais->type20.spare = UBITS(38, 2);
ais->type20.offset1 = UBITS(40, 12);
ais->type20.number1 = UBITS(52, 4);
@@ -868,9 +899,9 @@ bool ais_binary_decode(const struct gpsd_errout_t *errout,
ais->type20.increment4 = UBITS(149, 11);
break;
case 21: /* Aid-to-Navigation Report */
RANGE_CHECK(272, 360);
RANGE_CHECK(272, 368);
ais->type21.aid_type = UBITS(38, 5);
from_sixbit((unsigned char *)bits,
from_sixbit_untrimmed((unsigned char *)bits,
43, 20, ais->type21.name);
ais->type21.accuracy = UBITS(163, 1);
ais->type21.lon = SBITS(164, 28);
@@ -889,6 +920,7 @@ bool ais_binary_decode(const struct gpsd_errout_t *errout,
//ais->type21.spare = UBITS(271, 1);
if (strlen(ais->type21.name) == 20 && bitlen > 272)
ENDCHARS(272, ais->type21.name+20);
trim_spaces_on_right_end(ais->type21.name);
break;
case 22: /* Channel Management */
PERMISSIVE_LENGTH_CHECK(168)


+ 2
- 2
driver_evermore.c View File

@@ -385,12 +385,12 @@ static gps_mask_t evermore_parse_input(struct gps_device_t *session)
session->lexer.outbuflen);
return st;
}
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
else if (session->lexer.type == NMEA_PACKET) {
st = nmea_parse((char *)session->lexer.outbuffer, session);
return st;
}
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */
else
return 0;
}


+ 2
- 2
driver_italk.c View File

@@ -384,10 +384,10 @@ static gps_mask_t italk_parse_input(struct gps_device_t *session)
if (session->lexer.type == ITALK_PACKET) {
return italk_parse(session, session->lexer.outbuffer,
session->lexer.outbuflen);;
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
} else if (session->lexer.type == NMEA_PACKET) {
return nmea_parse((char *)session->lexer.outbuffer, session);
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */
} else
return 0;
}


+ 2
- 2
driver_navcom.c View File

@@ -1150,10 +1150,10 @@ static gps_mask_t navcom_parse_input(struct gps_device_t *session)
if (session->lexer.type == NAVCOM_PACKET) {
return navcom_parse(session, session->lexer.outbuffer,
session->lexer.outbuflen);
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
} else if (session->lexer.type == NMEA_PACKET) {
return nmea_parse((char *)session->lexer.outbuffer, session);;
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */
} else
return 0;
}


+ 19
- 9
driver_nmea0183.c View File

@@ -13,7 +13,7 @@
#include "gpsd.h"
#include "strfuncs.h"

#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
/**************************************************************************
*
* Parser helpers begin here
@@ -605,8 +605,9 @@ static gps_mask_t processGSV(int count, char *field[],
* GP (GPS, SBAS, QZSS),
* QZ (QZSS).
*
* GL may to be used when GSVs are mixed containing GLONASS, GN maybe
* used when GSVs contain GLONASS only. Usage is inconsistent.
* GL may be (incorrectly) used when GSVs are mixed containing
* GLONASS, GN may be (incorrectly) used when GSVs contain GLONASS
* only. Usage is inconsistent.
*
* In the GLONASS version sat IDs run from 65-96 (NMEA0183 standardizes
* this). At least two GPS, the BU-353 GLONASS and the u-blox NEO-M8N,
@@ -693,11 +694,20 @@ static gps_mask_t processGSV(int count, char *field[],
if (sp->PRN != 0)
session->gpsdata.satellites_visible++;
}
if (session->nmea.part == session->nmea.await
&& atoi(field[3]) != session->gpsdata.satellites_visible)
gpsd_log(&session->context->errout, LOG_WARN,
"GPGSV field 3 value of %d != actual count %d\n",
atoi(field[3]), session->gpsdata.satellites_visible);

/*
* Alas, we can't sanity check field counts when there are multiple sat
* pictures, because the visible member counts *all* satellites - you
* get a bad result on the second and later SV spans. Note, this code
* assumes that if any of the special sat pics occur they come right
* after a stock GPGSV one.
*/
if (session->nmea.seen_glgsv || session->nmea.seen_bdgsv || session->nmea.seen_qzss)
if (session->nmea.part == session->nmea.await
&& atoi(field[3]) != session->gpsdata.satellites_visible)
gpsd_log(&session->context->errout, LOG_WARN,
"GPGSV field 3 value of %d != actual count %d\n",
atoi(field[3]), session->gpsdata.satellites_visible);

/* not valid data until we've seen a complete set of parts */
if (session->nmea.part < session->nmea.await) {
@@ -1587,7 +1597,7 @@ gps_mask_t nmea_parse(char *sentence, struct gps_device_t * session)
return retval;
}

#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */

void nmea_add_checksum(char *sentence)
/* add NMEA checksum to a possibly *-terminated sentence */


+ 2
- 2
driver_oncore.c View File

@@ -468,10 +468,10 @@ static gps_mask_t oncore_parse_input(struct gps_device_t *session)
if (session->lexer.type == ONCORE_PACKET) {
return oncore_dispatch(session, session->lexer.outbuffer,
session->lexer.outbuflen);
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
} else if (session->lexer.type == NMEA_PACKET) {
return nmea_parse((char *)session->lexer.outbuffer, session);
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */
} else
return 0;
}


+ 2
- 2
driver_proto.c View File

@@ -420,10 +420,10 @@ static gps_mask_t _proto__parse_input(struct gps_device_t *session)
{
if (session->lexer.type == _PROTO__PACKET) {
return _proto__dispatch(session, session->lexer.outbuffer, session->lexer.outbuflen);
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
} else if (session->lexer.type == NMEA_PACKET) {
return nmea_parse((char *)session->lexer.outbuffer, session);
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */
} else
return 0;
}


+ 2
- 2
driver_sirf.c View File

@@ -1367,10 +1367,10 @@ static gps_mask_t sirfbin_parse_input(struct gps_device_t *session)
if (session->lexer.type == SIRF_PACKET) {
return sirf_parse(session, session->lexer.outbuffer,
session->lexer.outbuflen);
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
} else if (session->lexer.type == NMEA_PACKET) {
return nmea_parse((char *)session->lexer.outbuffer, session);
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */
} else
return 0;
}


+ 2
- 2
driver_superstar2.c View File

@@ -468,10 +468,10 @@ static gps_mask_t superstar2_parse_input(struct gps_device_t *session)
if (session->lexer.type == SUPERSTAR2_PACKET) {
return superstar2_dispatch(session, session->lexer.outbuffer,
session->lexer.length);;
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
} else if (session->lexer.type == NMEA_PACKET) {
return nmea_parse((char *)session->lexer.outbuffer, session);
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */
} else
return 0;
}


+ 2
- 2
driver_ubx.c View File

@@ -633,10 +633,10 @@ static gps_mask_t parse_input(struct gps_device_t *session)
if (session->lexer.type == UBX_PACKET) {
return ubx_parse(session, session->lexer.outbuffer,
session->lexer.outbuflen);
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
} else if (session->lexer.type == NMEA_PACKET) {
return nmea_parse((char *)session->lexer.outbuffer, session);
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */
} else
return 0;
}


+ 32
- 21
drivers.c View File

@@ -27,7 +27,7 @@ gps_mask_t generic_parse_input(struct gps_device_t *session)
else if (session->lexer.type == COMMENT_PACKET) {
gpsd_set_century(session);
return 0;
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
} else if (session->lexer.type == NMEA_PACKET) {
const struct gps_type_t **dp;
gps_mask_t st = 0;
@@ -61,7 +61,7 @@ gps_mask_t generic_parse_input(struct gps_device_t *session)
}
}
return st;
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */
} else {
gpsd_log(&session->context->errout, LOG_SHOUT,
"packet type %d fell through (should never happen): %s.\n",
@@ -104,7 +104,7 @@ const struct gps_type_t driver_unknown = {
};
/* *INDENT-ON* */

#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
/**************************************************************************
*
* NMEA 0183
@@ -144,14 +144,14 @@ static void nmea_event_hook(struct gps_device_t *session, event_t event)
* unless there is actual following data.
*/
switch (session->lexer.counter) {
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
case 0:
/* probe for Garmin serial GPS -- expect $PGRMC followed by data */
gpsd_log(&session->context->errout, LOG_PROG,
"=> Probing for Garmin NMEA\n");
(void)nmea_send(session, "$PGRMCE");
break;
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */
#ifdef SIRF_ENABLE
case 1:
/*
@@ -181,7 +181,7 @@ static void nmea_event_hook(struct gps_device_t *session, event_t event)
session->back_to_nmea = true;
break;
#endif /* SIRF_ENABLE */
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
case 2:
/* probe for the FV-18 -- expect $PFEC,GPint followed by data */
gpsd_log(&session->context->errout, LOG_PROG,
@@ -194,7 +194,7 @@ static void nmea_event_hook(struct gps_device_t *session, event_t event)
"=> Probing for Trimble Copernicus\n");
(void)nmea_send(session, "$PTNLSNM,0139,01");
break;
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */
#ifdef EVERMORE_ENABLE
case 4:
gpsd_log(&session->context->errout, LOG_PROG,
@@ -276,7 +276,7 @@ const struct gps_type_t driver_nmea0183 = {
};
/* *INDENT-ON* */

#if defined(GARMIN_ENABLE) && defined(NMEA_ENABLE)
#if defined(GARMIN_ENABLE) && defined(NMEA0183_ENABLE)
/**************************************************************************
*
* Garmin NMEA
@@ -377,7 +377,7 @@ const struct gps_type_t driver_garmin = {
#endif /* TIMEHINT_ENABLE */
};
/* *INDENT-ON* */
#endif /* GARMIN_ENABLE && NMEA_ENABLE */
#endif /* GARMIN_ENABLE && NMEA0183_ENABLE */

#ifdef ASHTECH_ENABLE
/**************************************************************************
@@ -641,7 +641,7 @@ static const struct gps_type_t driver_earthmate = {
/* *INDENT-ON* */
#endif /* EARTHMATE_ENABLE */

#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */

#ifdef TNT_ENABLE
/**************************************************************************
@@ -1185,7 +1185,7 @@ static bool aivdm_decode(const char *buf, size_t buflen,
unsigned char *field[NMEA_MAX*2];
unsigned char fieldcopy[NMEA_MAX*2+1];
unsigned char *data, *cp;
unsigned char pad;
int pad;
struct aivdm_context_t *ais_context;
int i;

@@ -1211,10 +1211,19 @@ static bool aivdm_decode(const char *buf, size_t buflen,
field[nfields++] = (unsigned char *)buf;
for (cp = fieldcopy;
cp < fieldcopy + buflen; cp++)
if (*cp == (unsigned char)',') {
{
if (
(*cp == (unsigned char)',') ||
(*cp == (unsigned char)'*')
) {
*cp = '\0';
field[nfields++] = cp + 1;
}
}
#ifdef __UNDEF_DEBUG_
for(int i=0;i<nfields;i++)
gpsd_log(&session->context->errout, LOG_DATA, "field [%d] [%s]\n",i,field[i]);
#endif

/* discard sentences with exiguous commas; catches run-ons */
if (nfields < 7) {
@@ -1264,10 +1273,13 @@ static bool aivdm_decode(const char *buf, size_t buflen,
nfrags = atoi((char *)field[1]); /* number of fragments to expect */
ifrag = atoi((char *)field[2]); /* fragment id */
data = field[5];
pad = field[6][0]; /* number of padding bits */

pad = 0;
if(isdigit(field[6][0]))
pad = field[6][0] - '0'; /* number of padding bits ASCII encoded*/
gpsd_log(&session->context->errout, LOG_PROG,
"nfrags=%d, ifrag=%d, decoded_frags=%d, data=%s\n",
nfrags, ifrag, ais_context->decoded_frags, data);
"nfrags=%d, ifrag=%d, decoded_frags=%d, data=%s, pad=%d\n",
nfrags, ifrag, ais_context->decoded_frags, data, pad);

/* assemble the binary data */

@@ -1311,8 +1323,7 @@ static bool aivdm_decode(const char *buf, size_t buflen,
}
}
}
if (isdigit(pad))
ais_context->bitlen -= (pad - '0'); /* ASCII assumption */
ais_context->bitlen -= pad;

/* time to pass buffered-up data to where it's actually processed? */
if (ifrag == nfrags) {
@@ -1351,10 +1362,10 @@ static gps_mask_t aivdm_analyze(struct gps_device_t *session)
return ONLINE_SET | AIS_SET;
} else
return ONLINE_SET;
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
} else if (session->lexer.type == NMEA_PACKET) {
return nmea_parse((char *)session->lexer.outbuffer, session);
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */
} else
return 0;
}
@@ -1548,7 +1559,7 @@ extern const struct gps_type_t driver_zodiac;
/* the point of this rigamarole is to not have to export a table size */
static const struct gps_type_t *gpsd_driver_array[] = {
&driver_unknown,
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
&driver_nmea0183,
#ifdef ASHTECH_ENABLE
&driver_ashtech,
@@ -1583,7 +1594,7 @@ static const struct gps_type_t *gpsd_driver_array[] = {
#ifdef AIVDM_ENABLE
&driver_aivdm,
#endif /* AIVDM_ENABLE */
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */

#ifdef EVERMORE_ENABLE
&driver_evermore,


+ 1
- 1
gegps View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# usage: gegps [-i] [-d kmldir]


+ 63
- 0
gpscap.ini View File

@@ -142,6 +142,15 @@ rating = good
tested = 3.9
notes = Appears not to have the ANTARIS4 GSA quirk. Excellent indoors.

[LEA-8H]
type = engine
engine = LEA-8H
nmea = 2.3, 4.1
rating = excellent
tested = 3.15
notes = Appears not to have the ANTARIS4 GSA quirk. Excellent indoors.
logs = gr8013-w.log

[MSB2122]
type = engine
engine = MSB2122
@@ -410,6 +419,10 @@ vendor_site = http://www.geostar-navigation.com
type = vendor
vendor_site = http://www.globalsat.com.tw/

[HAB Supplies]
type = vendor
vendor_site = http://ava.upuaut.net/?page_id=388

[Haicom]
type = vendor
vendor_site = http://www.haicom.com.tw/
@@ -1371,6 +1384,24 @@ notes = May ship with broken firmware that incorrectly reports the
current year (2009) as 1953. A firmware update is available
to resolve this issue.

#% HAB supplies

[HAB-GPSPI]
type = device
submitter = mayer@iiasa.ac.at
vendor = HAB Supplies
techdoc = http://ava.upuaut.net/store/index.php?route=product/product&path=59_60&product_id=95
packaging = OEM module
engine = unknown
firmware = unknown
interfaces = TTL
tested = 3.6
rating = excellent
location = Laxenburg, Austria, 48.06N 16.36E
date = 2015-06-21
sample_notes = This device was not moved as it is used as a NTP server.
logs=hab-gpspi.log

#% Haicom

[HI-204S]
@@ -1785,6 +1816,22 @@ notes = Also known as the Macx-1, this is the USB variant of the
reporting can be turned on, but NMEA cannot be turned off.
logs = gr601-w.log

[GR8013-W]
type = device
submitter = Marc Thielemann <marc.thielemann@biama.de>
vendor = Navisys
techdoc = http://www.navisys.com.tw/products/GPS&GNSS_%20receivers/flyer/GR-801_flyer-150326.pdf
packaging = mouse
engine = LEA-8H
firmware = 2.01
nmea = 2.3, 4.1
interfaces = PL2303
tested = 3.15
rating = excellent
location = Berlin, Germany, 5230.88669N 01327.85593E
date = 2015-06-19
logs = g8013-w.log

[EVK 6H]
type = device
vendor = u-blox
@@ -1903,6 +1950,22 @@ vendor = NaviLock
logs = bt451.log
notes = Uses the ANTARIS4 ATR062x variant.

[NL-8002U]
type=device
submitter = Manfred Günzl <osb_mgu@gmx.de>
vendor = NaviLock
techdoc = http://www.navilock.de/produkte/G_62523/dokumente.html
packaging = mouse
engine = LEA-8H
firmware = SW 2.01 (75331),HW 00080000,PROTVER 15.00
nmea = V3.01
interfaces = Other
tested = 3.15
rating = excellent
location = Schramberg Sulgen, DE, 48.2N 8.4E
date = 2015-10-10
logs = nl2008u.log

#% NavMan

[Jupiter 20]


+ 1
- 1
gpscat View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
#
# This file is Copyright (c) 2010 by the GPSD project
# BSD terms apply: see the file COPYING in the distribution root for details.


+ 8
- 1
gpsd.c View File

@@ -2171,7 +2171,14 @@ int main(int argc, char *argv[])
break;
case AWAIT_NOT_READY:
for (device = devices; device < devices + MAX_DEVICES; device++)
if (allocated_device(device) && FD_ISSET(device->gpsdata.gps_fd, &efds)) {
/*
* The file descriptor validity check is reqiured on some ARM
* platforms to prevent a core dump. This may be due to an
* implimentation error in FD_ISSET().
*/
if (allocated_device(device)
&& (0 <= device->gpsdata.gps_fd && device->gpsdata.gps_fd < FD_SETSIZE)
&& FD_ISSET(device->gpsdata.gps_fd, &efds)) {
deactivate_device(device);
free_device(device);
}


+ 6
- 5
gpsd.h-tail View File

@@ -30,7 +30,7 @@
* (Thus, the 'scaled' flag no longer affects display of these fields.)
* PPS drift message ships nsec rather than msec.
* 3.10 The obsolete tag field has been dropped from JSON.
* 3.11 A precision field, log2 of the time source jitter, as been added
* 3.11 A precision field, log2 of the time source jitter, has been added
* to the PPS report. See ntpshm.h for more details.
*/
#define GPSD_PROTO_MAJOR_VERSION 3 /* bump on incompatible changes */
@@ -46,8 +46,8 @@
#if !defined(AIVDM_ENABLE) && defined(NMEA2000_ENABLE)
#define AIVDM_ENABLE
#endif
#if !defined(NMEA_ENABLE) && (defined(FV18_ENABLE) || defined(MTK3301_ENABLE) || defined(TNT_ENABLE) || defined(OCEANSERVER_ENABLE) || defined(GPSCLOCK_ENABLE) || defined(FURY_ENABLE))
#define NMEA_ENABLE
#if !defined(NMEA0183_ENABLE) && (defined(FV18_ENABLE) || defined(MTK3301_ENABLE) || defined(TNT_ENABLE) || defined(OCEANSERVER_ENABLE) || defined(GPSCLOCK_ENABLE) || defined(FURY_ENABLE))
#define NMEA0183_ENABLE
#endif
#ifdef EARTHMATE_ENABLE
#define ZODIAC_ENABLE
@@ -385,6 +385,7 @@ typedef enum {source_unknown,
source_udp, /* UDP stream: case detected but not used */
source_gpsd, /* Remote gpsd instance over TCP/IP */
source_pps, /* PPS-only device, such as /dev/ppsN */
source_pipe, /* Unix FIFO; don't use blocking I/O */
} sourcetype_t;

/*
@@ -485,7 +486,7 @@ struct gps_device_t {
int fixcnt; /* count of fixes from this device */
struct gps_fix_t newdata; /* where drivers put their data */
struct gps_fix_t oldfix; /* previous fix for error modeling */
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
struct {
unsigned short sats_used[MAXCHANNELS];
int part, await; /* for tracking GSV parts */
@@ -515,7 +516,7 @@ struct gps_device_t {
unsigned int cycle_enders;
bool cycle_continue;
} nmea;
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */
/*
* The rest of this structure is driver-specific private storage.
* Only put a driver's scratch storage in here if it is never


+ 4
- 6
gpsd_config.h View File

@@ -2,11 +2,11 @@

#ifndef GPSD_CONFIG_H

#define VERSION "3.15"
#define VERSION "3.16"

#define GPSD_URL "http://catb.org/gpsd"

#define HAVE_LIBUSB 1
/* #undef HAVE_LIBUSB */

#define HAVE_LIBRT 1

@@ -16,9 +16,7 @@

#define HAVE_LINUX_CAN_H 1

/* #undef HAVE_STDATOMIC_H */

/* #undef HAVE_OSATOMIC_H */
#define HAVE_STDATOMIC_H 1

#define HAVE_BUILTIN_ENDIANNESS 1

@@ -269,7 +267,7 @@
#define UDEVDIR "/lib/udev"

/* libusb support for USB devices */
#define USB_ENABLE 1
/* #undef USB_ENABLE */

/* Some libcs do not have strlcat/strlcpy. Local copies are provided */
#ifndef HAVE_STRLCAT


+ 3
- 3
gpsd_json.5 View File

@@ -1617,7 +1617,7 @@ PPS
.RS 4
This message is emitted each time the daemon sees a valid PPS (Pulse Per Second) strobe from a device\&.
.sp
This message exactly mirrors the PPS message except for two details\&.
This message exactly mirrors the TOFF message except for two details\&.
.sp
PPS emits the NTP precision\&. See the NTP documentation for their definition of precision\&.
.sp
@@ -1857,7 +1857,7 @@ T}
T{
parity
T}:T{
Yes
No
T}:T{
string
T}:T{
@@ -1906,7 +1906,7 @@ Device minimum cycle time in seconds\&. Reported from
T}
.TE
.sp 1
The serial parameters will be omitted in a response describing a TCP/IP source such as an Ntrip, DGPSIP, or AIS feed\&.
The serial parameters will (bps, parity, stopbits) be omitted in a response describing a TCP/IP source such as an Ntrip, DGPSIP, or AIS feed; on a serial device they will always be present\&.
.sp
The contents of the flags field should be interpreted as follows:
.sp


+ 8
- 8
gpsd_json.c View File

@@ -1902,7 +1902,7 @@ void json_aivdm_dump(const struct ais_t *ais,
break;
case 16: /* IMO236 - Number of persons on board */
str_appendf(buf, buflen,
"\"persons\":%u}\t\n", ais->type6.dac1fid16.persons);
"\"persons\":%u}\r\n", ais->type6.dac1fid16.persons);
break;
case 18: /* IMO289 - Clearance time to enter port */
str_appendf(buf, buflen,
@@ -2167,8 +2167,8 @@ void json_aivdm_dump(const struct ais_t *ais,
str_appendf(buf, buflen,
"\"airtemp\":%.1f,\"dewpoint\":%.1f,"
"\"pressure\":%u,\"pressuretend\":\"%s\",",
(ais->type8.dac1fid11.airtemp - DAC1FID11_AIRTEMP_OFFSET) / DAC1FID11_AIRTEMP_DIV,
(ais->type8.dac1fid11.dewpoint - DAC1FID11_DEWPOINT_OFFSET) / DAC1FID11_DEWPOINT_DIV,
((signed int)ais->type8.dac1fid11.airtemp - DAC1FID11_AIRTEMP_OFFSET) / DAC1FID11_AIRTEMP_DIV,
((signed int)ais->type8.dac1fid11.dewpoint - DAC1FID11_DEWPOINT_OFFSET) / DAC1FID11_DEWPOINT_DIV,
ais->type8.dac1fid11.pressure - DAC1FID11_PRESSURE_OFFSET,
trends[ais->type8.dac1fid11.pressuretend]);
else
@@ -2195,7 +2195,7 @@ void json_aivdm_dump(const struct ais_t *ais,
else
str_appendf(buf, buflen,
"\"waterlevel\":%.1f,",
(ais->type8.dac1fid11.waterlevel - DAC1FID11_WATERLEVEL_OFFSET) / DAC1FID11_WATERLEVEL_DIV);
((signed int)ais->type8.dac1fid11.waterlevel - DAC1FID11_WATERLEVEL_OFFSET) / DAC1FID11_WATERLEVEL_DIV);

if (scaled) {
str_appendf(buf, buflen,
@@ -2224,7 +2224,7 @@ void json_aivdm_dump(const struct ais_t *ais,
ais->type8.dac1fid11.swellperiod,
ais->type8.dac1fid11.swelldir,
ais->type8.dac1fid11.seastate,
(ais->type8.dac1fid11.watertemp - DAC1FID11_WATERTEMP_OFFSET) / DAC1FID11_WATERTEMP_DIV,
((signed int)ais->type8.dac1fid11.watertemp - DAC1FID11_WATERTEMP_OFFSET) / DAC1FID11_WATERTEMP_DIV,
ais->type8.dac1fid11.preciptype,
preciptypes[ais->type8.dac1fid11.preciptype],
ais->type8.dac1fid11.salinity / DAC1FID11_SALINITY_DIV,
@@ -2296,7 +2296,7 @@ void json_aivdm_dump(const struct ais_t *ais,
break;
case 16: /* IMO289 - Number of persons on board */
str_appendf(buf, buflen,
"\"persons\":%u}\t\n", ais->type6.dac1fid16.persons);
"\"persons\":%u}\r\n", ais->type6.dac1fid16.persons);
break;
case 17: /* IMO289 - VTS-generated/synthetic targets */
(void)strlcat(buf, "\"targets\":[", buflen);
@@ -2483,7 +2483,7 @@ void json_aivdm_dump(const struct ais_t *ais,
else
str_appendf(buf, buflen,
"\"waterlevel\":%.1f,",
(ais->type8.dac1fid31.waterlevel - DAC1FID31_WATERLEVEL_OFFSET) / DAC1FID31_WATERLEVEL_DIV);
((unsigned int)ais->type8.dac1fid31.waterlevel - DAC1FID31_WATERLEVEL_OFFSET) / DAC1FID31_WATERLEVEL_DIV);

if (scaled) {
str_appendf(buf, buflen,
@@ -2804,7 +2804,7 @@ void json_aivdm_dump(const struct ais_t *ais,
(void)strlcpy(speedlegend, "\"fast\"", sizeof(speedlegend));
else
(void)snprintf(speedlegend, sizeof(speedlegend),
"%u", ais->type1.speed);
"%u", ais->type9.speed);

str_appendf(buf, buflen,
"\"alt\":%s,\"speed\":%s,\"accuracy\":%s,"


+ 6
- 5
gpsd_json.xml View File

@@ -1233,7 +1233,7 @@ precision on most systems.</para>
<para>This message is emitted each time the daemon sees a valid PPS (Pulse
Per Second) strobe from a device.</para>

<para>This message exactly mirrors the PPS message except for two
<para>This message exactly mirrors the TOFF message except for two
details.</para>

<para>PPS emits the NTP precision. See the NTP documentation for their
@@ -1434,7 +1434,7 @@ backup battery.</para>
</row>
<row>
<entry>parity</entry>
<entry>Yes</entry>
<entry>No</entry>
<entry>string</entry>
<entry><para>N, O or E for no parity, odd, or even.</para></entry>
</row>
@@ -1471,8 +1471,9 @@ backup battery.</para>
</tgroup>
</table>

<para>The serial parameters will be omitted in a response describing a
TCP/IP source such as an Ntrip, DGPSIP, or AIS feed.</para>
<para>The serial parameters will (bps, parity, stopbits) be omitted in
a response describing a TCP/IP source such as an Ntrip, DGPSIP, or AIS
feed; on a serial device they will always be present.</para>

<para>The contents of the flags field should be interpreted as follows:</para>

@@ -2297,7 +2298,7 @@ message:</para>
<programlisting>
{"class":"RTCM2","type":14,"station_id":652,"zcount":1657.2,
"seqnum":3,"length":1,"station_health":6,"week":601,"hour":109,
"leapsecs":15}
"leapsecs":15}
</programlisting>

</refsect3>


+ 28
- 6
gpsdecode.c View File

@@ -31,6 +31,26 @@ static struct gps_context_t context;
**************************************************************************/

#ifdef AIVDM_ENABLE
static const char *raw_hexdump(char *scbuf, size_t scbuflen, int structured,
char *binbuf, size_t binbuflen)
{
if (!structured)
return gpsd_hexdump(scbuf, scbuflen, binbuf, binbuflen);
/* Data parsed as structured doesn't have correct raw data */
#ifndef SQUELCH_ENABLE
size_t len =
(size_t) ((binbuflen >
MAX_PACKET_LENGTH) ? MAX_PACKET_LENGTH : binbuflen) * 2;
if (len > scbuflen - 1) len = scbuflen - 1;

memset(scbuf, 'x', len);
scbuf[len] = '\0';
#else /* SQUELCH defined */
scbuf[0] = '\0';
#endif /* SQUELCH_ENABLE */
return scbuf;
}

static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen)
{
char scratchbuf[MAX_PACKET_LENGTH*2+1];
@@ -124,9 +144,10 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen)
str_appendf(buf, buflen,
"|%zd:%s",
ais->type6.bitcount,
gpsd_hexdump(scratchbuf, sizeof(scratchbuf),
ais->type6.bitdata,
BITS_TO_BYTES(ais->type6.bitcount)));
raw_hexdump(scratchbuf, sizeof(scratchbuf),
ais->type6.structured,
ais->type6.bitdata,
BITS_TO_BYTES(ais->type6.bitcount)));
break;
case 7: /* Binary Acknowledge */
case 13: /* Safety Related Acknowledge */
@@ -229,9 +250,10 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen)
str_appendf(buf, buflen,
"|%zd:%s",
ais->type8.bitcount,
gpsd_hexdump(scratchbuf, sizeof(scratchbuf),
ais->type8.bitdata,
BITS_TO_BYTES(ais->type8.bitcount)));
raw_hexdump(scratchbuf, sizeof(scratchbuf),
ais->type8.structured,
ais->type8.bitdata,
BITS_TO_BYTES(ais->type8.bitcount)));
break;
case 9:
str_appendf(buf, buflen,


+ 1
- 1
gpsfake View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
#
# gpsfake -- test harness for gpsd
#


+ 15
- 9
gpsmon.c View File

@@ -39,9 +39,9 @@ extern struct monitor_object_t garmin_mmt, garmin_bin_ser_mmt;
extern struct monitor_object_t italk_mmt, ubx_mmt, superstar2_mmt;
extern struct monitor_object_t fv18_mmt, gpsclock_mmt, mtk3301_mmt;
extern struct monitor_object_t oncore_mmt, tnt_mmt, aivdm_mmt;
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
extern const struct gps_type_t driver_nmea0183;
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */

/* These are public */
struct gps_device_t session;
@@ -76,11 +76,11 @@ const struct monitor_object_t json_mmt = {
#endif /* PASSTHROUGH_ENABLE */

static const struct monitor_object_t *monitor_objects[] = {
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
&nmea_mmt,
#if defined(GARMIN_ENABLE) && defined(NMEA_ENABLE)
#if defined(GARMIN_ENABLE) && defined(NMEA0183_ENABLE)
&garmin_mmt,
#endif /* GARMIN_ENABLE && NMEA_ENABLE */
#endif /* GARMIN_ENABLE && NMEA0183_ENABLE */
#if defined(GARMIN_ENABLE) && defined(BINARY_ENABLE)
&garmin_bin_ser_mmt,
#endif /* defined(GARMIN_ENABLE) && defined(BINARY_ENABLE) */
@@ -99,7 +99,7 @@ static const struct monitor_object_t *monitor_objects[] = {
#ifdef AIVDM_ENABLE
&aivdm_mmt,
#endif /* AIVDM_ENABLE */
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */
#if defined(SIRF_ENABLE) && defined(BINARY_ENABLE)
&sirf_mmt,
#endif /* defined(SIRF_ENABLE) && defined(BINARY_ENABLE) */
@@ -516,6 +516,8 @@ static bool switch_type(const struct gps_type_t *devtype)
(void)delwin(devicewin);
}
active = newobject;
if (devicewin)
delwin(devicewin);
devicewin = newwin((*active)->min_y, (*active)->min_x, 1, 0);
/* screen might have JSOM on it from the init sequence */
(void)clearok(stdscr, true);
@@ -561,11 +563,11 @@ static void select_packet_monitor(struct gps_device_t *device)
*/
if (device->lexer.type != last_type) {
const struct gps_type_t *active_type = device->device_type;
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
if (device->lexer.type == NMEA_PACKET
&& ((device->device_type->flags & DRIVER_STICKY) != 0))
active_type = &driver_nmea0183;
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */
if (!switch_type(active_type))
longjmp(terminate, TERM_DRIVER_SWITCH);
else {
@@ -583,6 +585,9 @@ static void select_packet_monitor(struct gps_device_t *device)
(void)wnoutrefresh(devicewin);
}

/* Control-L character */
#define CTRL_L 0x0C

static char *curses_get_command(void)
/* char-by-char nonblocking input, return accumulated command line on \n */
{
@@ -591,7 +596,8 @@ static char *curses_get_command(void)
int c;

c = wgetch(cmdwin);
if (c == CTRL('L')) {
if (CTRL_L == c) {
/* ^L is to repaint the screen */
(void)clearok(stdscr, true);
if (active != NULL && (*active)->initialize != NULL)
(void)(*active)->initialize();


+ 10
- 5
gpsprof View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
#
# This file is Copyright (c) 2010 by the GPSD project
# BSD terms apply: see the file COPYING in the distribution root for details.
@@ -59,11 +59,16 @@ class plotter:

def whatami(self):
"How do we identify this plotting run?"
return "%s, %s, %d %dN%d, cycle %ds" % \
desc = "%s, %s, " % \
(gps.misc.isotime(self.start_time),
self.device.get('driver', "unknown"), self.device['bps'],
9 - self.device['stopbits'],
self.device['stopbits'], self.device['cycle'])
self.device.get('driver', "unknown"))
if 'bps' in self.device:
desc += "%d %dN%d, cycle %ds" % \
(self.device['bps'], 9 - self.device['stopbits'],
self.device['stopbits'], self.device['cycle'])
else:
desc += self.device['path']
return desc

def collect(self, verbose, logfp=None):
"Collect data from the GPS."


+ 45
- 2
json.c View File

@@ -93,8 +93,8 @@ void json_enable_debug(int level, FILE * fp)
static void json_trace(int errlevel, const char *fmt, ...)
/* assemble command in printf(3) style */
{
if (errlevel <= debuglevel) {
char buf[BUFSIZ];
if (errlevel <= debuglevel && NULL != debugfp) {
char buf[BUFSIZ] = {0};
va_list ap;

(void)strlcpy(buf, "json: ", sizeof(buf));
@@ -128,6 +128,12 @@ static char *json_target_address(const struct json_attr_t *cursor,
case t_uinteger:
targetaddr = (char *)&cursor->addr.uinteger[offset];
break;
case t_short:
targetaddr = (char *)&cursor->addr.shortint[offset];
break;
case t_ushort:
targetaddr = (char *)&cursor->addr.ushortint[offset];
break;
case t_time:
case t_real:
targetaddr = (char *)&cursor->addr.real[offset];
@@ -197,6 +203,13 @@ static int json_internal_read_object(const char *cp,
case t_uinteger:
memcpy(lptr, &cursor->dflt.uinteger, sizeof(unsigned int));
break;
case t_short:
memcpy(lptr, &cursor->dflt.shortint, sizeof(short));
break;
case t_ushort:
memcpy(lptr, &cursor->dflt.ushortint,
sizeof(unsigned short));
break;
case t_time:
case t_real:
memcpy(lptr, &cursor->dflt.real, sizeof(double));
@@ -478,6 +491,18 @@ static int json_internal_read_object(const char *cp,
memcpy(lptr, &tmp, sizeof(unsigned int));
}
break;
case t_short:
{
short tmp = atoi(valbuf);
memcpy(lptr, &tmp, sizeof(short));
}
break;
case t_ushort:
{
unsigned short tmp = (unsigned int)atoi(valbuf);
memcpy(lptr, &tmp, sizeof(unsigned short));
}
break;
case t_time:
{
double tmp = iso8601_to_unix(valbuf);
@@ -644,6 +669,24 @@ int json_read_array(const char *cp, const struct json_array_t *arr,
else
cp = ep;
break;
#endif /* JSON_MINIMAL */
case t_short:
#ifndef JSON_MINIMAL
arr->arr.shorts.store[offset] = (short)strtol(cp, &ep, 0);
if (ep == cp)
return JSON_ERR_BADNUM;
else
cp = ep;
break;
#endif /* JSON_MINIMAL */
case t_ushort:
#ifndef JSON_MINIMAL
arr->arr.ushorts.store[offset] = (unsigned short)strtoul(cp, &ep, 0);
if (ep == cp)
return JSON_ERR_BADNUM;
else
cp = ep;
break;
#endif /* JSON_MINIMAL */
case t_time:
#ifndef JSON_MINIMAL


+ 12
- 1
json.h View File

@@ -11,7 +11,8 @@ typedef enum {t_integer, t_uinteger, t_real,
t_string, t_boolean, t_character,
t_time,
t_object, t_structobject, t_array,
t_check, t_ignore}
t_check, t_ignore,
t_short, t_ushort}
json_type;

struct json_enum_t {
@@ -38,6 +39,12 @@ struct json_array_t {
struct {
unsigned int *store;
} uintegers;
struct {
short *store;
} shorts;
struct {
unsigned short *store;
} ushorts;
struct {
double *store;
} reals;
@@ -54,6 +61,8 @@ struct json_attr_t {
union {
int *integer;
unsigned int *uinteger;
short *shortint;
unsigned short *ushortint;
double *real;
char *string;
bool *boolean;
@@ -64,6 +73,8 @@ struct json_attr_t {
union {
int integer;
unsigned int uinteger;
short shortint;
unsigned short ushortint;
double real;
bool boolean;
char character;


+ 1
- 1
leapsecond.py View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
"""

Usage: leapsecond.py [-v] { [-h] | [-f filename] | [-g filename] | [-H filename]


+ 1
- 1
libgps.pc.in View File

@@ -1,6 +1,6 @@
prefix=@prefix@
exec_prefix=${prefix}
libdir=@libdir@
libdir=${exec_prefix}/@libdir@
includedir=${prefix}/include

Name: GPSD


+ 3
- 3
libgps_json.c View File

@@ -109,9 +109,9 @@ static int json_sky_read(const char *buf, struct gps_data_t *gpsdata,
{
const struct json_attr_t json_attrs_satellites[] = {
/* *INDENT-OFF* */
{"PRN", t_integer, STRUCTOBJECT(struct satellite_t, PRN)},
{"el", t_integer, STRUCTOBJECT(struct satellite_t, elevation)},
{"az", t_integer, STRUCTOBJECT(struct satellite_t, azimuth)},
{"PRN", t_short, STRUCTOBJECT(struct satellite_t, PRN)},
{"el", t_short, STRUCTOBJECT(struct satellite_t, elevation)},
{"az", t_short, STRUCTOBJECT(struct satellite_t, azimuth)},
{"ss", t_real, STRUCTOBJECT(struct satellite_t, ss)},
{"used", t_boolean, STRUCTOBJECT(struct satellite_t, used)},
/* *INDENT-ON* */


+ 1
- 1
libgpsd.pc.in View File

@@ -1,6 +1,6 @@
prefix=@prefix@
exec_prefix=${prefix}
libdir=${exec_prefix}@libdir@
libdir=${exec_prefix}/@libdir@
includedir=${prefix}/include

Name: libgpsd


+ 6
- 3
libgpsd_core.c View File

@@ -305,6 +305,9 @@ void gpsd_init(struct gps_device_t *session, struct gps_context_t *context,
(void)strlcpy(session->gpsdata.dev.path, device,
sizeof(session->gpsdata.dev.path));
session->device_type = NULL; /* start by hunting packets */
#ifdef RECONFIGURE_ENABLE
session->last_controller = NULL;
#endif /* RECONFIGURE_ENABLE */
session->observed = 0;
session->sourcetype = source_unknown; /* gpsd_open() sets this */
session->servicetype = service_unknown; /* gpsd_open() sets this */
@@ -543,7 +546,7 @@ int gpsd_open(struct gps_device_t *session)
int gpsd_activate(struct gps_device_t *session, const int mode)
/* acquire a connection to the GPS device */
{
if (session->mode == O_OPTIMIZE)
if (mode == O_OPTIMIZE)
gpsd_run_device_hook(&session->context->errout,
session->gpsdata.dev.path, "ACTIVATE");
session->gpsdata.gps_fd = gpsd_open(session);
@@ -560,7 +563,7 @@ int gpsd_activate(struct gps_device_t *session, const int mode)
return session->gpsdata.gps_fd;
}

#ifdef NON_NMEA_ENABLE
#ifdef NON_NMEA0183_ENABLE
/* if it's a sensor, it must be probed */
if ((session->servicetype == service_sensor) &&
(session->sourcetype != source_can)) {
@@ -590,7 +593,7 @@ int gpsd_activate(struct gps_device_t *session, const int mode)
"no probe matched...\n");
}
foundit:
#endif /* NON_NMEA_ENABLE */
#endif /* NON_NMEA0183_ENABLE */

gpsd_clear(session);
gpsd_log(&session->context->errout, LOG_INF,


+ 5
- 4
monitor_nmea0183.c View File

@@ -19,7 +19,7 @@
#include "gpsdclient.h"
#include "strfuncs.h"

#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
extern const struct gps_type_t driver_nmea0183;

static WINDOW *cookedwin, *nmeawin, *satwin, *gprmcwin, *gpggawin, *gpgsawin, *gpgstwin;
@@ -107,6 +107,7 @@ static bool nmea_initialize(void)
#endif /* PPS_ENABLE */
(void)mvwprintw(gpgsawin, 5, 9, " GSA + PPS ");
(void)wattrset(gpgsawin, A_NORMAL);
(void)syncok(gpgsawin, true);

gpggawin = derwin(devicewin, 9, 30, 6, 50);
assert(gpggawin !=NULL);
@@ -390,7 +391,7 @@ static void monitor_nmea_send(const char *fmt, ...)
* display or implement device-specific commands.
*/

#if defined(GARMIN_ENABLE) && defined(NMEA_ENABLE)
#if defined(GARMIN_ENABLE) && defined(NMEA0183_ENABLE)
extern const struct gps_type_t driver_garmin;

const struct monitor_object_t garmin_mmt = {
@@ -401,7 +402,7 @@ const struct monitor_object_t garmin_mmt = {
.min_y = 21,.min_x = 80,
.driver = &driver_garmin,
};
#endif /* GARMIN_ENABLE && NMEA_ENABLE */
#endif /* GARMIN_ENABLE && NMEA0183_ENABLE */

#ifdef ASHTECH_ENABLE
extern const struct gps_type_t driver_ashtech;
@@ -524,4 +525,4 @@ const struct monitor_object_t aivdm_mmt = {
.driver = &driver_aivdm,
};
#endif /* AIVDM_ENABLE */
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */

+ 1
- 0
monitor_sirf.c View File

@@ -168,6 +168,7 @@ static bool sirf_initialize(void)
display(mid7win, 1, 23, "Bias: ");
display(mid7win, 2, 1, "GPS Time: ");
display(mid7win, 2, 23, "PPS: ");
(void)syncok(mid7win, true);
#ifndef PPS_ENABLE
(void)mvwaddstr(mid7win, 2, 40, "N/A");
#endif /* PPS_ENABLE */


+ 1
- 0
monitor_ubx.c View File

@@ -72,6 +72,7 @@ static bool ubx_initialize(void)
if ((ppswin = derwin(devicewin, 3, 51, 16, 28)) == NULL)
return false;
(void)wborder(ppswin, 0, 0, 0, 0, 0, 0, 0, 0);
(void)syncok(ppswin, true);
(void)wattrset(ppswin, A_BOLD);
#define TOFF_LINE 1
#define TOFF_COLUMN 1


+ 9
- 7
ntpshmmon.c View File

@@ -13,14 +13,10 @@
#include "gpsd_config.h"
#include "ntpshm.h"
#include "revision.h"
#include "timespec.h"

#define NTPSEGMENTS 256 /* NTPx for x any byte */

/* difference between timespecs in nanoseconds */
/* int is too small, avoid floats */
/* WARNING! this will overflow if x and y differ by more than a few seconds */
#define timespec_diff_ns(x, y) (long)(((x).tv_sec-(y).tv_sec)*1000000000+(x).tv_nsec-(y).tv_nsec)

static struct shmTime *segments[NTPSEGMENTS + 1];
static struct timespec tick[NTPSEGMENTS + 1];

@@ -32,7 +28,7 @@ int main(int argc, char **argv)
bool verbose = false;
int nsamples = INT_MAX;
time_t timeout = (time_t)INT_MAX, starttime = time(NULL);
double cycle = 1.0;
double cycle = 1.0; /* FIXME, One Sec cycle time a bad assumption */

#define USAGE "usage: ntpshmmon [-s] [-n max] [-t timeout] [-v] [-h] [-V]\n"
while ((option = getopt(argc, argv, "c:hn:st:vV")) != -1) {
@@ -86,13 +82,19 @@ int main(int argc, char **argv)
struct shm_stat_t shm_stat;

for (i = 0; i < NTPSEGMENTS; i++) {
long long diff; /* 32 bit long is too short for a timespec */
enum segstat_t status = ntp_read(segments[i], &shm_stat, false);
if (verbose)
fprintf(stderr, "unit %d status %d\n", i, status);
switch(status)
{
case OK:
if (timespec_diff_ns(shm_stat.tvc, tick[i]) >= cycle * 1000000000) {
/* ntpd can slew the clock at 120% real time
* so do not lock out slightly short cycles
* use 50% of cycle time as lock out limit.
* ignore that system time may jump. */
diff = timespec_diff_ns(shm_stat.tvc, tick[i]);
if ( (cycle * 500000000LL) <= diff) {
printf("sample %s %ld.%09ld %ld.%09ld %ld.%09ld %d %3d\n",
ntp_name(i),
(long)shm_stat.tvc.tv_sec, shm_stat.tvc.tv_nsec,


+ 1
- 1
packaging/rpm/gpsd.spec View File

@@ -1,7 +1,7 @@
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

Name: gpsd
Version: 3.15
Version: 3.16
Release: 1%{?dist}
Summary: Service daemon for mediating access to a GPS



+ 8
- 8
packet.c View File

@@ -225,7 +225,7 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c)
lexer->state = COMMENT_BODY;
break;
}
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
if (c == '$') {
lexer->state = NMEA_DOLLAR;
break;
@@ -234,7 +234,7 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c)
lexer->state = NMEA_BANG;
break;
}
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */
#if defined(TNT_ENABLE) || defined(GARMINTXT_ENABLE) || defined(ONCORE_ENABLE)
if (c == '@') {
#ifdef RTCM104V2_ENABLE
@@ -345,7 +345,7 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c)
else if (!isprint(c))
return character_pushback(lexer, GROUND_STATE);
break;
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
case NMEA_DOLLAR:
if (c == 'G')
lexer->state = NMEA_PUB_LEAD;
@@ -788,7 +788,7 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c)
else
return character_pushback(lexer, GROUND_STATE);
break;
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */
#ifdef SIRF_ENABLE
case SIRF_LEADER_1:
if (c == 0xa2)
@@ -1118,10 +1118,10 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c)
case UBX_RECOGNIZED:
if (c == 0xb5)
lexer->state = UBX_LEADER_1;
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
else if (c == '$') /* LEA-5H can and will output NMEA and UBX back to back */
lexer->state = NMEA_DOLLAR;
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */
#ifdef PASSTHROUGH_ENABLE
else if (c == '{')
return character_pushback(lexer, JSON_LEADER);
@@ -1526,7 +1526,7 @@ void packet_parse(struct gps_lexer_t *lexer)
lexer->state = GROUND_STATE;
break;
}
#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
else if (lexer->state == NMEA_RECOGNIZED) {
/*
* $PASHR packets have no checksum. Avoid the possibility
@@ -1591,7 +1591,7 @@ void packet_parse(struct gps_lexer_t *lexer)
packet_discard(lexer);
break;
}
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */
#ifdef SIRF_ENABLE
else if (lexer->state == SIRF_RECOGNIZED) {
unsigned char *trailer = lexer->inbufptr - 4;


+ 2
- 2
packet_names.h View File

@@ -4,7 +4,7 @@
"COMMENT_BODY", /* pound comment for a test load */
"COMMENT_RECOGNIZED", /* comment recognized */

#ifdef NMEA_ENABLE
#ifdef NMEA0183_ENABLE
"NMEA_DOLLAR", /* we've seen first character of NMEA leader */
"NMEA_BANG", /* we've seen first character of an AIS message '!' */
"NMEA_PUB_LEAD", /* seen second character of NMEA G leader */
@@ -37,7 +37,7 @@
"TRANSDUCER_LEAD_1", /* Generic transducer packet leader 'Y' */
"BEIDOU_LEAD_1", /* Beidou leader */
"QZSS_LEAD_1", /* Quasi-Zenith Satellite System leader */
#endif /* NMEA_ENABLE */
#endif /* NMEA0183_ENABLE */

"DLE_LEADER", /* we've seen the TSIP/EverMore leader (DLE) */



+ 2
- 2
packet_states.h View File

@@ -4,7 +4,7 @@
COMMENT_BODY, /* pound comment for a test load */
COMMENT_RECOGNIZED, /* comment recognized */