diff --git a/.vscode/settings.json b/.vscode/settings.json index 134caed..6748541 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,5 +4,5 @@ "editor.formatOnSave": true, "modulename": "${workspaceFolderBasename}", "distname": "${workspaceFolderBasename}", - "moduleversion": "1.0.41", + "moduleversion": "1.0.42", } \ No newline at end of file diff --git a/README.md b/README.md index d5f88b3..0050500 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Companion libraries are available which handle UBX © and RTCM3 © messa ![Contributors](https://img.shields.io/github/contributors/semuconsulting/pynmeagps.svg) ![Open Issues](https://img.shields.io/github/issues-raw/semuconsulting/pynmeagps) -The library implements a comprehensive set of outbound (GET) and inbound (SET/POLL) GNSS NMEA messages relating to GNSS/GPS devices, but is readily [extensible](#extensibility). Refer to [`NMEA_MSGIDS`](https://github.com/semuconsulting/pynmeagps/blob/master/src/pynmeagps/nmeatypes_core.py#L172) and [`NMEA_MSGIDS_PROP`](https://github.com/semuconsulting/pynmeagps/blob/master/src/pynmeagps/nmeatypes_core.py#L224) for the complete dictionary of standard and proprietary messages currently supported. While the [NMEA 0183 protocol itself is proprietary](https://www.nmea.org/nmea-0183.html), the definitions here have been collated from public domain sources. +The library implements a comprehensive set of outbound (GET) and inbound (SET/POLL) GNSS NMEA messages relating to GNSS/GPS and Maritime devices, but is readily [extensible](#extensibility). Refer to [`NMEA_MSGIDS`](https://github.com/semuconsulting/pynmeagps/blob/master/src/pynmeagps/nmeatypes_core.py#L172) and [`NMEA_MSGIDS_PROP`](https://github.com/semuconsulting/pynmeagps/blob/master/src/pynmeagps/nmeatypes_core.py#L224) for the complete dictionary of standard and proprietary messages currently supported. While the [NMEA 0183 protocol itself is proprietary](https://www.nmea.org/nmea-0183.html), the definitions here have been collated from public domain sources. Sphinx API Documentation in HTML format is available at [https://www.semuconsulting.com/pynmeagps](https://www.semuconsulting.com/pynmeagps). diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index efad57f..deb1088 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,5 +1,12 @@ # pynmeagps Release Notes +### RELEASE 1.0.42 + +ENHANCEMENTS: + +1. Add additional maritime talker IDs and NMEA sentence definitions. +1. Add `DTL` date format ddmmyyyy. + ### RELEASE 1.0.41 ENHANCEMENTS: diff --git a/docs/pynmeagps.rst b/docs/pynmeagps.rst index 803322a..dd18ecc 100644 --- a/docs/pynmeagps.rst +++ b/docs/pynmeagps.rst @@ -52,6 +52,14 @@ pynmeagps.nmeatypes\_get module :undoc-members: :show-inheritance: +pynmeagps.nmeatypes\_get\_prop module +------------------------------------- + +.. automodule:: pynmeagps.nmeatypes_get_prop + :members: + :undoc-members: + :show-inheritance: + pynmeagps.nmeatypes\_poll module -------------------------------- diff --git a/pyproject.toml b/pyproject.toml index 1241c4c..c4d381b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "pynmeagps" authors = [{ name = "semuadmin", email = "semuadmin@semuconsulting.com" }] maintainers = [{ name = "semuadmin", email = "semuadmin@semuconsulting.com" }] description = "NMEA protocol parser and generator" -version = "1.0.41" +version = "1.0.42" license = { file = "LICENSE" } readme = "README.md" requires-python = ">=3.8" diff --git a/src/pynmeagps/__init__.py b/src/pynmeagps/__init__.py index b6cc82d..db832bb 100644 --- a/src/pynmeagps/__init__.py +++ b/src/pynmeagps/__init__.py @@ -20,6 +20,9 @@ from pynmeagps.nmeareader import NMEAReader from pynmeagps.nmeatypes_core import * from pynmeagps.nmeatypes_get import * +from pynmeagps.nmeatypes_get_prop import * +from pynmeagps.nmeatypes_poll import * +from pynmeagps.nmeatypes_set import * from pynmeagps.socket_wrapper import SocketWrapper version = __version__ diff --git a/src/pynmeagps/_version.py b/src/pynmeagps/_version.py index bcae195..b373538 100644 --- a/src/pynmeagps/_version.py +++ b/src/pynmeagps/_version.py @@ -8,4 +8,4 @@ :license: BSD 3-Clause """ -__version__ = "1.0.41" +__version__ = "1.0.42" diff --git a/src/pynmeagps/nmeahelpers.py b/src/pynmeagps/nmeahelpers.py index 33165da..73ca1ed 100644 --- a/src/pynmeagps/nmeahelpers.py +++ b/src/pynmeagps/nmeahelpers.py @@ -18,6 +18,7 @@ from pynmeagps.nmeatypes_core import ( DM, DT, + DTL, GPSEPOCH0, LA, LN, @@ -150,13 +151,18 @@ def date2utc(dates: str, form: str = DT) -> datetime.date: Convert NMEA Date to UTC datetime. :param str dates: NMEA date - :param str form: date format DT = ddmmyy, DM = mmddyy (DT) + :param str form: date format DT = ddmmyy, DTL = ddmmyyyy, DM = mmddyy (DT) :return: UTC date YYyy:mm:dd :rtype: datetime.date """ try: - dform = "%m%d%y" if form == DM else "%d%m%y" + if form == "DM": + dform = "%m%d%y" + elif form == "DTL": + dform = "%d%m%Y" + else: + dform = "%d%m%y" utc = datetime.strptime(dates, dform) return utc.date() except (TypeError, ValueError): @@ -201,13 +207,18 @@ def date2str(dat: datetime.date, form: str = DT) -> str: Convert datetime.date to NMEA formatted string. :param datetime.date dat: date - :param str form: date format DT = ddmmyy, DM = mmddyy (DT) + :param str form: date format DT = ddmmyy, DTL = ddmmyyyy, DM = mmddyy (DT) :return: NMEA formatted date string :rtype: str """ try: - dform = "%m%d%y" if form == DM else "%d%m%y" + if form == DM: + dform = "%m%d%y" + elif form == DTL: + dform = "%d%m%Y" + else: + dform = "%d%m%y" return dat.strftime(dform) except (AttributeError, TypeError, ValueError): return "" diff --git a/src/pynmeagps/nmeamessage.py b/src/pynmeagps/nmeamessage.py index f4eaf3f..47d7a49 100644 --- a/src/pynmeagps/nmeamessage.py +++ b/src/pynmeagps/nmeamessage.py @@ -17,6 +17,7 @@ import pynmeagps.exceptions as nme import pynmeagps.nmeatypes_core as nmt import pynmeagps.nmeatypes_get as nmg +import pynmeagps.nmeatypes_get_prop as nmgp import pynmeagps.nmeatypes_poll as nmp import pynmeagps.nmeatypes_set as nms from pynmeagps.nmeahelpers import ( @@ -64,6 +65,7 @@ def __init__( self._logger = getLogger(__name__) self._validate = validate self._nominal = False # flag for unrecognised NMEA sentence types + self._proprietary = False # proprietary message definition if msgmode not in (0, 1, 2): raise nme.NMEAMessageError( @@ -71,11 +73,11 @@ def __init__( ) if talker not in nmt.NMEA_TALKERS: raise nme.NMEAMessageError(f"Unknown talker {talker}.") - if ( - msgID not in (nmt.NMEA_MSGIDS) - and msgID not in (nmt.NMEA_MSGIDS_PROP) - and msgID not in (nmt.PROP_MSGIDS) - ): + if msgID in nmt.NMEA_MSGIDS: + self._proprietary = False + elif msgID in nmt.NMEA_MSGIDS_PROP or msgID in nmt.PROP_MSGIDS: + self._proprietary = True + else: if self._validate & nmt.VALMSGID: raise nme.NMEAMessageError( f"Unknown msgID {talker}{msgID}, msgmode {('GET','SET','POLL')[msgmode]}." @@ -293,6 +295,8 @@ def _get_dict(self, **kwargs) -> dict: return nmp.NMEA_PAYLOADS_POLL[key] if self._mode == nmt.SET: return nms.NMEA_PAYLOADS_SET[key] + if self._proprietary: + return nmgp.NMEA_PAYLOADS_GET_PROP[key] return nmg.NMEA_PAYLOADS_GET[key] except KeyError as err: erm = f"Unknown msgID {key} msgmode {('GET', 'SET', 'POLL')[self._mode]}." @@ -520,7 +524,7 @@ def val2str(val, att: str, hpmode: bool = False) -> str: vals = ddd2dmm(val, att, hpmode) elif att == nmt.TM: vals = time2str(val) - elif att in (nmt.DT, nmt.DM): + elif att in (nmt.DT, nmt.DTL, nmt.DM): vals = date2str(val, att) else: raise nme.NMEATypeError(f"Unknown attribute type {att}.") @@ -551,7 +555,7 @@ def nomval(att: str) -> object: val = 0 elif att == nmt.TM: val = datetime.now(timezone.utc).time() - elif att == nmt.DT: + elif att in (nmt.DT, nmt.DTL, nmt.DM): val = datetime.now(timezone.utc).date() else: raise nme.NMEATypeError(f"Unknown attribute type {att}.") diff --git a/src/pynmeagps/nmeatypes_core.py b/src/pynmeagps/nmeatypes_core.py index 41a760b..d376ef5 100644 --- a/src/pynmeagps/nmeatypes_core.py +++ b/src/pynmeagps/nmeatypes_core.py @@ -43,10 +43,6 @@ ERR_IGNORE = 0 """Ignore errors""" -# proprietary messages where msgId is first element of payload: -PROP_MSGIDS = ("FEC", "UBX", "TNL", "ASHR", "GPPADV") -"""Proprietary message prefixes""" - GNSSLIST = { 0: "GPS", 1: "SBAS", @@ -85,6 +81,7 @@ CH = "CH" # Character DE = "DE" # Decimal DT = "DT" # Date ddmmyy +DTL = "DTL" # Date ddmmyyyy DM = "DM" # Date mmddyy HX = "HX" # Hexadecimal Integer IN = "IN" # Integer @@ -95,7 +92,7 @@ ST = "ST" # String TM = "TM" # Time hhmmss.ss -VALID_TYPES = (CH, DE, DM, DT, HX, IN, LA, LAD, LN, LND, ST, TM) +VALID_TYPES = (CH, DE, DM, DT, DTL, HX, IN, LA, LAD, LN, LND, ST, TM) # ***************************************** # THESE ARE THE NMEA V4 PROTOCOL TALKER IDS @@ -165,18 +162,35 @@ # *************************************************************** "HD": "Hull Door Monitoring", "HS": "Hull Stress Monitoring", + "IC": "Integrated Communications System", "II": "Integrated Instrumentation", "IN": "Integrated Navigation", "LC": "Loran C", "MP": "Microprocessor Controller", + "ND": "Network Device", + "NL": "Navigation Light Controller", "RA": "Radar and/or Radar Plotting", + "RC": "Propulsion Machinery including Remote Control", "SA": "Physical Shore AIS Station", "SC": "Steering Control System/Device", "SD": "Sounder, Depth", "SG": "Steering Gear/Steering Engine", + "SI": "Serial to Network Gateway Function", "SN": "Electronic Positioning System", "SS": "Sounder, Scanning", "TC": "Track Control System", + "TI": "Turn Rate Indicator", + "UP": "Microprocessor Controller", + "U0": "User-configured talker identifier", + "U1": "User-configured talker identifier", + "U2": "User-configured talker identifier", + "U3": "User-configured talker identifier", + "U4": "User-configured talker identifier", + "U5": "User-configured talker identifier", + "U6": "User-configured talker identifier", + "U7": "User-configured talker identifier", + "U8": "User-configured talker identifier", + "U9": "User-configured talker identifier", # *************************************************************** # Velocity Sensors: # *************************************************************** @@ -205,51 +219,50 @@ # Payloads for each of these identities are defined in the nmeatypes_* modules # Commented-out entries are those which have not yet been implemented, # principally because no public domain definition has yet been identified. -# Full definitions can be found in NMEA 0183—Version 4.30 and IEC 61162-1:2024, -# but these are copyrighted. +# Full specifications can be found in NMEA 0183—v4.30, IEC 61162-1:2024. # **************************************************************************** NMEA_MSGIDS = { "AAM": "Waypoint arrival alarm", - # "ABK": "AIS addressed and binary broadcast acknowledgement", - # "ABM": "AIS addressed binary and safety related message", - # "ACA": "AIS channel assignment message", - # "ACK": "Acknowledge alarm", - # "ACN": "Alert Command", - # "ACS": "AIS channel management information source", + "ABK": "AIS addressed and binary broadcast acknowledgement", + "ABM": "AIS addressed binary and safety related message", + "ACA": "AIS channel assignment message", + "ACK": "Acknowledge alarm", + "ACN": "Alert Command", + "ACS": "AIS channel management information source", # "AGL": "Alert Group List", - # "AIR": "AIS interrogation request", - # "AKD": "Acknowledge detail alarm condition7", - # "ALA": "Report detailed alarm condition", - # "ALC": "Cyclic alert list", + "AIR": "AIS interrogation request", + "AKD": "Acknowledge detail alarm condition7", + "ALA": "Report detailed alarm condition", + "ALC": "Cyclic alert list", "ALF": "Alert sentence", - # "ALR": "Set alarm state", + "ALR": "Set alarm state", "APA": "Auto Pilot A sentence", # deprecated "APB": "Heading/track controller (autopilot) sentence", - # "ARC": "Alert command refused", - # "BBM": "AIS broadcast binary message", - # "BEC": "Bearing and distance to waypoint - Dead reckoning", + "ARC": "Alert command refused", + "BBM": "AIS broadcast binary message", + "BEC": "Bearing and distance to waypoint - Dead reckoning", "BOD": "Bearing origin to destination", "BWC": "Bearing and distance to waypoint - Great circle", - # "BWR": "Bearing and distance to waypoint - Rhumb line", - # "BWW": "Bearing waypoint to waypoint", - # "CUR": "Water current layer - Multi-layer water current data", - # "DBT": "Depth below transducer", - # "DDC": "Display dimming control", - # "DOR": "Door status detection", - # "DPT": "Depth", - # "DSC": "Digital selective calling information", - # "DSE": "Expanded digital selective calling", + "BWR": "Bearing and distance to waypoint - Rhumb line", + "BWW": "Bearing waypoint to waypoint", + "CUR": "Water current layer - Multi-layer water current data", + "DBT": "Depth below transducer", + "DDC": "Display dimming control", + "DOR": "Door status detection", + "DPT": "Depth", + "DSC": "Digital selective calling information", + "DSE": "Expanded digital selective calling", "DTM": "Datum reference", - # "EPV": "Command or report equipment property value", - # "ETL": "Engine telegraph operation status", - # "EVE": "General event message", - # "FIR": "Fire detection", - # "FSI": "Frequency set information", + "EPV": "Command or report equipment property value", + "ETL": "Engine telegraph operation status", + "EVE": "General event message", + "FIR": "Fire detection", + "FSI": "Frequency set information", "GAQ": "Poll Standard Message - Talker ID GA (Galileo)", "GBQ": "Poll Standard Message - Talker ID GB (BeiDou)", "GBS": "GNSS satellite fault detection", - # "GEN": "Generic binary information", - # "GFA": "GNSS fix accuracy and integrity", + "GEN": "Generic binary information", + "GFA": "GNSS fix accuracy and integrity", "GGA": "Global positioning system fix data", "GLL": "Geographic position - Latitude/longitude", "GLQ": "Poll Standard Message - Talker ID GL (GLONASS)", @@ -262,90 +275,94 @@ "GSA": "GNSS DOP and active satellites", "GST": "GNSS pseudorange noise statistics", "GSV": "GNSS satellites in view", - # "HBT": "Heartbeat supervision sentence", - # "HCR": "Heading correction report", + "HBT": "Heartbeat supervision sentence", + "HCR": "Heading correction report", "HDG": "Heading, deviation and variation", "HDM": "Heading, Magnetic", # deprecated "HDT": "Heading true", - # "HMR": "Heading monitor receive", - # "HMS": "Heading monitor set", - # "HRM": "heel angle, roll period and roll amplitude measurement device", - # "HSC": "Heading steering command", - # "HSS": "Hull stress surveillance systems", - # "HTC": "Heading/track control command", - # "HTD": "Heading /track control", + "HMR": "Heading monitor receive", + "HMS": "Heading monitor set", + "HRM": "heel angle, roll period and roll amplitude measurement device", + "HSC": "Heading steering command", + "HSS": "Hull stress surveillance systems", + "HTC": "Heading/track control command", + "HTD": "Heading /track control", "LLQ": "Leica local position and quality", - # "LR1": "AIS long-range reply sentence 1", - # "LR2": "AIS long-range reply sentence 2", - # "LR3": "AIS long-range reply sentence 3", - # "LRF": "AIS long-range function", - # "LRI": "AIS long-range interrogation", - # "MOB": "Man over board notification", + "LR1": "AIS long-range reply sentence 1", + "LR2": "AIS long-range reply sentence 2", + "LR3": "AIS long-range reply sentence 3", + "LRF": "AIS long-range function", + "LRI": "AIS long-range interrogation", + "MOB": "Man over board notification", "MSK": "MSK receiver interface", "MSS": "MSK receiver signal status", - # "MTW": "Water temperature", - # "MWD": "Wind direction and speed", - # "MWV": "Wind speed and angle", - # "NAK": "Negative acknowledgement", - # "NRM": "NAVTEX receiver mask", - # "NRX": "NAVTEX received message", - # "NSR": "Navigation status report", - # "OSD": "Own ship data", - # "POS": "Device position and ship dimensions report or configuration", - # "PRC": "Propulsion remote control status", + "MTW": "Water temperature", + "MWD": "Wind direction and speed", + "MWV": "Wind speed and angle", + "NAK": "Negative acknowledgement", + "NRM": "NAVTEX receiver mask", + "NRX": "NAVTEX received message", + "NSR": "Navigation status report", + "OSD": "Own ship data", + "POS": "Device position and ship dimensions report or configuration", + "PRC": "Propulsion remote control status", "RLM": "Return link message", "RMA": "Recommended minimum specific LORAN-C data", "RMB": "Recommended minimum navigation information", "RMC": "Recommended minimum specific GNSS data", - # "ROR": "Rudder order status", + "ROR": "Rudder order status", "ROT": "Rate of turn", - # "RRT": "Report route transfer", - # "RPM": "Revolutions", - # "RSA": "Rudder sensor angle", - # "RSD": "Radar system data", + "RRT": "Report route transfer", + "RPM": "Revolutions", + "RSA": "Rudder sensor angle", + "RSD": "Radar system data", "RTE": "Routes", - # "SFI": "Scanning frequency information", - # "SMI": "SafetyNET Message, All Ships/NavArea", - # "SM2": "SafetyNET Message, Coastal Warning Area", - # "SM3": "SafetyNET Message, Circular Area address", - # "SM4": "SafetyNET Message, Rectangular Area Address", - # "SMB": "IMO SafetyNET Message Body", - # "SPW": "Security password sentence", - # "SSD": "AIS ship static data", + "SFI": "Scanning frequency information", + "SM1": "SafetyNET Message, All Ships/NavArea", + "SM2": "SafetyNET Message, Coastal Warning Area", + "SM3": "SafetyNET Message, Circular Area address", + "SM4": "SafetyNET Message, Rectangular Area Address", + "SMB": "IMO SafetyNET Message Body", + "SPW": "Security password sentence", + "SSD": "AIS ship static data", "STN": "Multiple data ID", "THS": "True heading and status", - # "TLB": "Target label", - # "TLL": "Target latitude and longitude", - # "TRC": "Thruster control data", - # "TRL": "AIS transmitter-non-functioning log", - # "TRD": "Thruster response data", + "TLB": "Target label", + "TLL": "Target latitude and longitude", + "TRC": "Thruster control data", + "TRL": "AIS transmitter-non-functioning log", + "TRD": "Thruster response data", "TRF": "Transit Fix Data", # deprecated - # "TTD": "Tracked target data", - # "TTM": "Tracked target message", - # "TUT": "Transmission of multi-language text", + "TTD": "Tracked target data", + "TTM": "Tracked target message", + "TUT": "Transmission of multi-language text", "TXT": "Text transmission", - # "UID": "User identification code transmission", + "UID": "User identification code transmission", "VBW": "Dual ground/water speed", - # "VDM": "AIS VHF data-link message", - # "VDO": "AIS VHF data-link own-vessel report", - # "VDR": "Set and drift", - # "VER": "Version", - # "VHW": "Water speed and heading", + "VDM": "AIS VHF data-link message", + "VDO": "AIS VHF data-link own-vessel report", + "VDR": "Set and drift", + "VER": "Version", + "VHW": "Water speed and heading", "VLW": "Dual ground/water distance", - # "VPW": "Speed measured parallel to wind", - # "VSD": "AIS voyage static data", + "VPW": "Speed measured parallel to wind", + "VSD": "AIS voyage static data", "VTG": "Course over ground and ground speed", - # "WAT": "Water level detection", - # "WCV": "Waypoint closure velocity", - # "WNC": "Distance waypoint to waypoint", + "WAT": "Water level detection", + "WCV": "Waypoint closure velocity", + "WNC": "Distance waypoint to waypoint", "WPL": "Waypoint location", - # "XDR": "Transducer measurements", + "XDR": "Transducer measurements", "XTE": "Cross-track error, measured", - # "XTR": "Cross-track error, dead reckoning", + "XTR": "Cross-track error, dead reckoning", "ZDA": "Time and date", - # "ZDL": "Time and distance to variable point", - # "ZFO": "UTC and time from origin waypoint", - # "ZTG": "UTC and time to destination waypoint", + "ZDL": "Time and distance to variable point", + "ZFO": "UTC and time from origin waypoint", + "ZTG": "UTC and time to destination waypoint", + # *************************************************************** + # Dummy message for testing only + # *************************************************************** + "FOO": "Dummy message", } NMEA_MSGIDS_PROP = { # *************************************************************** @@ -460,8 +477,8 @@ "LSR": "Set status response", "LSVD": "Attitude yaw, pitch, roll", # "MTKnnn": "Proprietary command sets - not implemented", - # *************************************************************** - # Dummy message for testing only - # *************************************************************** - "FOO": "Dummy message", } + +# proprietary messages where msgId is first element of payload: +PROP_MSGIDS = ("FEC", "UBX", "TNL", "ASHR", "GPPADV") +"""Proprietary message prefixes""" diff --git a/src/pynmeagps/nmeatypes_get.py b/src/pynmeagps/nmeatypes_get.py index d2b958e..4b2783c 100644 --- a/src/pynmeagps/nmeatypes_get.py +++ b/src/pynmeagps/nmeatypes_get.py @@ -27,7 +27,7 @@ :author: semuadmin """ -from pynmeagps.nmeatypes_core import CH, DE, DM, DT, HX, IN, LA, LAD, LN, LND, ST, TM +from pynmeagps.nmeatypes_core import CH, DE, DT, DTL, HX, IN, LA, LAD, LN, LND, ST, TM NMEA_PAYLOADS_GET = { # ********************************************* @@ -37,9 +37,135 @@ "arrce": CH, "perp": CH, "crad": DE, - "cUnit": CH, + "cUnit": CH, # N nm "wpt": ST, }, + "ABK": { + "mmsi": ST, + "aischan": CH, + "itumsg": ST, + "msgSeq": IN, + "ackType": IN, + }, + "ABM": { + "numSen": IN, + "senNum": IN, + "mmsi": ST, + "aischan": CH, + "ituMsg": ST, + "data": ST, + "fillbits": IN, + }, + "ACA": { + "seqNum": IN, + "latne": LA, + "latneNS": LAD, + "lonne": LN, + "lonneEW": LND, + "latsw": LA, + "latswNS": LAD, + "lonswq": LN, + "lonswEW": LND, + "tranZoneSize": CH, + "chanA": CH, + "chanAbw": CH, + "chanB": CH, + "chanBbw": CH, + "txrxMode": IN, + "pwrLevelCtl": IN, + "infoSource": CH, + "inuse": IN, + "inuseTime": TM, + }, + "ACK": { + "alarmid": ST, + }, + "ACN": { + "time": TM, + "mfrcode": ST, + "alertid": ST, + "alertnum": IN, + "alertcmd": ST, + "status": CH, + }, + "ACS": { + "seqNum": IN, + "mmsi": ST, + "utc": TM, + "day": IN, + "month": IN, + "year": IN, + }, + "AIR": { + "mmsi1": ST, + "mmsi1msg1": ST, + "mmsi1msg1sub": ST, + "mmsi1msg2": ST, + "mmsi1msg2sub": CH, + "mmsi2": ST, + "mmsi2msg1": ST, + "mmsi2msg1sub": ST, + "channel": ST, + "mid11": ST, + "mid12": ST, + "mid21": ST, + }, + "AKD": { + "acktime": TM, + "srcsystem": ST, + "srcsubsysytem": ST, + "srcinstance": ST, + "alarmtype": ST, + "acksystem": ST, + "acksubsystem": ST, + "ackinstance": ST, + }, + "ALA": { + "evttime": TM, + "srcsystem": ST, + "srcsubsysytem": ST, + "srcinstance": ST, + "alarmtype": ST, + "alarmcond": ST, + "alarmackstate": ST, + "alarmtext": ST, + }, + "ALC": { + "numSen": IN, + "senNum": IN, + "seqmid": IN, + "numAlerts": IN, + "alertgroup": ( # repeating group * numAlerts + "numAlerts", + { + "mfrcode": ST, + "alertid": ST, + "revisionctr": ST, + }, + ), + }, + "ALF": { + "numSen": IN, + "senNum": IN, + "seqmid": IN, + "timelastchange": TM, + "alertcat": CH, # A, B, C + "alertpriority": CH, # E, A W, C + "alertstate": CH, # A, S, N, O, U, V + "mfrcode": ST, + "alertid": ST, + "alertinst": ST, + "revisionctr": ST, + "escalationctr": ST, + "alerttxt": ST, # max 16 chars + }, + "ALR": { + "timealarmchange": TM, + "alarmnum": ST, + "alarmcond": ST, + "alarmstate": ST, + "alarmtext": ST, + }, "APA": { "LCgwarn": CH, "LCcwarn": CH, @@ -52,21 +178,6 @@ "bearP2Du": CH, "wpt": ST, }, - "ALF": { - "numMsg": IN, - "msgNum": IN, - "seqmsgId": IN, - "timelastchange": TM, - "alertcat": CH, # A, B, C - "alertpriority": CH, # E, A W, C - "alertstate": CH, # A, S, N, O, U, V - "manufacturercode": ST, - "alertId": ST, - "alertinst": ST, - "revisionctr": ST, - "escalationctr": ST, - "alerttxt": ST, # max 16 chars - }, "APB": { "LCgwarn": CH, "LCcwarn": CH, @@ -82,6 +193,37 @@ "bearDu": CH, "bearS": DE, "bearSu": CH, + "mode": CH, + }, + "ARC": { + "time": TM, + "mfrcode": ST, + "alertid": ST, + "alertinst": IN, + "alertcmd": ST, + }, + "BBM": { + "numSen": IN, + "senNum": IN, + "seqmid": IN, + "aischan": CH, + "itumsg": ST, + "data": ST, + "fillbits": IN, + }, + "BEC": { + "utc": TM, + "wptlat": LA, + "wptNS": LAD, + "wptlon": LN, + "wptEW": LND, + "bearT": DE, + "bearTu": CH, # 'T'rue + "bearM": DE, + "bearMu": CH, # 'M'agnetic + "dist": DE, + "distu": CH, # 'N'autical Miles + "wpt": ST, }, "BOD": { "bearT": DE, @@ -92,18 +234,111 @@ "wptO": ST, }, "BWC": { - "fixutc": ST, + "fixutc": TM, "lat": LA, "NS": LAD, "lon": LN, "EW": LND, "bearT": DE, - "bearTu": CH, + "bearTu": CH, # 'T' "bearM": DE, - "bearMu": CH, + "bearMu": CH, # 'M' + "dist": DE, + "distUnit": CH, # 'N' + "wpt": ST, + "mode": CH, + }, + "BWR": { + "fixutc": TM, + "lat": LA, + "NS": LAD, + "lon": LN, + "EW": LND, + "bearT": DE, + "bearTu": CH, # 'T' + "bearM": DE, + "bearMu": CH, # 'M' "dist": DE, - "distUnit": CH, + "distUnit": CH, # 'N' "wpt": ST, + "mode": CH, + }, + "BWW": { + "bearT": DE, + "bearTu": CH, # 'T' + "bearM": DE, + "bearMu": CH, # 'M' + "wptto": ST, + "wptfrom": ST, + }, + "CUR": { + "valid": CH, + "datasetnum": IN, + "layernum": IN, + "depth": DE, + "direction": DE, + "dirTR": CH, # 'T' or 'R' + "speed": DE, + "refdepth": DE, + "heading": DE, + "headingTM": CH, # 'T' or 'M' + "speedref": CH, # 'B', 'W', 'P' + }, + "DBT": { + "depthf": DE, + "depthfu": CH, # 'f'eet + "depthm": DE, + "depthmu": CH, # 'M'eter + "depthfath": DE, + "depthfathu": CH, # 'F'athoms + }, + "DDC": { + "preset": CH, + "brightness": IN, + "palette": CH, + "status": CH, + }, + "DOR": { + "msgtype": CH, + "time": TM, + "doormontype": ST, + "div1ind": ST, + "div2ind": ST, + "doorcount": IN, + "doorstatus": CH, + "watertightdoorsetting": CH, + "msgtext": ST, + }, + "DPT": { + "depth": DE, # m + "offset": DE, + "rangescale": DE, + }, + "DSC": { + "format": ST, + "address": ST, + "category": ST, + "distresstype": ST, + "commtype": ST, + "channel": ST, + "timetelno": ST, + "mmsi": ST, + "distressnature": ST, + "acknowledgement": CH, + "expansionind": CH, + }, + "DSE": { + "numSen": IN, + "senNum": IN, + "queryflag": CH, + "mmsi": ST, + "datagroup": ( + "None", # variable repeating group + { + "code": ST, + "data": ST, + }, + ), }, "DTM": { "datum": ST, @@ -115,6 +350,44 @@ "alt": DE, "refDatum": ST, }, + "EPV": { + "status": CH, + "equipmenttype": ST, + "equipmentid": ST, + "propertyid": ST, + "value": ST, + }, + "ETL": { + "time": TM, + "msgtype": CH, + "engtelposind": ST, + "engsubtelposind": ST, + "operatinglocind": CH, + "enginenum": CH, + }, + "EVE": { + "time": TM, + "tagcode": ST, + "eventtext": ST, + }, + "FIR": { + "msgtype": CH, + "time": TM, + "fdstype": ST, + "div1ind": ST, + "div2ind": ST, + "fdsnum": ST, + "condition": CH, + "alarmackstate": CH, + "text": ST, + }, + "FSI": { + "txfreq": ST, + "rxfreq": ST, + "opmode": ST, + "power": IN, + "status": CH, + }, "GBS": { "time": TM, "errLat": DE, @@ -127,6 +400,22 @@ "systemId": HX, # NMEA >=4.10 only "signalId": HX, # NMEA >=4.10 only }, + "GEN": { + "index": HX, + "time": TM, + "group": ("None", {"data": HX}), # variable repeating group + }, + "GFA": { + "time": TM, + "hprotlvl": DE, + "vprotlvl": DE, + "semimajstddev": DE, + "semiminstddev": DE, + "semimajorientation": DE, + "altstddev": DE, + "accuracy": DE, + "integrity": ST, # V not in use, 'S'afe, 'C'aution, 'U'nsafe + }, "GGA": { "time": TM, "lat": LA, @@ -232,20 +521,173 @@ ), "signalID": HX, # NMEA >=4.10 only }, + "HBT": { + "repeatint": DE, + "status": CH, + "seqid": IN, + }, + "HCR": { + "headingt": DE, + "mode": CH, + "corrstate": CH, + "corrvalue": DE, + }, "HDG": { - "heading": DE, - "MT": CH, # 'M' + "headingM": DE, + "deviation": DE, + "deviationEW": LND, + "variation": DE, + "variationEW": LND, }, "HDM": { - "heading": DE, - "devm": DE, - "devEW": CH, - "varm": DE, - "varEW": CH, + "headingM": DE, + "deviation": DE, + "deviationEW": LND, + "variation": DE, + "variationEW": LND, }, "HDT": { - "heading": DE, - "MT": CH, # 'T' + "headingT": DE, + "headingTu": CH, # 'T' + }, + "HMR": { + "sensor1id": ST, + "sensor2id": ST, + "setdiff": DE, + "actualdiff": DE, + "warning": CH, # A within set, V exceeds set + "sensor1hdg": DE, + "sensor1status": CH, + "sensor1u": CH, # 'T'rue, 'M'agnetic + "sensor1dev": DE, + "sensor1EW": LND, + "sensor2hdg": DE, + "sensor2status": CH, + "sensor2u": CH, # 'T'rue, 'M'agnetic + "sensor2dev": DE, + "sensor2EW": LND, + "variation": DE, + "variationEW": LND, + }, + "HMS": { + "sensor1id": ST, + "sensor2id": ST, + "setdiff": DE, + }, + "HRM": { + "heel": DE, + "rollperiod": DE, + "rollamplitudeport": DE, + "rollamplitduestbd": DE, + "status": CH, + "rollpeakport": DE, + "rollpeakstbd": DE, + "peakholdresettime": TM, + "peakholdresetdat": IN, + "peakholdresetmonth": IN, + }, + "HSC": { + "cmdheadingT": DE, + "cmdheadingTu": CH, # 'T' + "cmdheadingM": DE, + "cmdheadingMu": CH, # 'M' + "status": CH, + }, + "HSS": { + "measpointid": ST, + "value": DE, + "status": CH, + }, + "HTC": { + "override": CH, # A in use V not in use + "cmdrudderang": DE, + "cmdrudderdir": CH, # L port R stbd + "steermode": CH, + "turnmode": CH, # 'R'adius, 'T'urn rate, 'N'ot controlled + "cmdrudderlimit": DE, + "cmdoffheadinglimit": DE, + "cmdturnradius": DE, + "cmdturnrate": DE, + "cmdheading": DE, + "cmdofftracklimit": DE, + "cmdtrack": DE, + "headingref": CH, # 'T'rue, 'M'agnetic + "status": CH, + }, + "HTD": { + "override": CH, # A in use V not in use + "cmdrudderang": DE, + "cmdrudderdir": CH, # L port R stbd + "steermode": CH, + "turnmode": CH, # 'R'adius, 'T'urn rate, 'N'ot controlled + "cmdrudderlimit": DE, + "cmdoffheadinglimit": DE, + "cmdturnradius": DE, + "cmdturnrate": DE, + "cmdheading": DE, + "cmdofftracklimit": DE, + "cmdtrack": DE, + "headingref": CH, # 'T'rue, 'M'agnetic + "rudderstatus": CH, + "offheadingstatus": CH, + "offtrackstatus": CH, + "vesselheading": DE, + }, + "LR1": { + "seqNum": IN, + "mmsiresponder": ST, + "mmsirequester": ST, + "shipname": ST, + "callsign": ST, + "imonum": ST, + }, + "LR2": { + "seqNum": IN, + "mmsiresponder": ST, + "date": DTL, + "time": TM, + "lat": LA, + "NS": LAD, + "lon": LN, + "EW": LND, + "cog": DE, # course over ground + "cogT": CH, # 'T' + "sog": DE, # speed over ground + "sogu": CH, # 'N' knots + }, + "LR3": { + "seqNum": IN, + "mmsiresponder": ST, + "destination": ST, + "etadate": DT, + "etatime": TM, + "draught": DE, + "cargo": DE, + "length": DE, + "breadth": DE, + "type": DE, + "persons": DE, + }, + "LRF": { + "seqNum": IN, + "mmsirequestor": ST, + "namerequestor": ST, + "function": ST, + "replystatus": ST, + }, + "LRI": { + "seqNum": IN, + "controlflag": CH, + "mmsirequestor": ST, + "mmsidestination": ST, + "latne": LA, + "NSne": LAD, + "lonne": LN, + "EWne": LND, + "latsw": LA, + "NSsw": LAD, + "lonsw": LN, + "EWsw": LND, }, "LLQ": { "utctime": TM, @@ -260,22 +702,135 @@ "height": DE, "hunit": CH, # 'M' }, + "MOB": { + "emitterid": ST, + "mobstatus": CH, + "timeactivation": TM, + "mobpossource": CH, + "dayactivated": IN, + "timeposition": TM, + "lat": LA, + "NS": LAD, + "lon": LN, + "EW": LND, + "cog": DE, # true + "sog": DE, # knots + "mmsi": ST, + "batterystatus": CH, + }, "MSK": { "freq": DE, - "fmode": CH, + "fmode": CH, # 'A'uto, 'M'anual "beacbps": IN, - "bpsmode": CH, + "bpsmode": CH, # 'A'uto, 'M'anual "MMSfreq": DE, + "channel": CH, + "status": CH, }, "MSS": { "strength": IN, "snr": IN, "freq": DE, "beacbps": IN, + "channel": CH, }, - "ROT": { - "rot": DE, # -ve = turn to port - "valid": CH, # A valid, V invalid + "MTW": { + "temp": DE, + "tempu": CH, # degrees C + }, + "MWD": { + "dirT": DE, + "dirTu": CH, # 'T'rue + "dirM": DE, + "dirMu": CH, # 'M'agnetic + "speedN": DE, + "speedNu": CH, # 'N' knots + "speedM": DE, + "speedMu": CH, # 'M' m/s + }, + "MWV": { + "angle": DE, + "reference": CH, # 'R'elative, 'T'heoretical + "speed": DE, + "speedu": CH, # K km/h, M m/s N knots + "status": CH, + }, + "NAK": { + "talker": ST, + "formatter": ST, + "identifier": ST, + "reason": ST, + "text": ST, + }, + "NRM": { + "function": CH, + "freqtable": CH, + "txcovermask": HX, + "msgtypemask": HX, + "status": CH, + }, + "NRX": { + "numSen": IN, + "senNum": IN, + "seqid": IN, + "msgcode": CH, + "freqtable": CH, + "time": TM, + "day": IN, + "month": IN, + "year": IN, + "totalchar": DE, + "totalbad": DE, + "status": CH, + "body": ST, + }, + "NSR": { + "hdgintegrity": CH, + "hdgplausibility": CH, + "posintegrity": CH, + "posplausibility": CH, + "stwintegrity": CH, + "stwplausibility": CH, + "sogcogintegrity": CH, + "sogcogplausibility": CH, + "depthintegrity": CH, + "depthplausibility": CH, + "stwmode": CH, + "timeintegrity": CH, + "timeplausibility": CH, + }, + "OSD": { + "hdg": DE, + "hdgstate": CH, + "course": DE, + "courseref": CH, + "speed": DE, + "speedref": CH, + "set": DE, + "drift": DE, + "speedu": CH, # K km/h N knots S mph + }, + "POS": { + "equipmentid": ST, + "equipmentnum": IN, + "posvalidity": CH, + "posx": DE, + "posy": DE, + "posz": DE, + "shipdimvalid": CH, + "width": DE, + "length": DE, + "status": CH, + }, + "PRC": { + "leverdmdpos": DE, + "leverdmdstatus": CH, + "rpmdemand": DE, + "rpmdemandstatus": CH, + "pitchdmd": DE, + "pitchmode": CH, + "operatinglocind": CH, + "engineshaftnum": IN, }, "RLM": { "beacon": HX, @@ -327,11 +882,58 @@ "posMode": CH, "navStatus": CH, # NMEA >=4.10 only }, + "ROR": { + "stbdrudderorder": DE, + "stbdrudderstatus": CH, + "portrudderorder": DE, + "portrudderstatus": CH, + "operatinglocind": CH, + }, + "ROT": { + "rot": DE, # -ve = turn to port + "valid": CH, # A valid, V invalid + }, + "RRT": { + "tfrtype": CH, + "tfrroutename": ST, + "tfrroutever": ST, + "wptid": ST, + "filestatus": CH, + "appstatus": CH, + }, + "RPM": { + "source": CH, + "engineshaftnum": IN, + "rpm": DE, + "pitch": DE, + "status": CH, + }, + "RSA": { + "stbdangle": DE, + "stbdstatus": CH, + "portangle": DE, + "portstatus": CH, + }, + "RSD": { + "origin1range": DE, + "origin1bearing": DE, + "vrm1": DE, + "ebl1": DE, + "origin2range": DE, + "origin2bearing": DE, + "vrm2": DE, + "ebl2": DE, + "cursorrange": DE, + "rangebearing": DE, + "rangescale": DE, + "rangeu": CH, # K kn N nautical mile S statute mile + "displayrot": CH, + }, "RTE": { "numMsg": IN, "msgNum": IN, "status": CH, # 'c'/'w' - "active": ST, + "routeid": ST, "group_wp": ( "None", { # repeating group @@ -339,6 +941,109 @@ }, ), }, + "SFI": { + "numSen": IN, + "senNum": IN, + "freqgroup": ( + 6, # repeating group * 6 + { + "freq": IN, + "mode": ST, + }, + ), + }, + "SM1": { + "MSIstatus": CH, + "msgnum": IN, + "LESseqnum": IN, + "LESid": IN, + "oceanregioncode": IN, + "prioritycode": IN, + "servicecode": IN, + "presentationcode": IN, + "year": IN, + "month": IN, + "day": IN, + "hour": IN, + "minute": IN, + "addresscode": IN, + }, + "SM2": { + "MSIstatus": CH, + "msgnum": IN, + "LESseqnum": IN, + "LESid": IN, + "oceanregioncode": IN, + "prioritycode": IN, + "servicecode": IN, + "presentationcode": IN, + "year": IN, + "month": IN, + "day": IN, + "hour": IN, + "minute": IN, + "coastalwarnnavarea": IN, + "coastalwarnarea": CH, + "coastalwarnsubjectind": CH, + }, + "SM3": { + "MSIstatus": CH, + "msgnum": IN, + "LESseqnum": IN, + "LESid": IN, + "oceanregioncode": IN, + "prioritycode": IN, + "servicecode": IN, + "presentationcode": IN, + "year": IN, + "month": IN, + "day": IN, + "hour": IN, + "minute": IN, + "circarealat": LA, + "circareaNS": LAD, + "circarealon": LN, + "circareaEW": LND, + "circarearadius": IN, + }, + "SM4": { + "MSIstatus": CH, + "msgnum": IN, + "LESseqnum": IN, + "LESid": IN, + "oceanregioncode": IN, + "prioritycode": IN, + "servicecode": IN, + "presentationcode": IN, + "year": IN, + "month": IN, + "day": IN, + "hour": IN, + "minute": IN, + "redareaswlat": LA, + "recareaswNS": LAD, + "redareaswlon": LN, + "recareaswEW": LND, + "recareaextentN": IN, + "recareaextentE": IN, + }, + "SMB": {"numSen": IN, "senNum": IN, "seqid": IN, "msgnum": IN, "body": ST}, + "SPW": { + "pwdprotectsentence": ST, + "id": ST, + "pwdlevel": IN, + "password": ST, + }, + "SSD": { + "callsign": ST, + "name": ST, + "posAref": IN, # bow + "posBref": IN, # stern + "posCref": IN, # port beam + "posDref": IN, # stbd beam + "DTEind": ST, + "sourceid": ST, + }, "STN": { "talkerId": ST, }, @@ -346,6 +1051,54 @@ "headt": DE, "mi": CH, }, + "TLB": { + "group": ( + "None", # indeterminate repeating group + { + "targetnum": IN, + "label": ST, + }, + ) + }, + "TLL": { + "targetnum": IN, + "targetlat": LA, + "targetlatNS": LAD, + "targetlon": LN, + "targetlonEW": LND, + "targetname": ST, + "time": TM, + "status": CH, + "reftarget": CH, + }, + "TRC": { + "thrusternum": IN, + "dmdrpm": DE, + "rpmmode": CH, + "dmdpitch": DE, + "pitchmode": CH, + "dmdazimuth": DE, + "operatinglocind": CH, + "status": CH, + }, + "TRD": { + "thrusternum": IN, + "rpmresponse": IN, + "rpmmode": CH, + "pitchresponse": IN, + "pitchmode": CH, + "azimuthresponse": IN, + }, + "TRL": { + "totlognum": IN, + "lognum": IN, + "seqid": IN, + "switchoffdate": ST, + "switchofftime": TM, + "switchondate": ST, + "switchontime": TM, + "reasoncode": IN, + }, "TRF": { "time": TM, "date": DT, @@ -359,19 +1112,105 @@ "dist": DE, "svid": IN, }, + "TTD": { + "numSen": IN, + "senNum": IN, + "seqid": IN, + "data": ST, + "fillbits": IN, + }, + "TTM": { + "targetnum": IN, + "targetdist": DE, + "targetbearing": DE, + "targetbearingu": CH, # 'T'rue, 'R'relative + "targetspeed": DE, + "targetcourse": DE, + "targetcourseu": CH, # 'T'rue, 'R'relative + "closestapproach": DE, + "timetoCPA": DE, + "speedu": CH, + "targetname": ST, + "targetstatus": CH, + "reftarget": ST, + "time": TM, + "acquisitiontype": CH, + }, + "TUT": { + "sourceid": ST, + "numSen": HX, + "senNum": HX, + "seqid": IN, + "translationcode": ST, + "text": ST, + }, "TXT": { "numMsg": IN, "msgNum": IN, "msgType": IN, "text": ST, }, + "UID": { + "uid1": ST, + "uid2": ST, # optional + }, "VBW": { - "wlspd": DE, - "wtspd": DE, - "wstatus": CH, - "glspd": DE, - "gtspd": DE, - "gstatus": CH, + "longwaterspd": DE, # -ve = astern + "transwaterspd": DE, + "waterspdstatus": CH, + "longgroundspd": DE, # -ve = astern + "transgroundspd": DE, # -ve = port + "groundspdstatus": CH, + "sterntranswaterspd": DE, # -ve = port + "sternwaterspdstatus": CH, + "sterntransgroundspd": DE, # -ve = port + "sterngroundspdstatus": CH, + }, + "VDM": { + "numSen": IN, + "senNum": IN, + "seqid": IN, + "aischan": ST, + "itumsg": ST, + "fillbits": IN, + }, + "VDO": { + "numSen": IN, + "senNum": IN, + "seqid": IN, + "aischan": ST, + "itumsg": ST, + "fillbits": IN, + }, + "VDR": { + "dirT": DE, + "dirTu": CH, # 'T'rue + "dirM": DE, + "dirMu": CH, # 'M'agnetic + "spd": DE, + "spdu": CH, # N knots + }, + "VER": { + "numSen": IN, + "senNum": IN, + "devicetype": ST, + "vendorid": ST, + "uid": ST, + "mfrserial": ST, + "model": ST, + "software": ST, + "hardware": ST, + "seqid": IN, + }, + "VHW": { + "hdgT": DE, + "hgdTu": CH, # 'T'rue + "hdgM": DE, + "hgdMu": CH, # 'M'agnetic + "spdN": DE, + "spdNu": CH, # N knots + "spdK": DE, + "spdKu": CH, # K km/h }, "VLW": { "twd": DE, @@ -383,6 +1222,23 @@ "gd": DE, # NMEA >=4.00 only "gdUnit": CH, # NMEA >=4.00 only }, + "VPW": { + "spdN": DE, + "spdNu": CH, # N knots + "spdK": DE, + "spdKu": CH, # K km/h + }, + "VSD": { + "type": ST, + "draught": DE, + "pob": IN, + "destination": ST, + "etatime": TM, + "etaday": IN, + "etamonth": IN, + "regappflags1": IN, + "regappflags2": IN, + }, "VTG": { "cogt": DE, # course over ground (true) "cogtUnit": CH, @@ -394,6 +1250,31 @@ "sogkUnit": CH, "posMode": CH, # NMEA >=2.3 only }, + "WAT": { + "msgtype": CH, + "time": TM, + "alarmtype": ST, + "loc1ind": IN, + "loc2ind": IN, + "detectionpoint": IN, + "alarmcondition": CH, + "overridesetting": CH, + "text": ST, + }, + "WCV": { + "vel": DE, + "velu": CH, # N knots + "wpt": ST, + "mode": CH, + }, + "WNC": { + "distN": DE, + "distNu": CH, # 'N' nm + "distK": DE, + "distKu": CH, # 'K' km + "wptto": ST, + "wptfrom": ST, + }, "WPL": { "lat": LA, "NS": LAD, @@ -401,12 +1282,29 @@ "EW": LND, "wpt": ST, }, + "XDR": { + "group": ( + "None", # indeterminate repeating group + { + "tdrtype": CH, + "data": DE, + "dataunit": CH, + "tdrid": ST, + }, + ) + }, "XTE": { "gwarn": CH, "LCcwarn": CH, "ctrkerr": DE, "dirs": CH, - "disUnit": CH, + "disUnit": CH, # N nm + "mode": CH, + }, + "XTR": { + "ctkerr": DE, + "steerdir": CH, + "units": CH, # N nm }, "ZDA": { "time": TM, @@ -416,919 +1314,20 @@ "ltzh": ST, "ltzn": ST, }, - # ********************************************* - # JVC KENWOOD PROPRIETARY MESSAGES - # ********************************************* - "KLDS": { - "time": TM, - "status": CH, - "lat": LA, - "NS": LAD, - "lon": LN, - "EW": LND, - "sog": DE, - "cog": DE, - "dat": DT, - "declination": DE, - "dec_dir": CH, - "fleet": DE, - "senderid": ST, - "senderstatus": DE, - "reserved": DE, - }, - "KLSH": { - "lat": LA, - "NS": LAD, - "lon": LN, - "EW": LND, - "time": TM, - "status": CH, - "fleetId": ST, - "deviceId": ST, - }, - "KNDS": { - "time": TM, - "status": CH, - "lat": LA, - "NS": LAD, - "lon": LN, - "EW": LND, - "sog": DE, - "cog": DE, - "date": DT, - "declination": DE, - "dec_dir": CH, - "senderid": ST, - "senderstatus": DE, - "reserved": DE, - }, - "KNSH": { - "lat": LA, - "NS": LAD, - "lon": LN, - "EW": LND, - "time": TM, - "status": CH, - "senderid": ST, - }, - "KWDWPL": { + "ZDL": { "time": TM, - "status": CH, - "lat": LA, - "NS": LAD, - "lon": LN, - "EW": LND, - "sog": DE, - "cog": DE, - "date": DT, - "alt": DE, - "wpt": ST, - "ts": ST, - }, - # ********************************************* - # MAGELLAN PROPRIETARY MESSAGES - # ********************************************* - "MGNWPL": { - "lat": LA, - "NS": LAD, - "lon": LN, - "EW": LND, - "alt": DE, - "alt_unit": CH, - "wpt": ST, - "comment": ST, - "icon": ST, - "type": ST, - }, - # ********************************************* - # GARMIN PROPRIETARY MESSAGES - # ********************************************* - "GRME": { # estimated error information - "HPE": DE, - "HPEUnit": CH, - "VPE": DE, - "VPEUnit": CH, - "EPE": DE, - "EPEUnit": CH, - }, - "GRMF": { # GPS fix data sentence - "week": IN, - "secs": IN, - "date": DT, - "time": TM, - "leapsec": IN, - "lat": LA, - "NS": LAD, - "lon": LN, - "EW": LND, - "mode": CH, - "fix": IN, - "spd": DE, - "course": IN, - "PDOP": DE, - "TDOP": DE, - }, - "GRMH": { # aviation height and VNAV data - "status": CH, - "vspd": DE, - "verr": DE, - "spdtgt": DE, - "spdwpt": DE, - "height": DE, - "trk": DE, - "course": DE, - }, - "GRMM": { # map datum - "dtm": ST, - }, - "GRMT": { # sensor status information - "ver": ST, - "ROMtest": CH, - "rcvrtest": CH, - "stortest": CH, - "rtctest": CH, - "osctest": CH, - "datatest": CH, - "temp": DE, - "cfgdata": CH, - }, - "GRMV": { # 3D velocity information - "velE": DE, - "velN": DE, - "velZ": DE, - }, - "GRMZ": { # altitude - "alt": DE, - "altUnit": CH, - "fix": IN, - }, - "GRMB": { # DGPS Beacon information - "freq": DE, - "bps": IN, - "snr": IN, - "quality": IN, "dist": DE, - "status": IN, - "fixsrc": CH, - "mode": CH, - }, - # ********************************************* - # U-BLOX PROPRIETARY MESSAGES - # ********************************************* - "UBX00": { - "msgId": ST, # '00' - "time": TM, - "lat": LA, - "NS": LAD, - "lon": LN, - "EW": LND, - "altRef": DE, - "navStat": ST, - "hAcc": DE, - "vAcc": DE, - "SOG": DE, - "COG": DE, - "vVel": DE, - "diffAge": DE, - "HDOP": DE, - "VDOP": DE, - "TDOP": DE, - "numSVs": IN, - "reserved": IN, - "DR": IN, - }, - "UBX03": { - "msgId": ST, # '03' - "numSv": IN, - "groupSV": ( - "numSv", - { # repeating group * numSv - "svid": IN, - "status": CH, - "azi": DE, - "ele": DE, - "cno": IN, - "lck": IN, - }, - ), - }, - "UBX04": { - "msgId": ST, # '04' - "time": TM, - "date": DT, - "utcTow": ST, - "utcWk": ST, - "leapSec": ST, - "clkBias": DE, - "clkDrift": DE, - "tpGran": IN, - }, - "UBX05": { # deprecated, for backwards compat only - "msgId": ST, # '05' - "pulses": IN, - "period": IN, - "gyroMean": IN, - "temperature": DE, - "direction": CH, - "pulseScaleCS": IN, - "gyroScaleCS": IN, - "gyroBiasCS": IN, - "pulseScale": DE, - "gyroBias": DE, - "gyroScale": DE, - "pulseScaleAcc": IN, - "gyroBiasAcc": IN, - "gyroScaleAcc": IN, - "measUsed": HX, - }, - # *************************************************************** - # Trimble Proprietary message types - # https://receiverhelp.trimble.com/alloy-gnss/en-us/NMEA-0183messages_MessageOverview.html - # *************************************************************** - "ASHR": { - "utctime": TM, - "trueHdg": DE, - "trueHdgInd": CH, # "T" - "roll": DE, - "pitch": DE, - "reserved": ST, - "rollAcc": DE, - "pitchAcc": DE, - "hdgAcc": DE, - "gnssQual": IN, - "imuAlign": IN, - }, - "ASHRALR": { - "msgId": ST, # "ALR" - "alarmCode": IN, - "alarmSubcode": IN, - "streamId": CH, - "alarmCat": ST, - "alarmLevel": IN, - "desc": ST, - }, - "ASHRARA": { - "msgId": ST, # "ARA" - "valid": CH, # = "0" when valid - "utctime": TM, - "hdgSpeed": DE, - "pitchSpeed": DE, - "rollSpeed": DE, - "hdgAcc": DE, - "pitchAcc": DE, - "rollAcc": DE, - "reserved": ST, - }, - "ASHRARR": { - "msgId": ST, # "ARR" - "vectNum": IN, - "vectMode": IN, - "sip": IN, - "utctime": TM, - "antEcefX": DE, - "antEcefY": DE, - "antEcefZ": DE, - "coord1std": DE, - "coord2std": DE, - "coord3std": DE, - "coord12corr": DE, - "coord13corr": DE, - "coord23corr": DE, - "refId": CH, - "vectFrame": IN, # 0 = XYZ - "vectOpt": IN, - "clkAssum": IN, - }, - "ASHRATT": { - "msgId": ST, # "ATT" - "weekTime": DE, - "trueHdg": DE, - "pitch": DE, - "roll": DE, - "carrierRmsErr": DE, - "baselineRmsErr": DE, - "ambiguity": IN, - }, - "ASHRBTS": { - "msgId": ST, # "BTS" - "portgroup": ( - 3, - { - "port": CH, # C, H or T - "connected": IN, - "name": ST, - "addr": ST, - "linkQual": IN, - }, - ), - }, - "ASHRCAP": { - "msgId": ST, # "CAP" - "name": ST, - "L1Noffset": DE, - "L1Eoffset": DE, - "L1Voffset": DE, - "L2Noffset": DE, - "L2Eoffset": DE, - "L2Voffset": DE, - }, - "ASHRCPA": { - "msgId": ST, # "CPA" - "antHeight": DE, - "antRadius": DE, - "vertOffset": DE, - "horAzi": DE, - "horDist": DE, - "reserved1": ST, - "reserved2": ST, - "reserved3": ST, - "reserved4": ST, - }, - "ASHRCPO": { - "msgId": ST, # "CPO" - "lat": LA, - "NS": LAD, - "lon": LN, - "EW": LND, - "height": DE, - }, - "ASHRDDM": { - "msgId": ST, # "DDM" - "corrPort": CH, - "msgTransport": ST, - "msgIdent": ST, - "count": IN, - "baseId": ST, - "timeLag": DE, - "corrAge": DE, - "attr": ST, - }, - "ASHRDDS": { - "msgId": ST, # "DDS" - "diffDecodeNum": IN, - "timeTag": TM, - "numMsgDecoded": IN, - "port": CH, - "prot": ST, - "timeWindow": IN, - "percLinkQual": IN, - "percDeselectInfo": IN, - "percCrc": IN, - "latencyStd": IN, - "latencyMean": IN, - "epochIntMean": IN, - "epochIntMin": IN, - "numMsgDetected": IN, - "msgType": ST, - "lastMsgInt": DE, - "lastMsgAge": DE, - }, - "ASHRHPR": { - "msgId": ST, # "HPR" - "utctime": TM, - "trueHdg": DE, - "pitch": DE, - "roll": DE, - "carrierRmsErr": DE, - "baselineRmsErr": DE, - "ambiguity": IN, - "attStatus": IN, - "antBaseline": ST, - "PDOP": DE, - }, - "ASHRLTN": { - "msgId": ST, # "LTN" - "latency": DE, - }, - "ASHRMDM": { - "msgId": ST, # "MDM" - "port": ST, - "baud": IN, - "state": ST, - "powerMode": ST, - "pinCode": ST, - "protocol": IN, - "csdMode": IN, # not used - "accessPoint": ST, - "login": ST, - "password": ST, - "phoneNum": ST, - "autoDial": CH, - "maxRedial": IN, - "model": ST, - "selMode": IN, - "gsmAnt": ST, - }, - "ASHRPBN": { - "msgId": ST, # "PBN", - "gpsWeek": DE, - "siteName": ST, - "navX": DE, - "navY": DE, - "navT": DE, - "navXdot": DE, - "navYdot": DE, - "navTdot": DE, - "PDOP": DE, + "type": CH, }, - "ASHRPOS": { - "msgId": ST, # "POS" - "solnType": IN, - "sip": IN, - "utctime": TM, - "lat": LA, - "NS": LAD, - "lon": LN, - "EW": LND, - "alt": DE, - "corrAge": DE, - "trueTrk": DE, - "sog": DE, - "vertVel": DE, - "PDOP": DE, - "HDOP": DE, - "VDOP": DE, - "TDOP": DE, - "baseId": ST, - }, - "ASHRPTT": { - "msgId": ST, # "PTT" - "dow": IN, - "timeTag": ST, - }, - "ASHRPWR": { - "msgId": ST, # "PWR" - "powerSource": IN, - "voltsOut": DE, - "reserved1": ST, - "percRemaining": IN, - "reserved2": ST, - "voltsIn": DE, - "chargeStatus": IN, - "reserved3": ST, - "tempInt": DE, - "tempBatt": DE, - }, - "ASHRRCS": { - "msgId": ST, # "RCS" - "recordStatus": CH, - "memory": IN, - "fileName": ST, - "recordRate": IN, - "occupationType": IN, - "occupationState": IN, - "occupationName": ST, - }, - "ASHRSBD": { - "msgId": ST, # "SBD" - "siv": IN, - "satgroup": ( # repeating group * siv - "siv", - { - "prn": IN, - "azi": DE, - "ele": DE, - "snrB1": DE, - "snrB2": DE, - "snrB3": DE, - "usageStatus": ST, - "corrStatus": ST, - }, - ), - }, - "ASHRSGA": { - "msgId": ST, # "SGA" - "siv": IN, - "satgroup": ( # repeating group * siv - "siv", - { - "prn": IN, - "azi": DE, - "ele": DE, - "snrE1": DE, - "snrE5b": DE, - "snrE5a": DE, - "usageStatus": ST, - "corrStatus": ST, - }, - ), - }, - "ASHRSGL": { - "msgId": ST, # "SGL" - "siv": IN, - "satgroup": ( # repeating group * siv - "siv", - { - "prn": IN, - "azi": DE, - "ele": DE, - "snrL1": DE, - "snrL2": DE, - "snrL3": DE, - "usageStatus": ST, - "corrStatus": ST, - }, - ), + "ZFO": { + "observationtime": TM, + "elapsedtime": TM, + "originwpt": ST, }, - "ASHRSGO": { - "msgId": ST, # "SGO" - "siv": IN, - "satgroup": ( # repeating group * siv - "siv", - { - "prn": IN, - "azi": DE, - "ele": DE, - "snrE1": DE, - "snrE5b": DE, - "snrE5a": DE, - "snrE6": DE, - "reserved": ST, - "usageStatus": ST, - "corrStatus": ST, - }, - ), - }, - "ASHRSGP": { - "msgId": ST, # "SGP" - "siv": IN, - "satgroup": ( # repeating group * siv - "siv", - { - "prn": IN, - "azi": DE, - "ele": DE, - "snrL1": DE, - "snrL2": DE, - "snrL3": DE, - "usageStatus": ST, - "corrStatus": ST, - }, - ), - }, - "ASHRSIR": { - "msgId": ST, # "SIR" - "siv": IN, - "satgroup": ( # repeating group * siv - "siv", - { - "prn": IN, - "azi": DE, - "ele": DE, - "reserved2": ST, - "reserved3": ST, - "snrL5": DE, - "usageStatus": ST, - "corrStatus": ST, - }, - ), - }, - "ASHRSLB": { - "msgId": ST, # "SLB" - "siv": IN, - "satgroup": ( # repeating group * siv - "siv", - { - "satNum": IN, - "contTrkInt": DE, - "azi": DE, - "ele": DE, - "snr": DE, - }, - ), - }, - "ASHRSQZ": { - "msgId": ST, # "SQZ" - "siv": IN, - "satgroup": ( # repeating group * siv - "siv", - { - "prn": IN, - "azi": DE, - "ele": DE, - "snrL1": DE, - "snrL2": DE, - "snrL3": DE, - "usageStatus": ST, - "corrStatus": ST, - }, - ), - }, - "ASHRSSB": { - "msgId": ST, # "SSB" - "siv": IN, - "satgroup": ( # repeating group * siv - "siv", - { - "prn": IN, - "azi": DE, - "ele": DE, - "snrL1": DE, - "reserved": ST, - "snrL5": DE, - "usageStatus": ST, - "corrStatus": ST, - }, - ), - }, - "ASHRTEM": { - "msgId": ST, # "TEM" - "temp": DE, # 1/1000 degrees - }, - "ASHRTHS": { - "msgId": ST, # "THS" - "lastComputedHdg": DE, - "solnStatus": CH, - }, - "ASHRTTT": { - "msgId": ST, # "TTT" - "dow": IN, - "timeTag": TM, - }, - "ASHRVCR": { - "msgId": ST, # "VCR" - "baselineNum": IN, - "baselineMode": IN, - "sip": IN, - "utctime": TM, - "antEcefX": DE, - "antEcefY": DE, - "antEcefZ": DE, - "coord1std": DE, - "coord2std": DE, - "coord3std": DE, - "coord12corr": DE, - "coord13corr": DE, - "coord23corr": DE, - "baseId": ST, - "baselineCoordId": ST, # 0 = XYZ - }, - "ASHRVCT": { - "msgId": ST, # "VCT" - "baselineMode": IN, - "sip": IN, - "utctime": TM, - "antEcefX": DE, - "antEcefY": DE, - "antEcefZ": DE, - "coord1std": DE, - "coord2std": DE, - "coord3std": DE, - "coord12corr": DE, - "coord13corr": DE, - "coord23corr": DE, - "baseId": ST, - "baselineCoordId": ST, # 0 = XYZ - "baselineNum": IN, - "vrs": IN, - "staticModeAssumption": IN, - }, - "ASHRVEL": { - "msgId": ST, # "VEL" - "velE": DE, - "velN": DE, - "velV": DE, - "velERmsErr": DE, - "velNRmsErr": DE, - "velVRmsErr": DE, - "velSmoothInt": IN, - }, - "FUGDP": { - "type": ST, # GPS (GP), GLONASS (GL) or GNSS (GN) - "utctime": TM, - "lat": LA, - "NS": LAD, - "lon": LN, - "EW": LND, - "siv": IN, - "dpvoaQual": ST, - "dgnssMode": ST, - "smajErr": DE, - "sminErr": DE, - "dirErr": IN, - }, - "GPPADV110": { - "msgId": ST, # "110" - "lat": DE, - "lon": DE, - "height": DE, - "ele": DE, # optional - "azi": DE, # optional - }, - "GPPADV120": { - "msgId": ST, # "120" - "satgrp": ( # repeating group * 2 - 2, - { - "prn": IN, - "ele": DE, - "azi": DE, - }, - ), - }, - "TNLAVR": { - "msgId": ST, # "AVR" - "utctime": TM, - "yaw": DE, - "yawc": ST, # "Yaw" - "tilt": DE, - "tiltc": ST, # "Tilt" - "roll": DE, - "rollc": ST, # "Roll" - "range": DE, - "gpsQual": IN, - "PDOP": DE, - "sip": IN, - }, - "TNLBPQ": { - "msgId": ST, # "BPQ" - "utctime": TM, - "utcdate": DT, - "lat": LA, - "NS": LAD, - "lon": LN, - "EW": LND, - "height": ST, # starts with "EHT-" - "hunit": CH, # 'M' - "gpsQual": IN, - }, - "TNLDG": { - "msgId": ST, # "DG" TODO check - "strength": DE, - "snr": DE, - "freq": DE, - "bitRate": IN, - "chan": IN, - "trkStatus": CH, - "trkPerf": IN, - }, - "TNLEVT": { - "msgId": ST, # "EVT" - "utctime": TM, - "port": IN, - "numEvents": IN, - "wno": IN, - "dow": IN, - "leaps": IN, - }, - "TNLGGK": { - "msgId": ST, # "GGK" - "utctime": TM, - "utcdate": DT, - "lat": LA, - "NS": LAD, - "lon": LN, - "EW": LND, - "gpsQual": IN, - "sip": IN, - "DOP": DE, - "height": ST, # starts with "EHT-" - "hunit": CH, # 'M' - }, - "TNLGGKx": { - "msgId": ST, # "GGK" - "utctime": TM, - "utcdate": DT, - "lat": LA, - "NS": LAD, - "lon": LN, - "EW": LND, - "posType": IN, - "sip": IN, - "PDOP": DE, - "height": DE, - "numExt": IN, - "sigmaE": DE, - "sigmaN": DE, - "sigmaV": DE, - "propogationAge": DE, - }, - "TNLPJK": { - "msgId": ST, # "PJK" - "utctime": TM, - "utcdate": DT, - "northing": DE, - "nunit": CH, # 'N' - "easting": DE, - "eunit": CH, # 'E" - "gpsQual": IN, - "sip": IN, - "DOP": DE, - "height": ST, # starts with "EHT-" or "GHT-" - "hunit": CH, # 'M' - }, - "TNLPJT": { - "msgId": ST, # "PJT" - "coordName": ST, - "projName": ST, - }, - "TNLREX": { - "msgId": ST, # "REX" - "utctime": TM, - "constUsed": ST, - "sip": IN, - "lat": LA, - "NS": LAD, - "lon": LN, - "EW": LND, - "alt": DE, - "latSigmaErr": DE, - "lonSigmaErr": DE, - "heightSigmaErr": DE, - "vectE": DE, - "vectN": DE, - "vectV": DE, - "vectESigmaErr": DE, - "vectNSigmaErr": DE, - "vectVSigmaErr": DE, - "corrSource": ST, - }, - "TNLVGK": { - "msgId": ST, # "VGK" - "utctime": TM, - "utcdate": DM, # mmddyy - "vectE": DE, - "vectN": DE, - "vectV": DE, - "gpsQual": IN, - "sip": IN, - "DOP": DE, - "vunit": CH, # 'M' - }, - "TNLVHD": { - "msgId": ST, # "VHD" - "utctime": TM, - "utcdate": DM, # mmddyy - "azi": DE, - "aziRate": DE, - "ele": DE, - "eleRate": DE, - "range": DE, - "rangeRate": DE, - "gpsQual": IN, - "sip": IN, - "PDOP": DE, - "unit": CH, # 'M' - }, - # ********************************************* - # Furuno - # https://www.furuno.com/en/support/sdk/ - # ********************************************* - "FECGPATT": { - "msgId": ST, # 'GPatt' - "yaw": DE, - "pitch": DE, - "roll": DE, - }, - "FECGPHVE": { - "msgId": ST, # 'GPhve' - "heave": DE, - "status": CH, # 'A' - }, - # *************************************************************** - # Locosys Proprietary Messages GET - # https://www.locosystech.com/Templates/att/LS2303x-UDG_datasheet_v0.6.pdf?lng=en - # *************************************************************** - "LSR": { - "msgType": ST, # e.g. "SLOPE", "MEMS", "ATTIT" - "value": IN, # e.g. 0 - "response": ST, # e.g. "OK" - }, - "LSVD": { - "velE": DE, # cm/s - "velN": DE, # cm/s - "velD": DE, # cm/s - "velEdev": DE, # cm/s deviation - "velNdev": DE, # cm/s deviation - "velDdev": DE, # cm/s deviation - }, - "INVMINR": { - "status": CH, # 0 uninitialized; 1、2 calibrating/initializing; 3 calibration done - }, - "INVMSTR": { - "value": IN, - }, - "INVMSLOPE": { - "slope": DE, # degrees - "altDiff": DE, # meters - "moveDist": DE, # meters - "slopeAccu": DE, # degrees - "altDiffAccu": DE, # meters - "moveDistAccu": DE, # meters - }, - "INVMIMU": { - "timeSecond": DE, # sec timestamp - "accelX": DE, # m/s^2 - "accelY": DE, # m/s^2 - "accelZ": DE, # m/s^2 - "gyroX": DE, # degree/s - "gyroY": DE, # degree/s - "gyroZ": DE, # degree/s - }, - "INVMATTIT": { - "roll": DE, # degree - "pitch": DE, # degree - "yaw": DE, # degree heading + "ZTG": { + "observationtime": TM, + "timetogo": TM, + "destwpt": ST, }, # ********************************************* # Dummy message for error testing diff --git a/src/pynmeagps/nmeatypes_get_prop.py b/src/pynmeagps/nmeatypes_get_prop.py new file mode 100644 index 0000000..2cf8b28 --- /dev/null +++ b/src/pynmeagps/nmeatypes_get_prop.py @@ -0,0 +1,947 @@ +""" +NMEA Protocol Proprietary Output payload definitions + +THESE ARE THE PAYLOAD DEFINITIONS FOR PROPRIETARY _GET_ MESSAGES _FROM_ +THE RECEIVER (e.g. Periodic Navigation Data; Poll Responses; Info messages). + +NB: Attribute names must be unique within each message id. +NB: Avoid reserved names 'msgID', 'talker', 'payload', 'checksum'. + +NB: Repeating groups must be defined as a tuple thus + 'group': ('numr', {dict}) + where + - 'numr' is either: + a) an integer representing a fixed number of repeats e.g 32 + b) a string representing the name of a preceding attribute + containing the number of repeats e.g. 'numCh' + c) 'None' for an indeterminate repeating group + (only one such group is permitted per message type) + - {dict} is the nested dictionary containing the repeating + attributes + +Created on 4 Mar Sep 2021 + +While the NMEA 0183 © protocol is proprietary, the information here +has been collated from public domain sources. + +:author: semuadmin +""" + +from pynmeagps.nmeatypes_core import CH, DE, DM, DT, HX, IN, LA, LAD, LN, LND, ST, TM + +NMEA_PAYLOADS_GET_PROP = { + # ********************************************* + # JVC KENWOOD PROPRIETARY MESSAGES + # ********************************************* + "KLDS": { + "time": TM, + "status": CH, + "lat": LA, + "NS": LAD, + "lon": LN, + "EW": LND, + "sog": DE, + "cog": DE, + "dat": DT, + "declination": DE, + "dec_dir": CH, + "fleet": DE, + "senderid": ST, + "senderstatus": DE, + "reserved": DE, + }, + "KLSH": { + "lat": LA, + "NS": LAD, + "lon": LN, + "EW": LND, + "time": TM, + "status": CH, + "fleetId": ST, + "deviceId": ST, + }, + "KNDS": { + "time": TM, + "status": CH, + "lat": LA, + "NS": LAD, + "lon": LN, + "EW": LND, + "sog": DE, + "cog": DE, + "date": DT, + "declination": DE, + "dec_dir": CH, + "senderid": ST, + "senderstatus": DE, + "reserved": DE, + }, + "KNSH": { + "lat": LA, + "NS": LAD, + "lon": LN, + "EW": LND, + "time": TM, + "status": CH, + "senderid": ST, + }, + "KWDWPL": { + "time": TM, + "status": CH, + "lat": LA, + "NS": LAD, + "lon": LN, + "EW": LND, + "sog": DE, + "cog": DE, + "date": DT, + "alt": DE, + "wpt": ST, + "ts": ST, + }, + # ********************************************* + # MAGELLAN PROPRIETARY MESSAGES + # ********************************************* + "MGNWPL": { + "lat": LA, + "NS": LAD, + "lon": LN, + "EW": LND, + "alt": DE, + "alt_unit": CH, + "wpt": ST, + "comment": ST, + "icon": ST, + "type": ST, + }, + # ********************************************* + # GARMIN PROPRIETARY MESSAGES + # ********************************************* + "GRME": { # estimated error information + "HPE": DE, + "HPEUnit": CH, + "VPE": DE, + "VPEUnit": CH, + "EPE": DE, + "EPEUnit": CH, + }, + "GRMF": { # GPS fix data sentence + "week": IN, + "secs": IN, + "date": DT, + "time": TM, + "leapsec": IN, + "lat": LA, + "NS": LAD, + "lon": LN, + "EW": LND, + "mode": CH, + "fix": IN, + "spd": DE, + "course": IN, + "PDOP": DE, + "TDOP": DE, + }, + "GRMH": { # aviation height and VNAV data + "status": CH, + "vspd": DE, + "verr": DE, + "spdtgt": DE, + "spdwpt": DE, + "height": DE, + "trk": DE, + "course": DE, + }, + "GRMM": { # map datum + "dtm": ST, + }, + "GRMT": { # sensor status information + "ver": ST, + "ROMtest": CH, + "rcvrtest": CH, + "stortest": CH, + "rtctest": CH, + "osctest": CH, + "datatest": CH, + "temp": DE, + "cfgdata": CH, + }, + "GRMV": { # 3D velocity information + "velE": DE, + "velN": DE, + "velZ": DE, + }, + "GRMZ": { # altitude + "alt": DE, + "altUnit": CH, + "fix": IN, + }, + "GRMB": { # DGPS Beacon information + "freq": DE, + "bps": IN, + "snr": IN, + "quality": IN, + "dist": DE, + "status": IN, + "fixsrc": CH, + "mode": CH, + }, + # ********************************************* + # U-BLOX PROPRIETARY MESSAGES + # ********************************************* + "UBX00": { + "msgId": ST, # '00' + "time": TM, + "lat": LA, + "NS": LAD, + "lon": LN, + "EW": LND, + "altRef": DE, + "navStat": ST, + "hAcc": DE, + "vAcc": DE, + "SOG": DE, + "COG": DE, + "vVel": DE, + "diffAge": DE, + "HDOP": DE, + "VDOP": DE, + "TDOP": DE, + "numSVs": IN, + "reserved": IN, + "DR": IN, + }, + "UBX03": { + "msgId": ST, # '03' + "numSv": IN, + "groupSV": ( + "numSv", + { # repeating group * numSv + "svid": IN, + "status": CH, + "azi": DE, + "ele": DE, + "cno": IN, + "lck": IN, + }, + ), + }, + "UBX04": { + "msgId": ST, # '04' + "time": TM, + "date": DT, + "utcTow": ST, + "utcWk": ST, + "leapSec": ST, + "clkBias": DE, + "clkDrift": DE, + "tpGran": IN, + }, + "UBX05": { # deprecated, for backwards compat only + "msgId": ST, # '05' + "pulses": IN, + "period": IN, + "gyroMean": IN, + "temperature": DE, + "direction": CH, + "pulseScaleCS": IN, + "gyroScaleCS": IN, + "gyroBiasCS": IN, + "pulseScale": DE, + "gyroBias": DE, + "gyroScale": DE, + "pulseScaleAcc": IN, + "gyroBiasAcc": IN, + "gyroScaleAcc": IN, + "measUsed": HX, + }, + # *************************************************************** + # Trimble Proprietary message types + # https://receiverhelp.trimble.com/alloy-gnss/en-us/NMEA-0183messages_MessageOverview.html + # *************************************************************** + "ASHR": { + "utctime": TM, + "trueHdg": DE, + "trueHdgInd": CH, # "T" + "roll": DE, + "pitch": DE, + "reserved": ST, + "rollAcc": DE, + "pitchAcc": DE, + "hdgAcc": DE, + "gnssQual": IN, + "imuAlign": IN, + }, + "ASHRALR": { + "msgId": ST, # "ALR" + "alarmCode": IN, + "alarmSubcode": IN, + "streamId": CH, + "alarmCat": ST, + "alarmLevel": IN, + "desc": ST, + }, + "ASHRARA": { + "msgId": ST, # "ARA" + "valid": CH, # = "0" when valid + "utctime": TM, + "hdgSpeed": DE, + "pitchSpeed": DE, + "rollSpeed": DE, + "hdgAcc": DE, + "pitchAcc": DE, + "rollAcc": DE, + "reserved": ST, + }, + "ASHRARR": { + "msgId": ST, # "ARR" + "vectNum": IN, + "vectMode": IN, + "sip": IN, + "utctime": TM, + "antEcefX": DE, + "antEcefY": DE, + "antEcefZ": DE, + "coord1std": DE, + "coord2std": DE, + "coord3std": DE, + "coord12corr": DE, + "coord13corr": DE, + "coord23corr": DE, + "refId": CH, + "vectFrame": IN, # 0 = XYZ + "vectOpt": IN, + "clkAssum": IN, + }, + "ASHRATT": { + "msgId": ST, # "ATT" + "weekTime": DE, + "trueHdg": DE, + "pitch": DE, + "roll": DE, + "carrierRmsErr": DE, + "baselineRmsErr": DE, + "ambiguity": IN, + }, + "ASHRBTS": { + "msgId": ST, # "BTS" + "portgroup": ( + 3, + { + "port": CH, # C, H or T + "connected": IN, + "name": ST, + "addr": ST, + "linkQual": IN, + }, + ), + }, + "ASHRCAP": { + "msgId": ST, # "CAP" + "name": ST, + "L1Noffset": DE, + "L1Eoffset": DE, + "L1Voffset": DE, + "L2Noffset": DE, + "L2Eoffset": DE, + "L2Voffset": DE, + }, + "ASHRCPA": { + "msgId": ST, # "CPA" + "antHeight": DE, + "antRadius": DE, + "vertOffset": DE, + "horAzi": DE, + "horDist": DE, + "reserved1": ST, + "reserved2": ST, + "reserved3": ST, + "reserved4": ST, + }, + "ASHRCPO": { + "msgId": ST, # "CPO" + "lat": LA, + "NS": LAD, + "lon": LN, + "EW": LND, + "height": DE, + }, + "ASHRDDM": { + "msgId": ST, # "DDM" + "corrPort": CH, + "msgTransport": ST, + "msgIdent": ST, + "count": IN, + "baseId": ST, + "timeLag": DE, + "corrAge": DE, + "attr": ST, + }, + "ASHRDDS": { + "msgId": ST, # "DDS" + "diffDecodeNum": IN, + "timeTag": TM, + "numMsgDecoded": IN, + "port": CH, + "prot": ST, + "timeWindow": IN, + "percLinkQual": IN, + "percDeselectInfo": IN, + "percCrc": IN, + "latencyStd": IN, + "latencyMean": IN, + "epochIntMean": IN, + "epochIntMin": IN, + "numMsgDetected": IN, + "msgType": ST, + "lastMsgInt": DE, + "lastMsgAge": DE, + }, + "ASHRHPR": { + "msgId": ST, # "HPR" + "utctime": TM, + "trueHdg": DE, + "pitch": DE, + "roll": DE, + "carrierRmsErr": DE, + "baselineRmsErr": DE, + "ambiguity": IN, + "attStatus": IN, + "antBaseline": ST, + "PDOP": DE, + }, + "ASHRLTN": { + "msgId": ST, # "LTN" + "latency": DE, + }, + "ASHRMDM": { + "msgId": ST, # "MDM" + "port": ST, + "baud": IN, + "state": ST, + "powerMode": ST, + "pinCode": ST, + "protocol": IN, + "csdMode": IN, # not used + "accessPoint": ST, + "login": ST, + "password": ST, + "phoneNum": ST, + "autoDial": CH, + "maxRedial": IN, + "model": ST, + "selMode": IN, + "gsmAnt": ST, + }, + "ASHRPBN": { + "msgId": ST, # "PBN", + "gpsWeek": DE, + "siteName": ST, + "navX": DE, + "navY": DE, + "navT": DE, + "navXdot": DE, + "navYdot": DE, + "navTdot": DE, + "PDOP": DE, + }, + "ASHRPOS": { + "msgId": ST, # "POS" + "solnType": IN, + "sip": IN, + "utctime": TM, + "lat": LA, + "NS": LAD, + "lon": LN, + "EW": LND, + "alt": DE, + "corrAge": DE, + "trueTrk": DE, + "sog": DE, + "vertVel": DE, + "PDOP": DE, + "HDOP": DE, + "VDOP": DE, + "TDOP": DE, + "baseId": ST, + }, + "ASHRPTT": { + "msgId": ST, # "PTT" + "dow": IN, + "timeTag": ST, + }, + "ASHRPWR": { + "msgId": ST, # "PWR" + "powerSource": IN, + "voltsOut": DE, + "reserved1": ST, + "percRemaining": IN, + "reserved2": ST, + "voltsIn": DE, + "chargeStatus": IN, + "reserved3": ST, + "tempInt": DE, + "tempBatt": DE, + }, + "ASHRRCS": { + "msgId": ST, # "RCS" + "recordStatus": CH, + "memory": IN, + "fileName": ST, + "recordRate": IN, + "occupationType": IN, + "occupationState": IN, + "occupationName": ST, + }, + "ASHRSBD": { + "msgId": ST, # "SBD" + "siv": IN, + "satgroup": ( # repeating group * siv + "siv", + { + "prn": IN, + "azi": DE, + "ele": DE, + "snrB1": DE, + "snrB2": DE, + "snrB3": DE, + "usageStatus": ST, + "corrStatus": ST, + }, + ), + }, + "ASHRSGA": { + "msgId": ST, # "SGA" + "siv": IN, + "satgroup": ( # repeating group * siv + "siv", + { + "prn": IN, + "azi": DE, + "ele": DE, + "snrE1": DE, + "snrE5b": DE, + "snrE5a": DE, + "usageStatus": ST, + "corrStatus": ST, + }, + ), + }, + "ASHRSGL": { + "msgId": ST, # "SGL" + "siv": IN, + "satgroup": ( # repeating group * siv + "siv", + { + "prn": IN, + "azi": DE, + "ele": DE, + "snrL1": DE, + "snrL2": DE, + "snrL3": DE, + "usageStatus": ST, + "corrStatus": ST, + }, + ), + }, + "ASHRSGO": { + "msgId": ST, # "SGO" + "siv": IN, + "satgroup": ( # repeating group * siv + "siv", + { + "prn": IN, + "azi": DE, + "ele": DE, + "snrE1": DE, + "snrE5b": DE, + "snrE5a": DE, + "snrE6": DE, + "reserved": ST, + "usageStatus": ST, + "corrStatus": ST, + }, + ), + }, + "ASHRSGP": { + "msgId": ST, # "SGP" + "siv": IN, + "satgroup": ( # repeating group * siv + "siv", + { + "prn": IN, + "azi": DE, + "ele": DE, + "snrL1": DE, + "snrL2": DE, + "snrL3": DE, + "usageStatus": ST, + "corrStatus": ST, + }, + ), + }, + "ASHRSIR": { + "msgId": ST, # "SIR" + "siv": IN, + "satgroup": ( # repeating group * siv + "siv", + { + "prn": IN, + "azi": DE, + "ele": DE, + "reserved2": ST, + "reserved3": ST, + "snrL5": DE, + "usageStatus": ST, + "corrStatus": ST, + }, + ), + }, + "ASHRSLB": { + "msgId": ST, # "SLB" + "siv": IN, + "satgroup": ( # repeating group * siv + "siv", + { + "satNum": IN, + "contTrkInt": DE, + "azi": DE, + "ele": DE, + "snr": DE, + }, + ), + }, + "ASHRSQZ": { + "msgId": ST, # "SQZ" + "siv": IN, + "satgroup": ( # repeating group * siv + "siv", + { + "prn": IN, + "azi": DE, + "ele": DE, + "snrL1": DE, + "snrL2": DE, + "snrL3": DE, + "usageStatus": ST, + "corrStatus": ST, + }, + ), + }, + "ASHRSSB": { + "msgId": ST, # "SSB" + "siv": IN, + "satgroup": ( # repeating group * siv + "siv", + { + "prn": IN, + "azi": DE, + "ele": DE, + "snrL1": DE, + "reserved": ST, + "snrL5": DE, + "usageStatus": ST, + "corrStatus": ST, + }, + ), + }, + "ASHRTEM": { + "msgId": ST, # "TEM" + "temp": DE, # 1/1000 degrees + }, + "ASHRTHS": { + "msgId": ST, # "THS" + "lastComputedHdg": DE, + "solnStatus": CH, + }, + "ASHRTTT": { + "msgId": ST, # "TTT" + "dow": IN, + "timeTag": TM, + }, + "ASHRVCR": { + "msgId": ST, # "VCR" + "baselineNum": IN, + "baselineMode": IN, + "sip": IN, + "utctime": TM, + "antEcefX": DE, + "antEcefY": DE, + "antEcefZ": DE, + "coord1std": DE, + "coord2std": DE, + "coord3std": DE, + "coord12corr": DE, + "coord13corr": DE, + "coord23corr": DE, + "baseId": ST, + "baselineCoordId": ST, # 0 = XYZ + }, + "ASHRVCT": { + "msgId": ST, # "VCT" + "baselineMode": IN, + "sip": IN, + "utctime": TM, + "antEcefX": DE, + "antEcefY": DE, + "antEcefZ": DE, + "coord1std": DE, + "coord2std": DE, + "coord3std": DE, + "coord12corr": DE, + "coord13corr": DE, + "coord23corr": DE, + "baseId": ST, + "baselineCoordId": ST, # 0 = XYZ + "baselineNum": IN, + "vrs": IN, + "staticModeAssumption": IN, + }, + "ASHRVEL": { + "msgId": ST, # "VEL" + "velE": DE, + "velN": DE, + "velV": DE, + "velERmsErr": DE, + "velNRmsErr": DE, + "velVRmsErr": DE, + "velSmoothInt": IN, + }, + "FUGDP": { + "type": ST, # GPS (GP), GLONASS (GL) or GNSS (GN) + "utctime": TM, + "lat": LA, + "NS": LAD, + "lon": LN, + "EW": LND, + "siv": IN, + "dpvoaQual": ST, + "dgnssMode": ST, + "smajErr": DE, + "sminErr": DE, + "dirErr": IN, + }, + "GPPADV110": { + "msgId": ST, # "110" + "lat": DE, + "lon": DE, + "height": DE, + "ele": DE, # optional + "azi": DE, # optional + }, + "GPPADV120": { + "msgId": ST, # "120" + "satgrp": ( # repeating group * 2 + 2, + { + "prn": IN, + "ele": DE, + "azi": DE, + }, + ), + }, + "TNLAVR": { + "msgId": ST, # "AVR" + "utctime": TM, + "yaw": DE, + "yawc": ST, # "Yaw" + "tilt": DE, + "tiltc": ST, # "Tilt" + "roll": DE, + "rollc": ST, # "Roll" + "range": DE, + "gpsQual": IN, + "PDOP": DE, + "sip": IN, + }, + "TNLBPQ": { + "msgId": ST, # "BPQ" + "utctime": TM, + "utcdate": DT, + "lat": LA, + "NS": LAD, + "lon": LN, + "EW": LND, + "height": ST, # starts with "EHT-" + "hunit": CH, # 'M' + "gpsQual": IN, + }, + "TNLDG": { + "msgId": ST, # "DG" TODO check + "strength": DE, + "snr": DE, + "freq": DE, + "bitRate": IN, + "chan": IN, + "trkStatus": CH, + "trkPerf": IN, + }, + "TNLEVT": { + "msgId": ST, # "EVT" + "utctime": TM, + "port": IN, + "numEvents": IN, + "wno": IN, + "dow": IN, + "leaps": IN, + }, + "TNLGGK": { + "msgId": ST, # "GGK" + "utctime": TM, + "utcdate": DT, + "lat": LA, + "NS": LAD, + "lon": LN, + "EW": LND, + "gpsQual": IN, + "sip": IN, + "DOP": DE, + "height": ST, # starts with "EHT-" + "hunit": CH, # 'M' + }, + "TNLGGKx": { + "msgId": ST, # "GGK" + "utctime": TM, + "utcdate": DT, + "lat": LA, + "NS": LAD, + "lon": LN, + "EW": LND, + "posType": IN, + "sip": IN, + "PDOP": DE, + "height": DE, + "numExt": IN, + "sigmaE": DE, + "sigmaN": DE, + "sigmaV": DE, + "propogationAge": DE, + }, + "TNLPJK": { + "msgId": ST, # "PJK" + "utctime": TM, + "utcdate": DT, + "northing": DE, + "nunit": CH, # 'N' + "easting": DE, + "eunit": CH, # 'E" + "gpsQual": IN, + "sip": IN, + "DOP": DE, + "height": ST, # starts with "EHT-" or "GHT-" + "hunit": CH, # 'M' + }, + "TNLPJT": { + "msgId": ST, # "PJT" + "coordName": ST, + "projName": ST, + }, + "TNLREX": { + "msgId": ST, # "REX" + "utctime": TM, + "constUsed": ST, + "sip": IN, + "lat": LA, + "NS": LAD, + "lon": LN, + "EW": LND, + "alt": DE, + "latSigmaErr": DE, + "lonSigmaErr": DE, + "heightSigmaErr": DE, + "vectE": DE, + "vectN": DE, + "vectV": DE, + "vectESigmaErr": DE, + "vectNSigmaErr": DE, + "vectVSigmaErr": DE, + "corrSource": ST, + }, + "TNLVGK": { + "msgId": ST, # "VGK" + "utctime": TM, + "utcdate": DM, # mmddyy + "vectE": DE, + "vectN": DE, + "vectV": DE, + "gpsQual": IN, + "sip": IN, + "DOP": DE, + "vunit": CH, # 'M' + }, + "TNLVHD": { + "msgId": ST, # "VHD" + "utctime": TM, + "utcdate": DM, # mmddyy + "azi": DE, + "aziRate": DE, + "ele": DE, + "eleRate": DE, + "range": DE, + "rangeRate": DE, + "gpsQual": IN, + "sip": IN, + "PDOP": DE, + "unit": CH, # 'M' + }, + # ********************************************* + # Furuno + # https://www.furuno.com/en/support/sdk/ + # ********************************************* + "FECGPATT": { + "msgId": ST, # 'GPatt' + "yaw": DE, + "pitch": DE, + "roll": DE, + }, + "FECGPHVE": { + "msgId": ST, # 'GPhve' + "heave": DE, + "status": CH, # 'A' + }, + # *************************************************************** + # Locosys Proprietary Messages GET + # https://www.locosystech.com/Templates/att/LS2303x-UDG_datasheet_v0.6.pdf?lng=en + # *************************************************************** + "LSR": { + "msgType": ST, # e.g. "SLOPE", "MEMS", "ATTIT" + "value": IN, # e.g. 0 + "response": ST, # e.g. "OK" + }, + "LSVD": { + "velE": DE, # cm/s + "velN": DE, # cm/s + "velD": DE, # cm/s + "velEdev": DE, # cm/s deviation + "velNdev": DE, # cm/s deviation + "velDdev": DE, # cm/s deviation + }, + "INVMINR": { + "status": CH, # 0 uninitialized; 1、2 calibrating/initializing; 3 calibration done + }, + "INVMSTR": { + "value": IN, + }, + "INVMSLOPE": { + "slope": DE, # degrees + "altDiff": DE, # meters + "moveDist": DE, # meters + "slopeAccu": DE, # degrees + "altDiffAccu": DE, # meters + "moveDistAccu": DE, # meters + }, + "INVMIMU": { + "timeSecond": DE, # sec timestamp + "accelX": DE, # m/s^2 + "accelY": DE, # m/s^2 + "accelZ": DE, # m/s^2 + "gyroX": DE, # degree/s + "gyroY": DE, # degree/s + "gyroZ": DE, # degree/s + }, + "INVMATTIT": { + "roll": DE, # degree + "pitch": DE, # degree + "yaw": DE, # degree heading + }, +} diff --git a/tests/pygpsdata-maritime.log b/tests/pygpsdata-maritime.log new file mode 100644 index 0000000..7ca42e2 --- /dev/null +++ b/tests/pygpsdata-maritime.log @@ -0,0 +1,14 @@ +$IIALF,1,1,0,124304.50,A,W,A,,192,1,1,0,LOST TARGET*14 +$IIALF,2,1,1,081950.10,B,A,S,XYZ,0512,1,2,0,HEADING LOST*2D +$IIALF,2,2,1,,,,,XYZ,0512,1,2,0,NO SYSTEM HEADING AVAILABLE*0D +$AIEPV,R,AI,503123450,101,38400*05 +$VRGEN,0000,011200.00,0123,4567,89AB,CDEF,0123,4567,89AB,CDEF*64 +$VRGEN,0008,011200.00,0123,4567*6C +$INNRM,2,1,00001E1F,00000023,C*38 +$CRNRX,007,001,00,IE69,1,135600,27,06,2001,241,3,A,============================*09 +$CRNRX,007,002,00,,,,,,,,,,========^0D^0AISSUED ON SATURDAY 06 JANUARY 2001.*29 +$CSSM3,123456,005213,798,0,3,14,00,2012,04,05,14,30,3400,N,076,W,300*39 +$CSSMB,008,001,0,123456,FROM:Maritime Rescue Coordination Centre xxx^0D)0ATO:*48 +$IISPW,EPV,211000001,2,SESAME*1A +$IIEPV,C,AI,211000001,111,HEUREKA143*55 +$AIEPV,R,AI,211000001,111,HEUREKA143*4C diff --git a/tests/test_socket.py b/tests/test_socket.py index fe54d39..708ed34 100644 --- a/tests/test_socket.py +++ b/tests/test_socket.py @@ -72,16 +72,16 @@ def testSocketStub(self): EXPECTED_RESULTS = ( "", "", - "", + "", "", "", - "", + "", "", "", - "", + "", "", "", - "", + "", ) raw = None stream = DummySocket() @@ -97,11 +97,10 @@ def testSocketStub(self): break self.assertEqual(i, 12) - def testSocketSend(self): stream = DummySocket() nmr = NMEAReader(stream, bufsize=1024) - msg = NMEAMessage('EI', 'GNQ', POLL, msgId='RMC') + msg = NMEAMessage("EI", "GNQ", POLL, msgId="RMC") res = nmr.datastream.write(msg.serialize()) self.assertEqual(res, None) diff --git a/tests/test_static.py b/tests/test_static.py index 5cb980f..97ee06d 100644 --- a/tests/test_static.py +++ b/tests/test_static.py @@ -12,7 +12,17 @@ import os import unittest -from pynmeagps import NMEAMessage, NMEAMessageError, NMEAReader, NMEATypeError +from pynmeagps import ( + NMEAMessage, + NMEAMessageError, + NMEAReader, + NMEATypeError, + NMEA_MSGIDS, + NMEA_MSGIDS_PROP, + NMEA_PAYLOADS_GET, + NMEA_PAYLOADS_POLL, + NMEA_PAYLOADS_SET, +) from pynmeagps.nmeahelpers import ( area, bearing, @@ -62,6 +72,19 @@ def tearDown(self): # Helper methods # ******************************************* + def testMissingDefs(self): # sanity check for missing payload definitions + for msg in NMEA_MSGIDS: + self.assertTrue( + msg in NMEA_PAYLOADS_GET.keys() + or msg in NMEA_PAYLOADS_POLL + or msg in NMEA_PAYLOADS_SET + ) + + def testMissingCodes(self): # sanity check for missing sentence IDs + for msg in NMEA_PAYLOADS_GET: + print(msg) + self.assertTrue(msg in NMEA_MSGIDS.keys() or msg in NMEA_MSGIDS_PROP.keys()) + def testGetParts(self): res = get_parts(self.messageGLL) self.assertEqual( @@ -146,6 +169,8 @@ def testDate2UTC(self): self.assertEqual(res, datetime.date(2020, 3, 12)) res = date2utc("031220", "DM") self.assertEqual(res, datetime.date(2020, 3, 12)) + res = date2utc("12032020", "DTL") + self.assertEqual(res, datetime.date(2020, 3, 12)) def testTime2UTC(self): res = time2utc("") @@ -162,6 +187,8 @@ def testTime2str(self): def testDate2str(self): res = date2str(datetime.date(2021, 3, 7)) self.assertEqual(res, "070321") + res = date2str(datetime.date(2021, 3, 7), "DTL") + self.assertEqual(res, "07032021") res = date2str(datetime.date(2021, 3, 7), "DM") self.assertEqual(res, "030721") res = date2str("wsdfasdf") diff --git a/tests/test_stream.py b/tests/test_stream.py index 4fda643..a5e8a66 100644 --- a/tests/test_stream.py +++ b/tests/test_stream.py @@ -86,7 +86,7 @@ def testNMEA4( EXPECTED_RESULTS = ( "", "", - "", + "", "", "", "", @@ -122,15 +122,15 @@ def testNMEA4( "", "", "", - "", + "", "", - "", + "", "", "", "", "", "", - "", + "", "", "", ) @@ -225,6 +225,35 @@ def testMIXED2( i += 1 self.assertTrue(EXPECTED_ERROR in str(context.exception)) + def testNMEAMARITIME(self): # test NMEA maritime messages + EXPECTED_RESULTS = ( + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + ) + + i = 0 + raw = 0 + with open(os.path.join(DIRNAME, "pygpsdata-maritime.log"), "rb") as stream: + nmr = NMEAReader(stream, nmeaonly=True, quitonerror=2) + for raw, parsed in nmr: + if raw is not None: + # print(f'"{parsed}",') + self.assertEqual(str(parsed), EXPECTED_RESULTS[i]) + i += 1 + self.assertEqual(i, 14) + def testNMEAITER(self): # NMEAReader iterator EXPECTED_RESULTS = ( "",