Skip to content

Commit da908e8

Browse files
authored
Merge pull request #208 from semuconsulting/RC-1.3.4
Rc 1.3.4
2 parents 8029a54 + 6206b2d commit da908e8

14 files changed

Lines changed: 910 additions & 746 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This is an independent project and we have no affiliation whatsoever with u-blox
3434
![Contributors](https://img.shields.io/github/contributors/semuconsulting/pyubx2.svg)
3535
![Open Issues](https://img.shields.io/github/issues-raw/semuconsulting/pyubx2)
3636

37-
The library implements a comprehensive set of inbound (SET/POLL) and outbound (GET) messages for all current u-blox GPS/GNSS devices, but is readily [extensible](#extensibility). Refer to `UBX_MSGIDS` in [ubxtypes_core.py](https://github.com/semuconsulting/pyubx2/blob/master/src/pyubx2/ubxtypes_core.py) for the complete dictionary of messages currently supported. UBX protocol information sourced from public domain u-blox Interface Specifications © 2013-2025, u-blox AG.
37+
The library implements a comprehensive set of inbound (SET/POLL) and outbound (GET) messages for all current u-blox GPS/GNSS devices, but is readily [extensible](#extensibility). Refer to `UBX_MSGIDS` in [ubxtypes_core.py](https://github.com/semuconsulting/pyubx2/blob/master/src/pyubx2/ubxtypes_core.py) for the complete dictionary of messages currently supported. UBX protocol information sourced from public domain u-blox Interface Specifications © 2013-2026, u-blox AG.
3838

3939
Sphinx API Documentation in HTML format is available at [https://www.semuconsulting.com/pyubx2/](https://www.semuconsulting.com/pyubx2/).
4040

@@ -442,7 +442,7 @@ The UBX protocol is principally defined in the modules `ubxtypes_*.py` as a seri
442442
1. attribute names must be unique within each message class
443443
2. attribute types must be one of the valid types (I1, U2, X4, etc.)
444444
3. if the attribute is scaled, attribute type is list of [attribute type as string (I1, U2, etc.), scaling factor as float] e.g. {"lat": [I4, 1e-7]}
445-
4. repeating or bitfield groups must be defined as a tuple ('numr', {dict}), where:
445+
4. repeating or bitfield groups must be suffixed "_grp" or "_bit" and defined as a tuple ('numr', {dict}), where:
446446
'numr' is either:
447447
a. an integer representing a fixed number of repeats e.g. 32
448448
b. a string representing the name of a preceding attribute containing the number of repeats e.g. 'numCh'

RELEASE_NOTES.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
# pyubx2 Release Notes
22

3-
### RELEASE 1.3.3
3+
### RELEASE 1.3.4
4+
5+
1. Minor performance improvements to parsing.
6+
1. Update support for ZED-X20D (https://content.u-blox.com/sites/default/files/documents/ZED-X20D_HDG200_RN_UBXDOC-304424225-21402.pdf):
47

5-
1. Add new configuration database keys for ZED-X20P firmware HGP 2.10:
8+
### RELEASE 1.3.3
69

7-
- "CFG_I2C_PULL_UPS_DISABLED": (0x1051000b, L),
8-
- "CFG_NAVCOR_ENABLE_GAL_HAS": (0x100d0002, L),
9-
- "CFG_NAVCOR_ENABLE_HOST": (0x100d0001, L),
10-
- "CFG_RTCM_DF028_OUT": (0x30090010, U2),
11-
- "CFG_SIGNAL_QZSS_L1CB_ENA": (0x10310039, L),
10+
1. Add new configuration database keys for ZED-X20P:
1211

1312
### RELEASE 1.3.2
1413

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ classifiers = [
3333
"Topic :: Scientific/Engineering :: GIS",
3434
]
3535

36-
dependencies = ["pynmeagps >= 1.1.4", "pyrtcm >= 1.1.12"]
36+
dependencies = ["pynmeagps >= 1.1.5", "pyrtcm >= 1.1.12"]
3737

3838
[project.urls]
3939
homepage = "https://github.com/semuconsulting/pyubx2"

src/pyubx2/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
:license: BSD 3-Clause
99
"""
1010

11-
__version__ = "1.3.3"
11+
__version__ = "1.3.4"

src/pyubx2/ubxmessage.py

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@
3333
val2bytes,
3434
)
3535
from pyubx2.ubxtypes_core import (
36+
BITFIELD,
3637
CH,
3738
GET,
39+
GROUP,
3840
POLL,
3941
SCALROUND,
4042
SET,
@@ -44,12 +46,6 @@
4446
UBX_CLASSES,
4547
UBX_HDR,
4648
UBX_MSGIDS,
47-
X1,
48-
X2,
49-
X4,
50-
X6,
51-
X8,
52-
X24,
5349
)
5450
from pyubx2.ubxtypes_get import UBX_PAYLOADS_GET
5551
from pyubx2.ubxtypes_poll import UBX_PAYLOADS_POLL
@@ -178,23 +174,22 @@ def _set_attribute(
178174
"""
179175

180176
adef = pdict[anam] # get attribute definition
181-
if isinstance(
182-
adef, tuple
183-
): # repeating group of attributes or subdefined bitfield
184-
numr, _ = adef
185-
if numr in (X1, X2, X4, X6, X8, X24): # bitfield
186-
if self._parsebf in (1, 2): # if we're parsing bitfields
187-
if self._parsebf == 2: # parse as bytes and bits
188-
self._set_attribute_single(anam, numr, offset, index, **kwargs)
189-
offset, index = self._set_attribute_bitfield(
190-
adef, offset, index, **kwargs
191-
) # parse as bits
192-
else: # parse as bytes only
193-
offset = self._set_attribute_single(
194-
anam, numr, offset, index, **kwargs
177+
if BITFIELD in anam: # 'X' type bitfield
178+
sdef, _ = adef
179+
if self._parsebf in (1, 2): # if we're parsing bitfields
180+
if self._parsebf == 2: # parse as bits and single attribute
181+
self._set_attribute_single(
182+
anam[0:-4], sdef, offset, index, **kwargs
195183
)
196-
else: # repeating group of attributes
197-
offset, index = self._set_attribute_group(adef, offset, index, **kwargs)
184+
offset, index = self._set_attribute_bitfield(
185+
adef, offset, index, **kwargs
186+
)
187+
else: # parse as single attribute only
188+
offset = self._set_attribute_single(
189+
anam[0:-4], sdef, offset, index, **kwargs
190+
)
191+
elif GROUP in anam: # repeating group
192+
offset, index = self._set_attribute_group(adef, offset, index, **kwargs)
198193
else: # single attribute
199194
offset = self._set_attribute_single(anam, adef, offset, index, **kwargs)
200195

@@ -278,7 +273,7 @@ def _set_attribute_single(
278273

279274
# if attribute is scaled
280275
ares = 1
281-
if isinstance(adef, list):
276+
if isinstance(adef, tuple):
282277
ares = adef[1] # attribute resolution (i.e. scaling factor)
283278
adef = adef[0] # attribute definition
284279

src/pyubx2/ubxtypes_configdb.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,11 @@
498498
"CFG_MSGOUT_UBX_MON_MSGPP_UART1": (0x20910197, U1),
499499
"CFG_MSGOUT_UBX_MON_MSGPP_UART2": (0x20910198, U1),
500500
"CFG_MSGOUT_UBX_MON_MSGPP_USB": (0x20910199, U1),
501+
"CFG_MSGOUT_UBX_MON_PT2_I2C": (0x20910209, U1),
502+
"CFG_MSGOUT_UBX_MON_PT2_SPI": (0x2091020D, U1),
503+
"CFG_MSGOUT_UBX_MON_PT2_UART1": (0x2091020A, U1),
504+
"CFG_MSGOUT_UBX_MON_PT2_UART2": (0x2091020B, U1),
505+
"CFG_MSGOUT_UBX_MON_PT2_USB": (0x2091020C, U1),
501506
"CFG_MSGOUT_UBX_MON_RF_I2C": (0x20910359, U1),
502507
"CFG_MSGOUT_UBX_MON_RF_SPI": (0x2091035D, U1),
503508
"CFG_MSGOUT_UBX_MON_RF_UART1": (0x2091035A, U1),
@@ -678,6 +683,11 @@
678683
"CFG_MSGOUT_UBX_NAV_COV_UART1": (0x20910084, U1),
679684
"CFG_MSGOUT_UBX_NAV_COV_UART2": (0x20910085, U1),
680685
"CFG_MSGOUT_UBX_NAV_COV_USB": (0x20910086, U1),
686+
"CFG_MSGOUT_UBX_NAV_DAHEADING_I2C": (0x209103DF, U1),
687+
"CFG_MSGOUT_UBX_NAV_DAHEADING_SPI": (0x209103E3, U1),
688+
"CFG_MSGOUT_UBX_NAV_DAHEADING_UART1": (0x209103E0, U1),
689+
"CFG_MSGOUT_UBX_NAV_DAHEADING_UART2": (0x209103E1, U1),
690+
"CFG_MSGOUT_UBX_NAV_DAHEADING_USB": (0x209103E2, U1),
681691
"CFG_MSGOUT_UBX_NAV_DGPS_I2C": (0x20910074, U1),
682692
"CFG_MSGOUT_UBX_NAV_DGPS_SPI": (0x20910078, U1),
683693
"CFG_MSGOUT_UBX_NAV_DGPS_UART1": (0x20910075, U1),
@@ -1005,13 +1015,14 @@
10051015
"CFG_NAVMASK_SV_MASK_GPS": (0x50180013, X8),
10061016
"CFG_NAVMASK_SV_MASK_NAVIC": (0x50180018, X8),
10071017
"CFG_NAVMASK_SV_MASK_QZSS": (0x50180017, X8),
1018+
"CFG_NAVHPG_CORR_CONV_OSR": (0x30140062, X2),
10081019
"CFG_NAVSPG_ACKAIDING": (0x10110025, L),
10091020
"CFG_NAVSPG_CONSTR_ALT": (0x401100C1, I4),
10101021
"CFG_NAVSPG_CONSTR_ALTVAR": (0x401100C2, U4),
10111022
"CFG_NAVSPG_CONSTR_DGNSSTO": (0x201100C4, U1),
10121023
"CFG_NAVSPG_CONSTR_DGNSSTO_SCALE": (0x201100C5, U1),
10131024
"CFG_NAVSPG_CONSTR_PROPLIMIT": (0x401100C3, U4),
1014-
# "CFG_NAVSPG_DAHEADING_OFFSET": (0x40??????, U4),
1025+
"CFG_NAVSPG_DAHEADING_OFFSET": (0x401100E4, U4), # not in docs, got from ucenter2
10151026
"CFG_NAVSPG_DCMMODE": (0x20110023, E1),
10161027
"CFG_NAVSPG_DYNMODEL": (0x20110021, E1),
10171028
"CFG_NAVSPG_FIXMODE": (0x20110011, E1),
@@ -1135,6 +1146,8 @@
11351146
"CFG_SEC_CFG_LOCK": (0x10F60009, L),
11361147
"CFG_SEC_CFG_LOCK_UNLOCKGRP1": (0x30F6000A, U2),
11371148
"CFG_SEC_CFG_LOCK_UNLOCKGRP2": (0x30F6000B, U2),
1149+
"CFG_SEC_COM_SIGN_RATE": (0x30F60061, U2),
1150+
"CFG_SEC_COM_SIGN_SCHEME": (0x30F60060, E2),
11381151
"CFG_SEC_JAMDET_SENSITIVITY_HI": (0x10F60051, L),
11391152
"CFG_SEC_SPOOFDET_SIM_SIG_DIS": (0x10F6005D, L),
11401153
"CFG_SFCORE_HNR_RATE": (0x2008001A, U1),

src/pyubx2/ubxtypes_core.py

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,55 @@
3636
"""Ignore errors"""
3737

3838
# scaling factor constants
39-
SCAL9 = 1e-9 # 0.000000001
40-
SCAL8 = 1e-8 # 0.00000001
41-
SCAL7 = 1e-7 # 0.0000001
42-
SCAL6 = 1e-6 # 0.000001
43-
SCAL5 = 1e-5 # 0.00001
44-
SCAL4 = 1e-4 # 0.0001
45-
SCAL3 = 1e-3 # 0.001
46-
SCAL2 = 1e-2 # 0.01
47-
SCAL1 = 1e-1 # 0.1
39+
E1_N1 = 1e-1 # 0.1
40+
E1_N2 = 1e-2 # 0.01
41+
E1_N3 = 1e-3 # 0.001
42+
E1_N4 = 1e-4 # 0.0001
43+
E1_N5 = 1e-5 # 0.00001
44+
E1_N6 = 1e-6 # 0.000001
45+
E1_N7 = 1e-7 # 0.0000001
46+
E1_N8 = 1e-8 # 0.00000001
47+
E1_N9 = 1e-9 # 0.000000001
48+
P2_N5 = 0.03125 # 2**-5
49+
P2_N6 = 0.015625 # 2**-6
50+
P2_N8 = 0.00390625 # 2**-8
51+
P2_N9 = 0.001953125 # 2**-9
52+
P2_N10 = 0.0009765625 # 2**-10
53+
P2_N11 = 0.00048828125 # 2**-11
54+
P2_N12 = 0.000244140625 # 2**-12
55+
P2_N14 = 6.103515625e-05 # 2**-14
56+
P2_N15 = 3.0517578125e-05 # 2**-15
57+
P2_N16 = 1.52587890625e-05 # 2**-16
58+
P2_N18 = 3.814697265625e-06 # 2**-18
59+
P2_N19 = 1.9073486328125e-06 # 2**-19
60+
P2_N20 = 9.5367431640625e-07 # 2**-20
61+
P2_N21 = 4.76837158203125e-07 # 2**-21
62+
P2_N23 = 1.1920928955078125e-07 # 2**-23
63+
P2_N24 = 5.960464477539063e-08 # 2**-24
64+
P2_N25 = 2.9802322387695312e-08 # 2**-25
65+
P2_N27 = 7.450580596923828e-09 # 2**-27
66+
P2_N29 = 1.862645149230957e-09 # 2**-29
67+
P2_N30 = 9.313225746154785e-10 # 2**-30
68+
P2_N31 = 4.656612873077393e-10 # 2**-31
69+
P2_N32 = 2.3283064365386963e-10 # 2**-32
70+
P2_N33 = 1.1641532182693481e-10 # 2**-33
71+
P2_N34 = 5.820766091346741e-11 # 2**-34
72+
P2_N35 = 2.9103830456733704e-11 # 2**-35
73+
P2_N38 = 3.637978807091713e-12 # 2**-38
74+
P2_N40 = 9.094947017729282e-13 # 2**-40
75+
P2_N43 = 1.1368683772161603e-13 # 2**-43
76+
P2_N46 = 1.4210854715202004e-14 # 2**-46
77+
P2_N50 = 8.881784197001252e-16 # 2**-50
78+
P2_N51 = 4.440892098500626e-16 # 2**-51
79+
P2_N55 = 2.7755575615628914e-17 # 2**-55
80+
P2_N59 = 1.734723475976807e-18 # 2**-59
81+
P2_N66 = 1.3552527156068805e-20 # 2**-66
82+
P2_P3 = 8 # 2**3
83+
P2_P4 = 16 # 2**4
84+
P2_P11 = 2048 # 2**11
85+
P2_P12 = 4096 # 2**12
86+
P2_P14 = 16384 # 2**14
87+
P2_P16 = 65536 # 2**16
4888
SCALROUND = 12 # number of dp to round scaled attributes to
4989

5090
# **************************************************
@@ -78,12 +118,14 @@
78118
U10 = "U010" # Unsigned Int 10 bytes
79119
U11 = "U011" # Unsigned Int 11 bytes
80120
U12 = "U012" # Unsigned Int 12 bytes
121+
U14 = "U014" # Unsigned Int 14 bytes
81122
U15 = "U015" # Unsigned Int 15 bytes
82123
U16 = "U016" # Unsigned Int 16 bytes
83124
U20 = "U020" # Unsigned Int 20 bytes
84125
U22 = "U022" # Unsigned Int 22 bytes
85126
U23 = "U023" # Unsigned Int 23 bytes
86127
U24 = "U024" # Unsigned Int 24 bytes
128+
U27 = "U027" # Unsigned Int 27 bytes
87129
U32 = "U032" # Unsigned Int 32 bytes
88130
U40 = "U040" # Unsigned Int 40 bytes
89131
U64 = "U064" # Unsigned Int 64 bytes
@@ -98,6 +140,9 @@
98140
R4 = "R004" # Float (IEEE 754) Single Precision 4 bytes
99141
R8 = "R008" # Float (IEEE 754) Double Precision 8 bytes
100142

143+
BITFIELD = "_bit"
144+
GROUP = "_grp"
145+
101146
ATTTYPE = {
102147
"A": type([0, 1]),
103148
"C": (type(b"0"), type("0")),
@@ -311,6 +356,7 @@
311356
b"\x0a\x02": "MON-IO", # deprecated, use MON-COMMS
312357
b"\x0a\x06": "MON-MSGPP", # deprecated, use MON-COMMS
313358
b"\x0a\x27": "MON-PATCH",
359+
b"\x0a\x2b": "MON-PT2",
314360
b"\x0a\x38": "MON-RF",
315361
b"\x0a\x07": "MON-RXBUF", # deprecated, use MON-COMMS
316362
b"\x0a\x21": "MON-RXR",

0 commit comments

Comments
 (0)