Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix decoding fixed length arrays of struct in python sbp2json [AP-946] #1378

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion generator/sbpg/targets/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def construct_format(f, type_map=CONSTRUCT_CODE):
f_ = copy.copy(f)
f_.type_id = fill
s = f.options.get('size', None).value
return "'{id}' / construct.Array({size}, {type})".format(id=f.identifier, size=s, type=type_map.get(f_.type_id, 'construct.Byte'))
return "'{id}' / construct.Array({size}, {type})".format(id=f.identifier, size=s, type=type_map.get(f_.type_id, f'{fill}._parser'))
elif f.type_id == 'array':
fill = f.options['fill'].value
if type_map.get(fill):
Expand Down
2 changes: 1 addition & 1 deletion python/sbp/RELEASE-VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.3
5.0.3
6 changes: 3 additions & 3 deletions python/sbp/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ class MsgTrackingIq(SBP):
_parser = construct.Struct(
'channel' / construct.Int8ul,
'sid' / GnssSignal._parser,
'corrs' / construct.Array(3, construct.Byte),)
'corrs' / construct.Array(3, TrackingChannelCorrelation._parser),)
__slots__ = [
'channel',
'sid',
Expand Down Expand Up @@ -992,7 +992,7 @@ class MsgTrackingIqDepB(SBP):
_parser = construct.Struct(
'channel' / construct.Int8ul,
'sid' / GnssSignal._parser,
'corrs' / construct.Array(3, construct.Byte),)
'corrs' / construct.Array(3, TrackingChannelCorrelationDep._parser),)
__slots__ = [
'channel',
'sid',
Expand Down Expand Up @@ -1097,7 +1097,7 @@ class MsgTrackingIqDepA(SBP):
_parser = construct.Struct(
'channel' / construct.Int8ul,
'sid' / GnssSignalDep._parser,
'corrs' / construct.Array(3, construct.Byte),)
'corrs' / construct.Array(3, TrackingChannelCorrelationDep._parser),)
__slots__ = [
'channel',
'sid',
Expand Down
Loading