semuconsulting / pyubx2

Python library for parsing and generating UBX GPS/GNSS protocol messages.
BSD 3-Clause "New" or "Revised" License
175 stars 68 forks source link

Structure of `SIC-SEG` changed in firmware 1.50 #156

Closed Niederb closed 2 months ago

Niederb commented 2 months ago

The recent release of the firmware HPG 1.50 changed the structure of the SIC-SEG message quite a bit and the new structure is not backwards compatible to the old one. Some of the reserved parts were removed and a list of jammed frequencies was added. I could try to come up with a PR that supports the new structure, but I'm not sure how to do it without breaking the structure for older releases. Do you support multiple firmware versions?

Niederb commented 2 months ago

I just realized that the version in the message was increased to 0x02. So the two versions could be separated using the version number.

Niederb commented 2 months ago

Thanks a lot for the quick response and fix of the issue 👍

semuadmin commented 2 months ago

Thanks a lot for the quick response and fix of the issue 👍

No problem - thanks for the contribution.

In answer to your question, pyubx2 doesn't explicitly support different u-blox protocol versions, but it can support multiple variants of the same message class which - to date - is all that's been necessary to support all protocols from Generation 6 onwards - see ubxvariants.py. These days, u-blox generally uses the version attribute to differentiate between variants, but this wasn't always the case. Previously I've had to use e.g. payload length or the existence of a specific byte pattern.