summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-09-08 00:06:14 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-09-08 00:06:14 -0400
commite554be09ab84bbaa4834f8bd52a2a995d20e0fb4 (patch)
tree78e867d4c6d0825bf6b25e70c3b9fca2c8da3044
parent6a22085a0b7047a0a410f288dea5703537fc1aa2 (diff)
downloadgpsd-e554be09ab84bbaa4834f8bd52a2a995d20e0fb4.tar.gz
Enable packet sniffer to recognize ECDIS NMEA packets with $EC leader.
This was a user feature request. All regression tests pass.
-rw-r--r--NEWS2
-rw-r--r--gpsd.xml9
-rw-r--r--packet.c9
-rw-r--r--packet_states.h1
4 files changed, 17 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index fda80d05..4b73a499 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
* Thu Sep 1 2011 Eric S. Raymond <esr@snark.thyrsus.com> - 3.2~dev
In the build recipe, (1) set pkgconfigdir properly for 64-bit Fedora systems,
(2) clean up various derived files including *.pyc on scons -c.
+ The packet sniffer now accepts NMEA packets with the ECDIS packet
+ leader 'EC'.
* Sun Aug 28 2011 Eric S. Raymond <esr@snark.thyrsus.com> - 3.1
The Irene release, rocking you like a hurricane and brought to you
diff --git a/gpsd.xml b/gpsd.xml
index 1ecbfee1..7ddec6ce 100644
--- a/gpsd.xml
+++ b/gpsd.xml
@@ -855,10 +855,11 @@ sentences: RMC, GGA, GLL, GSA, GSV, VTG, ZDA. It recognizes these
with either the normal GP talker-ID prefix, or with the GN prefix used
by GLONASS, or with the II prefix emitted by Seahawk Autohelm marine
navigation systems, or with the IN prefix emitted by some Garmin
-units. It recognizes some vendor extensions: the PGRME emitted by some
-Garmin GPS models, the OHPR emitted by Oceanserver digital compasses,
-the PTNTHTM emitted by True North digital compasses, and the PASHR
-sentences emitted by some Ashtech GPSes.</para>
+units, or with the EC prefix emitted by ECDIS units. It recognizes
+some vendor extensions: the PGRME emitted by some Garmin GPS models,
+the OHPR emitted by Oceanserver digital compasses, the PTNTHTM emitted
+by True North digital compasses, and the PASHR sentences emitted by
+some Ashtech GPSes.</para>
<para>Note that <application>gpsd</application> JSON returns pure decimal
degrees, not the hybrid degree/minute format described in the NMEA
diff --git a/packet.c b/packet.c
index 4c92de80..5d5f125e 100644
--- a/packet.c
+++ b/packet.c
@@ -91,6 +91,7 @@ PERMISSIONS
* GN -- Mixed GPS and GLONASS data, according to IEIC 61162-1
* II -- Integrated Instrumentation (Raytheon's SeaTalk system).
* IN -- Integrated Navigation (Garmin uses this).
+ * EC -- Electronic Chart Display & Information System (ECDIS)
*
*/
@@ -319,6 +320,8 @@ static void nextstate(struct gps_packet_t *lexer, unsigned char c)
lexer->state = SEATALK_LEAD_1;
else if (c == 'A') /* SiRF Ack */
lexer->state = SIRF_ACK_LEAD_1;
+ else if (c == 'E') /* ECDIS */
+ lexer->state = ECDIS_LEAD_1;
#ifdef OCEANSERVER_ENABLE
else if (c == 'C')
lexer->state = NMEA_LEADER_END;
@@ -489,6 +492,12 @@ static void nextstate(struct gps_packet_t *lexer, unsigned char c)
else
lexer->state = GROUND_STATE;
break;
+ case ECDIS_LEAD_1:
+ if (c == 'C') /* ECDIS leader accepted */
+ lexer->state = NMEA_LEADER_END;
+ else
+ lexer->state = GROUND_STATE;
+ break;
#ifdef TRIPMATE_ENABLE
case ASTRAL_1:
if (c == 'S') {
diff --git a/packet_states.h b/packet_states.h
index 07adaeda..800fb4e1 100644
--- a/packet_states.h
+++ b/packet_states.h
@@ -25,6 +25,7 @@
AIS_LEAD_2, /* seen I of possible marine AIS message */
SEATALK_LEAD_1, /* SeaTalk/Garmin packet leader 'I' */
+ ECDIS_LEAD_1, /* ECDIS packet leader 'E' */
#endif /* NMEA_ENABLE */
DLE_LEADER, /* we've seen the TSIP/EverMore leader (DLE) */