Skip to content

Commit

Permalink
Merge pull request #62 from semuconsulting/RC-1.0.39
Browse files Browse the repository at this point in the history
Rc 1.0.39
  • Loading branch information
semuadmin authored Aug 22, 2024
2 parents 4b08228 + 50ce7f8 commit 758bc37
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"editor.formatOnSave": true,
"modulename": "${workspaceFolderBasename}",
"distname": "${workspaceFolderBasename}",
"moduleversion": "1.0.38",
"moduleversion": "1.0.39",
}
6 changes: 6 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# pynmeagps Release Notes

### RELEASE 1.0.39

ENHANCEMENTS:

1. Add support for NMEA streams with lower case hex checksums

### RELEASE 1.0.38

ENHANCEMENTS:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.38"
version = "1.0.39"
license = { file = "LICENSE" }
readme = "README.md"
requires-python = ">=3.8"
Expand Down
2 changes: 1 addition & 1 deletion src/pynmeagps/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
:license: BSD 3-Clause
"""

__version__ = "1.0.38"
__version__ = "1.0.39"
2 changes: 1 addition & 1 deletion src/pynmeagps/nmeareader.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def parse(
content, talker, msgid, payload, checksum = get_parts(message)
if validate & VALCKSUM:
ccksum = calc_checksum(content)
if checksum != ccksum:
if checksum.upper() != ccksum:
raise nme.NMEAParseError(
f"Message {talker}{msgid} invalid checksum {checksum}"
f" - should be {ccksum}."
Expand Down
5 changes: 5 additions & 0 deletions tests/pygpsdata-nmea4lc.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$GNRMC,103607.00,A,5327.03942,N,10214.42462,W,0.046,,060321,,,A,V*0e
$GPGSV,3,1,11,01,06,014,08,12,43,207,28,14,06,049,,15,44,171,23,1*6b
$GNZDA,103607.00,06,03,2021,00,00*7f
$GNGBS,103607.00,15.1,24.2,31.0,,,,,,*6f
$GNVLW,,N,,N,0.000,N,0.000,N*44
17 changes: 17 additions & 0 deletions tests/test_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,23 @@ def testBADHDR_IGNORE(self): # invalid header in data with quitonerror = 0
i += 1
self.assertEqual(i, 15)

def testLCCHECKSUM(self): # lower case checksum bytes
EXPECTED_RESULTS = (
"<NMEA(GNRMC, time=10:36:07, status=A, lat=53.450657, NS=N, lon=-102.2404103333, EW=W, spd=0.046, cog=, date=2021-03-06, mv=, mvEW=, posMode=A, navStatus=V)>",
"<NMEA(GPGSV, numMsg=3, msgNum=1, numSV=11, svid_01=1, elv_01=6.0, az_01=14, cno_01=8, svid_02=12, elv_02=43.0, az_02=207, cno_02=28, svid_03=14, elv_03=6.0, az_03=49, cno_03=, svid_04=15, elv_04=44.0, az_04=171, cno_04=23, signalID=1)>",
"<NMEA(GNZDA, time=10:36:07, day=6, month=3, year=2021, ltzh=00, ltzn=00)>",
"<NMEA(GNGBS, time=10:36:07, errLat=15.1, errLon=24.2, errAlt=31.0, svid=, prob=, bias=, stddev=, systemId=, signalId=)>",
"<NMEA(GNVLW, twd=, twdUnit=N, wd=, wdUnit=N, tgd=0.0, tgdUnit=N, gd=0.0, gdUnit=N)>",
)
i = 0
with open(os.path.join(DIRNAME, "pygpsdata-nmea4lc.log"), "rb") as stream:
ubr = NMEAReader(stream, quitonerror=ERR_RAISE)
for raw, parsed in ubr:
# print(f'"{parsed}",')
self.assertEqual(str(parsed), EXPECTED_RESULTS[i])
i += 1
self.assertEqual(i, 5)


if __name__ == "__main__":
# import sys;sys.argv = ['', 'Test.testName']
Expand Down

0 comments on commit 758bc37

Please sign in to comment.