CHANGES:
- Add new optional
timetags
argument to SPARTNReader & SPARTNMessage, to allow them to use any available 32-bit gnssTimeTag values from the incoming datastream in order to decrypt messages (rather than having to provide an explicit basedate). Thetimetags
argument is a dict of the format{0: 495763673, 1: 485866844, 3: 410283479}
where the key represents the message subType (0 = GPS, 1 = GLO, 2 = GAL, etc.), and the value represents the 32-bit gnssTimeTag value to use.- If a nominal decryption basedate of
TIMEBASE
(datetime(2010, 1, 1, 0, 0, tzinfo=timezone.utc)
), or integer0
, is passed to SPARTNReader, it will endeavour to capture 32-bitgnssTimeTag
values for eachmsgSubtype
from the incoming data stream and pass these to SPARTNMessage to decrypt messages of the samemsgSubtype
with 16-bit gnssTimeTags (timeTagtype=0
). - NB: this will only work if the data stream contains valid 32-bit
gnssTimeTag
values for the samemsgSubtype
e.g. if an HPAC message for a givenmsgSubtype
precedes a GAD or OCB message for the samemsgSubType
- until such an eventuality occurs, decryption of GAD or OCB messages may fail! - Always use
quitonerror=ERRLOG
orquitonerror=ERRIGNORE
when setting basedate toTIMEBASE
.
- If a nominal decryption basedate of
- SPARTMMessage will now return explicit
SPARTNDecryptionError
if unable to successfully decrypt/decode message using key and basedate provided.
CHANGES:
- Add active support for Python 3.13
- Drop active support for Python 3.8 - now EOL as at October 2024.
- Rename socket_stream to socket_wrapper for clarity.
FIXES:
- Add offsets to SF043, SF045 and SF048 - thanks to @jonathanmuller for contribution.
ENHANCEMENTS:
- Include SPARTNStreamError in ERRIGNORE handling.
ENHANCEMENTS:
- Internal enhancements to logging and exception handling.
ENHANCEMENTS:
- Add payload attributes for PRN, Phase Bias and Code Bias values, derived from the corresponding bitmasks for each constellation type. e.g.
PRN_01=3
,PhaseBias_01_03=L2L
,CodeBias_02_03=C2L
. - Add examples
parse_ocb.py
&parse_hpac.py
illustrating how to convert parsed and decoded OCB and HPAC messages into iterable data structures. - Add
naive2aware(dt,tz)
helper method - convert naive basedates to aware with UTC timezone. - Internal enhancements to simplify basedate handling.
FIXES:
- Fix
TypeError: can't subtract offset-naive and offset-aware datetimes
error when using default basedates. Basedates must always contain timezone information. - Use
timezone.utc
rather thandatetime.UTC
for compatibility with older Python versions.
ENHANCEMENTS:
- Improved handling of half-day rollovers - thanks to @jonathanmuller for contribution.
- Update SPARTN-1X-BPAC and SPARTN-1X-EAS-DYN handling (not tested).
ENHANCEMENTS:
- attributes are now converted to type automatically e.g. float attributes will automatically be converted to floats via the
enc2float()
helper method using the documented resolution and range minimum values. - SPARTNReader will now store any 32-bit gnssTimeTags for each msgSubtype (GPS, GLO, GAL, etc.) from the incoming datastream for use as 'basedates' in the decryption of any encrypted messages with ambiguous 16-bit gnssTimetags (timeTagtype = 0). If no 32-bit gnssTimeTags are available for a given msgSubtype, the input argument 'basedate' will be used instead, adjusted for any UTC & leap second shift for that msgSubtype (e.g. GLONASS basedate = GPS + 3600*3-18).
- Update test cases.
- Other minor internal streamlining.
FIXES:
- Fix
datadesc()
helper method with certain attribute names e.g.SF049a
.
FIXES:
- Fix Area count iterations - attribute SF030 represents (area count - 1). Affects GAD and HPAC payloads.
ENHANCEMENTS:
- Add
SPARTNMessage._padding
attribute to allow informal checking of decryption (0 <= msg._padding <= 8
). - Examples updated.
ENHANCEMENTS:
- Streamline and simplify conditional group parsing.
FIXES:
- Fix OCB IODE payload definition =- thanks to @jonathanmuller for contribution.
FIXES:
- Fix "no authInd attribute" error when parsing PointPerfect NTRIP SPARTN datastreams.
FIXES:
- OCB payload definitions and decoding updated.
- pyspartn can now successfully decode all GAD and HPAC payloads and the majority of OCB payloads (though further testing is required to validate decoded payload content), but some small OCB payloads (
nData
< 35 bytes) cannot yet be successfully decoded. For the time being, a temporary override has been implemented inspartnmessage.py
to suppress thedecode
flag for those payload types that cannot yet be successfully decoded. This will be removed once testing is completed.
ENHANCEMENTS:
- Add helper methods
timetag2date
anddate2timetag
. - Allow basedate decryption parameter to be passed as either datetime or an integer representing a 32-bit gnssTimeTag. See /examples/gad_plot.py for usage.
CHANGES:
- Update constructor arguments and docstrings to clarify API (no functional changes).
ENHANCEMENTS:
- Add
enc2float
helper method to convert SPARTN encoded floating point values to floats.
CHANGES:
- Add temporary override of decode flag for message types that cannot yet be properly decoded (e.g. OCB)
- Add
gad_plot.py
example to illustrate how to extract geographic area definitions from SPARTN-1X-GAD messages.
FIXES:
convert_timetag
routine updated - should now correctly convert 16-bit timetag to 32-bit for a given 'basedate'.basedate
keyword added to read and parse routines. Defaults todatetime.now()
. This argument must be provided in order to decrypt messages where timeTagType = 0 (ambiguous 16-bit gnssTimeTag format), which typically includes GAD and some OCB message types but not HPAC message types.- As a result of the changes above,
pyspartn
can now successfully decode HPAC and GAD messages, but issues remain with decoding OCB payloads.
CHANGES:
- Remove Python 3.7 from workflows and documentation.
CHANGES:
- Further work on Alpha parsing and decoding functions.
CHANGES:
- Further work on Alpha parsing and decoding functions.
CHANGES:
-
Further work on Alpha parsing and decoding functions. Code now includes complete field and payload definitions and provisional parsing and decryption (AES-CTR) routines for OCB, HPAC and GAD SPARTN message types.
-
NB: Message decrypt and decode not yet fully tested.
-
NB: Decryption of SPARTN payloads requires a 128-bit AES Initialisation Vector (IV) derived from various fields in the message's transport layer. This in turn requires a
gnssTimeTag
value in 32-bit format (representing total seconds from the SPARTN time origin of 2010-01-01 00:00:00). IftimeTagtype = 1
, this can be derived directly from the message's transport layer. IftimeTagtype = 0
, however, it is necessary to convert an ambiguous 16-bit (half-days) timetag to 32-bit format. The SPARTN 2.01 protocol specification provides no details on how to do this, but it appears to be necessary to use the 32-bit timetag or GPS Timestamp from an external concurrent SPARTN or UBX message from the same data source and stream. In other words, it appears SPARTN messages withtimeTagtype = 0
cannot be reliably decrypted in isolation.
See https://portal.u-blox.com/s/question/0D52p0000CimfsOCQQ/spartn-initialization-vector-iv-details for discussion.
- Byte attributes in parsed messages will be fully escaped e.g. b'/x61/x62/x63' rather than b'abc'
- Add CRC checking
- Enhance parsing
- Initial release